major clean-up pass over unwinding/module-info abstraction, + usage in the debug engine. simplified / cleaned up DWARF helpers for unwind info & expressions. decoupling unwinding / DWARF evaluation from memory read callbacks. light module info now prepared by demon layer - debug engine no longer duplicates per-backend parsing. unwind abstraction layer now does thin abstraction over unwinding backends, debug engine only calls abstraction. clean up demon to have fewer ad-hoc 'queries' on handles, and prefer sending info over debug events when possible / when it fits the usage pattern. move DWARF enum specifications to metacode, generate enums/xlists/tables/etc. decouple raddbg/radbin completely from old parsing helpers. replace portion of DWARF dumping; pull out some new parsing helpers from converter / dumper.

This commit is contained in:
Ryan Fleury committed 2026-06-02 12:11:13 -07:00
1 parent 541d3afefa
commit d73ce364b9
88 files changed
+9899 -4723

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
//- GENERATED CODE
+21
View File
@@ -0,0 +1,21 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
//- GENERATED CODE
#ifndef UNWIND_META_H
#define UNWIND_META_H
typedef enum UWND_Unwinder
{
UWND_Unwinder_Null,
UWND_Unwinder_PEx64,
UWND_Unwinder_EHFrame,
UWND_Unwinder_COUNT,
} UWND_Unwinder;
#define UWND_Unwinder_XList \
X(PEx64, pe_x64)\
X(EHFrame, eh)\
#endif // UNWIND_META_H
+24
View File
@@ -0,0 +1,24 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Generated Code
#include "unwind/generated/unwind.meta.c"
////////////////////////////////
//~ rjf: Abstracted Unwind Step Functions
internal UWND_StepResult
uwnd_step(UWND_Unwinder unwinder, Arch arch, MemoryMap *memory_map, UWND_ModuleInfo *module_info, U64 tls_vaddr, void *regs, U64 *cfa_out)
{
UWND_StepResult result = {UWND_StepStatus_Error};
switch(unwinder)
{
default:{}break;
#define X(name, namespace_lower) case UWND_Unwinder_##name:{result = namespace_lower##_uwnd_step(arch, memory_map, module_info, tls_vaddr, regs, cfa_out);}break;
UWND_Unwinder_XList
#undef X
}
return result;
}
+45
View File
@@ -0,0 +1,45 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef UNWIND_H
#define UNWIND_H
////////////////////////////////
//~ rjf: Generated Code
#include "unwind/generated/unwind.meta.h"
////////////////////////////////
//~ rjf: Unwind Artifact Types
typedef enum UWND_StepStatus
{
UWND_StepStatus_Error,
UWND_StepStatus_FailedMemoryRead,
UWND_StepStatus_Good,
}
UWND_StepStatus;
typedef struct UWND_StepResult UWND_StepResult;
struct UWND_StepResult
{
UWND_StepStatus status;
Rng1U64 missed_read_vaddr_range;
};
////////////////////////////////
//~ rjf: Module Info
typedef struct UWND_ModuleInfo UWND_ModuleInfo;
struct UWND_ModuleInfo
{
U64 base_vaddr;
void *unwind_info;
};
////////////////////////////////
//~ rjf: Abstracted Unwind Step Functions
internal UWND_StepResult uwnd_step(UWND_Unwinder unwinder, Arch arch, MemoryMap *memory_map, UWND_ModuleInfo *module_info, U64 tls_vaddr, void *regs, U64 *cfa_out);
#endif // UNWIND_H
+21
View File
@@ -0,0 +1,21 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
@table(name namespace_lower)
UWND_UnwinderTable:
{
{PEx64 pe_x64 }
{EHFrame eh }
}
@enum UWND_Unwinder:
{
Null,
@expand(UWND_UnwinderTable a) `$(a.name)`,
COUNT
}
@xlist UWND_Unwinder_XList:
{
@expand(UWND_UnwinderTable a) `$(a.name), $(a.namespace_lower)`
}
+10
View File
@@ -0,0 +1,10 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#include "unwind.c"
#if defined(PE_H) && defined(X64_H)
# include "pe/x64/unwind/pe_x64_unwind.c"
#endif
#if defined(EH_FRAME_H)
# include "eh_frame/unwind/eh_frame_unwind.c"
#endif
+15
View File
@@ -0,0 +1,15 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef UNWIND_INC_H
#define UNWIND_INC_H
#include "unwind.h"
#if defined(PE_H) && defined(X64_H)
# include "pe/x64/unwind/pe_x64_unwind.h"
#endif
#if defined(EH_FRAME_H)
# include "eh_frame/unwind/eh_frame_unwind.h"
#endif
#endif // UNWIND_INC_H