mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 04:04:59 -07:00
begin libraryifying raddbgi_cons; switch to raddbgi_format types, or overrideable base-layer-style types; just override & include in codebase-local inclusion sites. next step is to break out this stuff, along with stringization, into a raddbgi helper layer
This commit is contained in:
@@ -135,6 +135,15 @@ commands =
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.build_ryan_scratch =
|
||||
{
|
||||
.win = "build ryan_scratch",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.run_raddbg =
|
||||
{
|
||||
.win = "pushd build && raddbg.exe && popd",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "pe/pe.h"
|
||||
#include "raddbgi_format/raddbgi_format.h"
|
||||
#include "raddbgi_format/raddbgi_format_parse.h"
|
||||
#include "raddbgi_cons/raddbgi_cons.h"
|
||||
#include "raddbgi_cons/raddbgi_cons_local.h"
|
||||
#include "raddbgi_convert/pdb/raddbgi_coff.h"
|
||||
#include "raddbgi_convert/pdb/raddbgi_codeview.h"
|
||||
#include "raddbgi_convert/pdb/raddbgi_msf.h"
|
||||
@@ -59,7 +59,7 @@
|
||||
#include "pe/pe.c"
|
||||
#include "raddbgi_format/raddbgi_format.c"
|
||||
#include "raddbgi_format/raddbgi_format_parse.c"
|
||||
#include "raddbgi_cons/raddbgi_cons.c"
|
||||
#include "raddbgi_cons/raddbgi_cons_local.c"
|
||||
#include "raddbgi_convert/pdb/raddbgi_msf.c"
|
||||
#include "raddbgi_convert/pdb/raddbgi_codeview.c"
|
||||
#include "raddbgi_convert/pdb/raddbgi_pdb.c"
|
||||
|
||||
+532
-492
File diff suppressed because it is too large
Load Diff
+381
-284
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#include "raddbgi_cons.c"
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef RADDBGI_CONS_LOCAL_H
|
||||
#define RADDBGI_CONS_LOCAL_H
|
||||
|
||||
// rjf: base layer memory ops
|
||||
#define raddbgic_memset memset
|
||||
|
||||
// rjf: base layer string overrides
|
||||
#define RADDBGIC_String8 String8
|
||||
#define RADDBGIC_String8_BaseMember str
|
||||
#define RADDBGIC_String8_SizeMember size
|
||||
#define RADDBGIC_String8Node String8Node
|
||||
#define RADDBGIC_String8List String8List
|
||||
|
||||
// rjf: base layer arena overrides
|
||||
#define RADDBGIC_Arena Arena
|
||||
#define RADDBGIC_Arena_AllocImpl arena_alloc
|
||||
#define RADDBGIC_Arena_ReleaseImpl arena_release
|
||||
#define RADDBGIC_Arena_PosImpl arena_pos
|
||||
#define RADDBGIC_Arena_PushImpl arena_push
|
||||
#define RADDBGIC_Arena_PopToImpl arena_pop_to
|
||||
|
||||
#include "raddbgi_cons.h"
|
||||
|
||||
#endif // RADDBGI_CONS_LOCAL_H
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "base/base_inc.h"
|
||||
#include "os/os_inc.h"
|
||||
#include "raddbgi_format/raddbgi_format.h"
|
||||
#include "raddbgi_cons/raddbgi_cons.h"
|
||||
#include "raddbgi_cons/raddbgi_cons_local.h"
|
||||
|
||||
#include "raddbgi_elf.h"
|
||||
#include "raddbgi_dwarf.h"
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "base/base_inc.c"
|
||||
#include "os/os_inc.c"
|
||||
#include "raddbgi_format/raddbgi_format.c"
|
||||
#include "raddbgi_cons/raddbgi_cons.c"
|
||||
#include "raddbgi_cons/raddbgi_cons_local.c"
|
||||
|
||||
#include "raddbgi_elf.c"
|
||||
#include "raddbgi_dwarf.c"
|
||||
|
||||
@@ -193,7 +193,7 @@ pdbconv_u32_from_numeric(PDBCONV_Ctx *ctx, CV_NumericParsed *num){
|
||||
U64 n_u64 = cv_u64_from_numeric(num);
|
||||
U32 n_u32 = (U32)n_u64;
|
||||
if (n_u64 > 0xFFFFFFFF){
|
||||
raddbgic_errorf(ctx->root, "constant too large");
|
||||
raddbgic_push_errorf(ctx->root, "constant too large");
|
||||
n_u32 = 0;
|
||||
}
|
||||
return(n_u32);
|
||||
@@ -829,8 +829,8 @@ pdbconv_type_equip_members(PDBCONV_Ctx *ctx, RADDBGIC_Type *owner_type, CV_TypeI
|
||||
default:
|
||||
{
|
||||
String8 kind_str = cv_string_from_leaf_kind(field_kind);
|
||||
raddbgic_errorf(ctx->root, "unhandled/invalid case: equip_members -> %.*s",
|
||||
str8_varg(kind_str));
|
||||
raddbgic_push_errorf(ctx->root, "unhandled/invalid case: equip_members -> %.*s",
|
||||
str8_varg(kind_str));
|
||||
}break;
|
||||
}
|
||||
|
||||
@@ -953,8 +953,8 @@ pdbconv_type_equip_enumerates(PDBCONV_Ctx *ctx, RADDBGIC_Type *owner_type, CV_Ty
|
||||
default:
|
||||
{
|
||||
String8 kind_str = cv_string_from_leaf_kind(field_kind);
|
||||
raddbgic_errorf(ctx->root, "unhandled/invalid case: equip_enumerates -> %.*s",
|
||||
str8_varg(kind_str));
|
||||
raddbgic_push_errorf(ctx->root, "unhandled/invalid case: equip_enumerates -> %.*s",
|
||||
str8_varg(kind_str));
|
||||
}break;
|
||||
}
|
||||
|
||||
@@ -1653,8 +1653,8 @@ pdbconv_type_cons_leaf_record(PDBCONV_Ctx *ctx, CV_TypeId itype){
|
||||
default:
|
||||
{
|
||||
String8 kind_str = cv_string_from_leaf_kind(range->hdr.kind);
|
||||
raddbgic_errorf(ctx->root, "pdbconv: unhandled leaf case %.*s (0x%x)",
|
||||
str8_varg(kind_str), range->hdr.kind);
|
||||
raddbgic_push_errorf(ctx->root, "pdbconv: unhandled leaf case %.*s (0x%x)",
|
||||
str8_varg(kind_str), range->hdr.kind);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@@ -1669,7 +1669,7 @@ pdbconv_type_resolve_and_check(PDBCONV_Ctx *ctx, CV_TypeId itype){
|
||||
RADDBGIC_Type *result = pdbconv_type_resolve_itype(ctx, itype);
|
||||
if(raddbgic_type_is_unhandled_nil(ctx->root, result))
|
||||
{
|
||||
raddbgic_errorf(ctx->root, "pdbconv: could not resolve itype (itype = %u)", itype);
|
||||
raddbgic_push_errorf(ctx->root, "pdbconv: could not resolve itype (itype = %u)", itype);
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
@@ -3205,7 +3205,7 @@ str8_list_pushf(arena, &out->errors, fmt, __VA_ARGS__);\
|
||||
root_params.bucket_count_types = tpi->itype_opl;
|
||||
root_params.bucket_count_type_constructs = tpi->itype_opl;
|
||||
|
||||
RADDBGIC_Root *root = raddbgic_root_new(&root_params);
|
||||
RADDBGIC_Root *root = raddbgic_root_alloc(&root_params);
|
||||
out->root = root;
|
||||
|
||||
// top level info
|
||||
@@ -3365,7 +3365,7 @@ str8_list_pushf(arena, &out->errors, fmt, __VA_ARGS__);\
|
||||
|
||||
// conversion errors
|
||||
if (!params->hide_errors.converting){
|
||||
for (RADDBGIC_Error *error = raddbgic_get_first_error(root);
|
||||
for (RADDBGIC_Error *error = raddbgic_first_error_from_root(root);
|
||||
error != 0;
|
||||
error = error->next){
|
||||
str8_list_push(arena, &out->errors, error->msg);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "os/os_inc.h"
|
||||
#include "coff/coff.h"
|
||||
#include "raddbgi_format/raddbgi_format.h"
|
||||
#include "raddbgi_cons/raddbgi_cons.h"
|
||||
#include "raddbgi_cons/raddbgi_cons_local.h"
|
||||
|
||||
#include "raddbgi_coff.h"
|
||||
#include "raddbgi_codeview.h"
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "coff/coff.c"
|
||||
#include "os/os_inc.c"
|
||||
#include "raddbgi_format/raddbgi_format.c"
|
||||
#include "raddbgi_cons/raddbgi_cons.c"
|
||||
#include "raddbgi_cons/raddbgi_cons_local.c"
|
||||
|
||||
#include "raddbgi_msf.c"
|
||||
#include "raddbgi_codeview.c"
|
||||
|
||||
@@ -141,7 +141,7 @@ static RADDBGI_GlobalVariable raddbgi_global_variable_nil = {0};
|
||||
static RADDBGI_ThreadVariable raddbgi_thread_variable_nil = {0};
|
||||
static RADDBGI_Procedure raddbgi_procedure_nil = {0};
|
||||
static RADDBGI_Scope raddbgi_scope_nil = {0};
|
||||
static U64 raddbgi_voff_nil = 0;
|
||||
static RADDBGI_U64 raddbgi_voff_nil = 0;
|
||||
static RADDBGI_LocationBlock raddbgi_location_block_nil = {0};
|
||||
static RADDBGI_Local raddbgi_local_nil = {0};
|
||||
#endif
|
||||
|
||||
@@ -1,25 +1,15 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#include <Windows.h>
|
||||
#include "raddbgi_format/raddbgi_format.h"
|
||||
#include "raddbgi_format/raddbgi_format.c"
|
||||
#include "raddbgi_format/raddbgi_format_parse.h"
|
||||
#include "raddbgi_format/raddbgi_format_parse.c"
|
||||
#include "raddbgi_cons/raddbgi_cons.h"
|
||||
#include "raddbgi_cons/raddbgi_cons.c"
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
OutputDebugStringA("Hello, this is a long string which is being output in loop #1.\n");
|
||||
}
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
OutputDebugStringA("Hello, this is a long string which is being output in loop #2.\n");
|
||||
}
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
OutputDebugStringA("Hello, this is a long string which is being output in loop #3.\n");
|
||||
}
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
OutputDebugStringA("Hello, this is a long string which is being output in loop #4.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user