mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-12 23:31:38 -07:00
fix built exes to refer to their pdbs relatively, so that relocated builds can still locate pdbs relatively; eliminate old unused targets; simplify project.4coder
This commit is contained in:
@@ -48,8 +48,8 @@ set cl_debug= call cl /Od /Ob1 /DBUILD_DEBUG=1 %cl_common% %auto_compile_fl
|
||||
set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags%
|
||||
set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags%
|
||||
set clang_release= call clang -g -O2 -DBUILD_DEBUG=0 %clang_common% %auto_compile_flags%
|
||||
set cl_link= /link /MANIFEST:EMBED /INCREMENTAL:NO /natvis:"%~dp0\src\natvis\base.natvis" logo.res
|
||||
set clang_link= -fuse-ld=lld -Xlinker /MANIFEST:EMBED -Xlinker /natvis:"%~dp0\src\natvis\base.natvis" logo.res
|
||||
set cl_link= /link /MANIFEST:EMBED /INCREMENTAL:NO /natvis:"%~dp0\src\natvis\base.natvis" /pdbaltpath:%%%%_PDB%%%% logo.res
|
||||
set clang_link= -fuse-ld=lld -Xlinker /MANIFEST:EMBED -Xlinker /natvis:"%~dp0\src\natvis\base.natvis" logo.res -Xlinker /pdbaltpath:%%%%_PDB%%%%
|
||||
set cl_out= /out:
|
||||
set clang_out= -o
|
||||
|
||||
@@ -105,8 +105,6 @@ if "%rdi_from_dwarf%"=="1" set didbuild=1 && %compile% ..\src\rdi_fr
|
||||
if "%rdi_dump%"=="1" set didbuild=1 && %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
|
||||
if "%rdi_breakpad_from_pdb%"=="1" set didbuild=1 && %compile% ..\src\rdi_breakpad_from_pdb\rdi_breakpad_from_pdb_main.c %compile_link% %out%rdi_breakpad_from_pdb.exe || exit /b 1
|
||||
if "%ryan_scratch%"=="1" set didbuild=1 && %compile% ..\src\scratch\ryan_scratch.c %compile_link% %out%ryan_scratch.exe || exit /b 1
|
||||
if "%cpp_tests%"=="1" set didbuild=1 && %compile% ..\src\scratch\i_hate_c_plus_plus.cpp %compile_link% %out%cpp_tests.exe || exit /b 1
|
||||
if "%look_at_raddbg%"=="1" set didbuild=1 && %compile% ..\src\scratch\look_at_raddbg.c %compile_link% %out%look_at_raddbg.exe || exit /b 1
|
||||
if "%mule_main%"=="1" set didbuild=1 && del vc*.pdb mule*.pdb && %compile_release% %only_compile% ..\src\mule\mule_inline.cpp && %compile_release% %only_compile% ..\src\mule\mule_o2.cpp && %compile_debug% %EHsc% ..\src\mule\mule_main.cpp ..\src\mule\mule_c.c mule_inline.obj mule_o2.obj %compile_link% %no_aslr% %out%mule_main.exe || exit /b 1
|
||||
if "%mule_module%"=="1" set didbuild=1 && %compile% ..\src\mule\mule_module.cpp %compile_link% %link_dll% %out%mule_module.dll || exit /b 1
|
||||
if "%mule_hotload%"=="1" set didbuild=1 && %compile% ..\src\mule\mule_hotload_main.c %compile_link% %out%mule_hotload.exe & %compile% ..\src\mule\mule_hotload_module_main.c %compile_link% %link_dll% %out%mule_hotload_module.dll || exit /b 1
|
||||
|
||||
+37
-120
@@ -45,135 +45,52 @@ load_paths =
|
||||
|
||||
commands =
|
||||
{
|
||||
.rjf_f1 =
|
||||
{
|
||||
//.win = "build rdi_from_pdb rdi_dump && pushd build && rdi_from_pdb --pdb:mule_main.pdb --out:mule_main.rdi && rdi_dump mule_main.rdi > mule_main.dump && popd",
|
||||
.win = "build raddbg telemetry",
|
||||
//.win = "build ryan_scratch",
|
||||
//.win = "wsl ./build.sh ryan_scratch",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.rjf_f2 =
|
||||
{
|
||||
.win = "build rdi_from_pdb rdi_dump && pushd build && rdi_from_pdb --pdb:mule_main.pdb --out:mule_main.rdi && rdi_dump mule_main.rdi > mule_main.dump && popd",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.rjf_f3 =
|
||||
{
|
||||
.win = "pushd build && raddbg.exe --user:local_dev.raddbg_user --project:local_dev.raddbg_project && popd",
|
||||
//.win = "pushd build && ryan_scratch.exe && popd",
|
||||
//.win = "wsl ./build/ryan_scratch",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.rjf_f4 =
|
||||
{
|
||||
.win = "build rdi_from_pdb release telemetry && pushd build && rdi_from_pdb.exe --pdb:UnrealEditorFortnite.pdb --out:profile.rdi --capture && popd",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.rjf_f5 =
|
||||
{
|
||||
.win = "pushd build && rdi_from_pdb.exe --exe:raddbg.exe --pdb:raddbg.pdb --out:raddbg.rdi --capture && popd",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.build_raddbg =
|
||||
{
|
||||
.win = "build raddbg",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.build_raddbg_release_telemetry =
|
||||
{
|
||||
.win = "build raddbg release telemetry",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.build_rdi_from_pdb =
|
||||
{
|
||||
.win = "build rdi_from_pdb",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.build_rdi_dump =
|
||||
{
|
||||
.win = "build rdi_dump",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
.build_mule_main =
|
||||
{
|
||||
.win = "build mule_main",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.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",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
.save_dirty_files = true,
|
||||
.cursor_at_end = false,
|
||||
},
|
||||
//- rjf: fkey command slots (change locally but do not commit)
|
||||
.build_f1 = { .win = "build raddbg telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_f2 = { .win = "build rdi_from_pdb", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_f3 = { .win = "pushd build && raddbg.exe --user:local_dev.raddbg_user --project:local_dev.raddbg_project && popd", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
|
||||
//- rjf: local target builds
|
||||
.build_raddbg = { .win = "build raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_from_pdb = { .win = "build rdi_from_pdb", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_from_dwarf = { .win = "build rdi_from_dwarf", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_dump = { .win = "build rdi_dump", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_breakpad_from_pdb = { .win = "build rdi_breakpad_from_pdb", .linux = "", .out = "*compilation*", .footer_panel = true, .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, },
|
||||
.build_mule_main = { .win = "build mule_main", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_mule_module = { .win = "build mule_module", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_mule_hotload = { .win = "build mule_hotload", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_mule_peb_trample = { .win = "build mule_peb_trample", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
|
||||
//- rjf: wsl target builds
|
||||
.build_raddbg_wsl = { .win = "wsl ./build.sh raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_from_pdb_wsl = { .win = "wsl ./build.sh rdi_from_pdb", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_from_dwarf_wsl = { .win = "wsl ./build.sh rdi_from_dwarf", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_dump_wsl = { .win = "wsl ./build.sh rdi_dump", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_rdi_breakpad_from_pdb_wsl = { .win = "wsl ./build.sh rdi_breakpad_from_pdb", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_ryan_scratch_wsl = { .win = "wsl ./build.sh ryan_scratch", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_mule_main_wsl = { .win = "wsl ./build.sh mule_main", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_mule_module_wsl = { .win = "wsl ./build.sh mule_module", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_mule_hotload_wsl = { .win = "wsl ./build.sh mule_hotload", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.build_mule_peb_trample_wsl = { .win = "wsl ./build.sh mule_peb_trample", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
|
||||
//- rjf: local target runs
|
||||
.run_raddbg = { .win = "pushd build && raddbg.exe && popd", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
};
|
||||
|
||||
fkey_command =
|
||||
{
|
||||
.F1 = "build_raddbg",
|
||||
.F3 = "run_raddbg",
|
||||
.F1 = "build_f1",
|
||||
.F2 = "build_f2",
|
||||
.F3 = "build_f3",
|
||||
};
|
||||
|
||||
fkey_command_override =
|
||||
{
|
||||
.rjf =
|
||||
{
|
||||
.F1 = "rjf_f1",
|
||||
.F2 = "rjf_f2",
|
||||
.F3 = "rjf_f3",
|
||||
.F4 = "rjf_f4",
|
||||
.F5 = "rjf_f5",
|
||||
.F1 = "build_f1",
|
||||
.F2 = "build_f2",
|
||||
.F3 = "build_f3",
|
||||
},
|
||||
};
|
||||
|
||||
+1
-1
@@ -13589,7 +13589,7 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds)
|
||||
|
||||
//- rjf: exiting
|
||||
case DF_CoreCmdKind_Exit:
|
||||
{
|
||||
{
|
||||
// rjf: save
|
||||
{
|
||||
DF_CmdParams params = df_cmd_params_zero();
|
||||
|
||||
@@ -9100,6 +9100,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings)
|
||||
DF_Palette(ws, DF_PaletteCode_NegativePopButton)
|
||||
UI_CornerRadius(ui_top_font_size()*0.5f)
|
||||
UI_FontSize(ui_top_font_size()*0.9f)
|
||||
UI_TextAlignment(UI_TextAlign_Center)
|
||||
ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawBackground, "Click Again To Apply");
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -9,9 +9,6 @@
|
||||
// C:/devel/bar, etc.
|
||||
//
|
||||
// [ ] auto-scroll output window
|
||||
// [ ] inline breakpoint hit_count
|
||||
// [ ] to count hit counts, resolve all bps to addresses, check addresses
|
||||
// against stopper thread's
|
||||
// [ ] theme lister -> fonts & font sizes
|
||||
// [ ] "Browse..." buttons should adopt a more relevant starting search path,
|
||||
// if possible
|
||||
@@ -52,7 +49,6 @@
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, High Priority Tasks (Complete Unusability, Crashes, Fire-Worthy)
|
||||
//
|
||||
// [ ] PDB files distributed with the build are not found by DbgHelp!!!
|
||||
// [ ] Jai compiler debugging crash
|
||||
|
||||
////////////////////////////////
|
||||
@@ -420,6 +416,11 @@
|
||||
// add what's under the MOUSE cursor instead of the keyboard cursor. Can
|
||||
// we get a command for that so I can bind ALT-W to that instead?
|
||||
// [x] editing multiple bindings for commands
|
||||
// [x] inline breakpoint hit_count
|
||||
// [x] to count hit counts, resolve all bps to addresses, check addresses
|
||||
// against stopper thread's
|
||||
//
|
||||
// [x] PDB files distributed with the build are not found by DbgHelp!!!
|
||||
|
||||
#ifndef RADDBG_H
|
||||
#define RADDBG_H
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
|
||||
static int Static = 5;
|
||||
namespace NS
|
||||
{
|
||||
static int staticDataInNS = 99;
|
||||
struct A
|
||||
{
|
||||
static int staticData;
|
||||
int a = 20;
|
||||
int b = 30;
|
||||
void Foo()
|
||||
{
|
||||
Static += 1;
|
||||
staticDataInNS += 1;
|
||||
staticData++;
|
||||
a++;
|
||||
b++;
|
||||
}
|
||||
};
|
||||
int A::staticData = 123;
|
||||
}
|
||||
|
||||
struct Resource
|
||||
{
|
||||
int resourceType;
|
||||
};
|
||||
|
||||
struct Stack
|
||||
{
|
||||
Resource *resource;
|
||||
};
|
||||
|
||||
struct StackNode
|
||||
{
|
||||
StackNode *next;
|
||||
Stack v;
|
||||
};
|
||||
|
||||
struct Context
|
||||
{
|
||||
StackNode *entry_stack_first;
|
||||
};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Resource r_ = {0};
|
||||
Resource *r = &r_;
|
||||
Stack s = {r};
|
||||
StackNode n_ = {0, s};
|
||||
StackNode *n = &n_;
|
||||
Context c_ = {n};
|
||||
Context *context = &c_;
|
||||
|
||||
// evaluate `context.entry_stack_first.v.resource.resourceType == 0xd8`
|
||||
int x = 0;
|
||||
|
||||
NS::A a = {0};
|
||||
a.Foo();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
// build with:
|
||||
// cl /Zi /nologo look_at_raddbg.c
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdint.h>
|
||||
#include "rdi_format/rdi_format.h"
|
||||
#include "rdi_format/rdi_format_parse.h"
|
||||
#include "rdi_format/rdi_format.c"
|
||||
#include "rdi_format/rdi_format_parse.c"
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
// map raddbg file into address space
|
||||
HANDLE file = CreateFileA("UnrealEditorFortnite.raddbg", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
DWORD size_hi32 = 0;
|
||||
DWORD size_lo32 = GetFileSize(file, &size_hi32);
|
||||
HANDLE map = CreateFileMappingA(file, 0, PAGE_READONLY, 0, 0, 0);
|
||||
uint64_t data_size = (size_lo32 | ((uint64_t)size_hi32 << 32));
|
||||
uint8_t *data = (uint8_t *)MapViewOfFile(map, FILE_MAP_READ, 0, 0, data_size);
|
||||
|
||||
// parse raw data as raddbg
|
||||
RDI_Parsed rdi = {0};
|
||||
RDI_ParseStatus parse_status = rdi_parse(data, data_size, &rdi);
|
||||
|
||||
// usage example: print out all procedure symbol names
|
||||
#if 1
|
||||
for(uint64_t procedure_idx = 0; procedure_idx < rdi.procedure_count; procedure_idx += 1)
|
||||
{
|
||||
RDI_Procedure *procedure = &rdi.procedures[procedure_idx];
|
||||
uint64_t name_size = 0;
|
||||
uint8_t *name = rdi_string_from_idx(&rdi, procedure->name_string_idx, &name_size);
|
||||
printf("[%I64u] %.*s\n", procedure_idx, (int)name_size, name);
|
||||
}
|
||||
#endif
|
||||
|
||||
// usage example: print out all user-defined-type names
|
||||
#if 0
|
||||
for(uint64_t udt_idx = 0; udt_idx < rdi.udt_count; udt_idx += 1)
|
||||
{
|
||||
RDI_UDT *udt = &rdi.udts[udt_idx];
|
||||
RDI_TypeNode *type = &rdi.type_nodes[udt->self_type_idx];
|
||||
uint64_t name_size = 0;
|
||||
uint8_t *name = rdi_string_from_idx(&rdi, type->user_defined.name_string_idx, &name_size);
|
||||
printf("[%I64u] %.*s\n", udt_idx, (int)name_size, name);
|
||||
}
|
||||
#endif
|
||||
|
||||
// for getting more info, look at the `RDI_Parsed` structure. all data is
|
||||
// represented as a bunch of flat plain-old-data tables. data which must
|
||||
// reference other data uses indices into that other data's table. for
|
||||
// example, given a `type_idx`, I will index into `rdi.type_nodes`. given a
|
||||
// `udt_idx`, I will index into `rdi.udts`. given a `scope_idx`, I will
|
||||
// index into `rdi.scopes`. and so on.
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user