raddbgi -> rdi

This commit is contained in:
Ryan Fleury
2024-05-23 15:09:53 -07:00
parent dc5dda3f71
commit 35c599dea3
34 changed files with 153 additions and 174 deletions
+34 -55
View File
@@ -20,26 +20,20 @@ You can download pre-built binaries for the debugger
[here](https://github.com/EpicGames/raddebugger/releases).
The RAD Debugger project aims to simplify the debugger by simplifying and
unifying the underlying debug info format. In that pursuit we've built
the RADDBGI debug info format, which is what the debugger parses and uses. To
work with existing toolchains, we convert PDB (and eventually PE/ELF files
with embedded DWARF) into the RADDBGI format on-demand. This conversion process
is currently an unoptimized reference version. Nevertheless it's still quite
fast for smaller PDB files (in many cases faster than many other programs
simply deserialize the PDBs). It is much slower for much larger projects at the
moment, but we expect this will vastly improve overtime.
unifying the underlying debug info format. In that pursuit we've built the RAD
Debug Info (RDI) format, which is what the debugger parses and uses. To work
with existing toolchains, we convert PDB (and eventually PE/ELF files with
embedded DWARF) into the RDI format on-demand.
The RADDBGI format is currently specified in code, in the files within the
`src/lib_raddbgi_format` folder. The other relevant folders for working with
the format are:
The RDI format is currently specified in code, in the files within the
`src/lib_rdi_format` folder. The other relevant folders for working with the
format are:
- `lib_raddbgi_make`: The "RAD Debug Info Make" library, for making RADDBGI
debug info.
- `raddbgi_from_pdb`: Our PDB-to-RADDBGI converter. Can be used as a helper
codebase layer, or built as an executable with a command line interface
frontend.
- `raddbgi_from_dwarf`: Our in-progress DWARF-to-RADDBGI converter.
- `raddbgi_dump`: Our RADDBGI textual dumping utility.
- `lib_rdi_make`: The "RAD Debug Info Make" library, for making RDI debug info.
- `rdi_from_pdb`: Our PDB-to-RDI converter. Can be used as a helper codebase
layer, or built as an executable with a command line interface frontend.
- `rdi_from_dwarf`: Our in-progress DWARF-to-RDI converter.
- `rdi_dump`: Our RDI textual dumping utility.
## Development Setup Instructions
@@ -126,18 +120,6 @@ there are still cases where the debugger has not been tested, and so there are
still issues. So, we feel that the top priority is eliminating these issues,
such that the debugging experience is rock solid.
Additionally, the debug info conversion process is not fast (nor wide) enough
to support extremely large projects. This is for two reasons: (a) the
PDB-to-RADDBGI converter is an unoptimized reference implementation, and (b)
the debugger learns of new modules (and thus which PDBs to load) in a
serially-dependent way (this is necessarily the case for correct debugging
results). We expect that the conversion process' performance can be massively
improved, and also that some heuristics can be used to begin converting PDBs
to RADDBGIs before the debugger knows those PDBs are needed, thus ensuring the
associated RADDBGI files are ready instantaneously when the associated modules
are finally loaded by the debugger. Improving this situation is a major part of
this phase, as it will make the debugger much more usable for large projects.
### Local x64 Linux Debugging Phase
The next priority for the project is to take the rock solid x64 Windows
@@ -152,11 +134,10 @@ The major parts of this phase are:
- Porting the `src/demon` layer to implement the Demon local process control
abstraction API.
- Porting the `src/unwind` layer to support x64 ELF unwinding (currently, there
is only an x64 PE unwinding implementation).
- Creating a DWARF-to-RADDBGI converter (in the same way that we've built a
PDB-to-RADDBGI converter). A partial implementation of this is in
`src/raddbgi_from_dwarf`.
- Implementing an x64 ELF Linux unwinder in the `src/ctrl` layer.
- Creating a DWARF-to-RDI converter (in the same way that we've built a
PDB-to-RDI converter). A partial implementation of this is in
`src/rdi_from_dwarf`.
- Porting the `src/render` layer to implement all of the rendering features the
frontend needs on a Linux-compatible API (the backend used on Windows is D3D11).
- Porting the `src/font_provider` layer to a Linux-compatible font
@@ -218,7 +199,7 @@ so in other words, layers are arranged into a directed acyclic graph.
A few layers are built to be used completely independently from the rest of the
codebase, as libraries in other codebases and projects. As such, these layers do
not depend on any other layers in the codebase. The folders which contain these
layers are prefixed with `lib_`, like `lib_raddbgi_format`.
layers are prefixed with `lib_`, like `lib_rdi_format`.
A list of the layers in the codebase and their associated namespaces is below:
- `base` (no namespace): Universal, codebase-wide constructs. Strings, math,
@@ -235,11 +216,11 @@ A list of the layers in the codebase and their associated namespaces is below:
- `dasm` (`DASM_`): An asynchronous disassembly decoder and cache. Users ask for
disassembly for a particular virtual address range in a process, and threads
implemented in this layer decode and cache the disassembly for that range.
- `dbgi` (`DBGI_`): An asynchronous debug info loader and cache. Loads debug
info stored in the RADDBGI format. Users ask for debug info for a particular
executable, and on separate threads, this layer loads the associated debug
info file. If necessary, it will launch a separate conversion process to
convert original debug info into the RADDBGI format.
- `dbgi` (`DI_`): An asynchronous debug info loader and cache. Loads debug info
stored in the RDI format. Users ask for debug info for a particular path, and
on separate threads, this layer loads the associated debug info file. If
necessary, it will launch a separate conversion process to convert original
debug info into the RDI format.
- `demon` (`DEMON_`): An abstraction layer for local-machine, low-level process
control. The abstraction is used to provide a common interface for process
control on target platforms. Used to implement part of `ctrl`.
@@ -274,13 +255,13 @@ A list of the layers in the codebase and their associated namespaces is below:
- `lib_raddbg_markup` (`RADDBG_`): Standalone library for marking up user
programs to work with various features in the `raddbg` debugger. Does not
depend on `base`, and can be independently relocated to other codebases.
- `lib_raddbgi_make` (`RDIM_`): Standalone library for constructing RADDBGI
debug info data. Does not depend on `base`, and can be independently relocated
- `lib_rdi_make` (`RDIM_`): Standalone library for constructing RDI debug info
data. Does not depend on `base`, and can be independently relocated
to other codebases.
- `lib_raddbgi_format` (`RDI_`): Standalone library which defines the core
RADDBGI types and helper functions for reading and writing the RADDBGI debug
info file format. Does not depend on `base`, and can be independently
relocated to other codebases.
- `lib_rdi_format` (`RDI_`): Standalone library which defines the core RDI types
and helper functions for reading and writing the RDI debug info file format.
Does not depend on `base`, and can be independently relocated to other
codebases.
- `metagen` (`MG_`): A metaprogram which is used to generate primarily code and
data tables. Consumes Metadesk files, stored with the extension `.mdesk`, and
generates C code which is then included by hand-written C code. Currently, it
@@ -315,11 +296,11 @@ A list of the layers in the codebase and their associated namespaces is below:
- `raddbg` (no namespace): The layer which ties everything together for the main
graphical debugger. Not much "meat", just drives `df`, implements command line
options, and so on.
- `raddbgi_from_pdb` (`P2R_`): Our implementation of PDB-to-RADDBGI conversion.
- `raddbgi_from_dwarf` (`D2R_`): Our in-progress implementation of
DWARF-to-RADDBGI conversion.
- `raddbgi_dump` (`RADDBGIDUMP_`): A dumper utility program for dumping
textualizations of RADDBGI debug info files.
- `rdi_from_pdb` (`P2R_`): Our implementation of PDB-to-RDI conversion.
- `rdi_from_dwarf` (`D2R_`): Our in-progress implementation of DWARF-to-RDI
conversion.
- `rdi_dump` (no namespace): A dumper utility program for dumping
textualizations of RDI debug info files.
- `regs` (`REGS_`): Types, helper functions, and metadata for registers on
supported architectures. Used in reading/writing registers in `demon`, or in
looking up register metadata.
@@ -338,11 +319,9 @@ A list of the layers in the codebase and their associated namespaces is below:
Used by the debugger to visualize source code files. Users ask for text lines,
tokens, and metadata, and it is prepared on background threads.
- `type_graph` (`TG_`): Code for analyzing and navigating type structures from
RADDBGI debug info files, with the additional capability of constructing
RDI debug info files, with the additional capability of constructing
synthetic types *not* found in debug info. Used in `eval` and for various
visualization features.
- `ui` (`UI_`): Machinery for building graphical user interfaces. Provides a
core immediate mode hierarchical user interface data structure building
API, and has helper layers for building some higher-level widgets.
- `unwind` (`UNW_`): Code for generating unwind information from threads, for
supported operating systems and architectures.
+5 -5
View File
@@ -15,7 +15,7 @@ cd /D "%~dp0"
:: `build raddbg clang`
:: `build raddbg release`
:: `build raddbg asan telemetry`
:: `build raddbgi_from_pdb`
:: `build rdi_from_pdb`
::
:: For a full list of possible build targets and their build command lines,
:: search for @build_targets in this file.
@@ -99,10 +99,10 @@ if not "%no_meta%"=="1" (
:: --- Build Everything (@build_targets) --------------------------------------
pushd build
if "%raddbg%"=="1" %compile% %gfx% ..\src\raddbg\raddbg_main.cpp %compile_link% %out%raddbg.exe || exit /b 1
if "%raddbgi_from_pdb%"=="1" %compile% ..\src\raddbgi_from_pdb\raddbgi_from_pdb_main.c %compile_link% %out%raddbgi_from_pdb.exe || exit /b 1
if "%raddbgi_from_dwarf%"=="1" %compile% ..\src\raddbgi_from_dwarf\raddbgi_from_dwarf.c %compile_link% %out%raddbgi_from_dwarf.exe || exit /b 1
if "%raddbgi_dump%"=="1" %compile% ..\src\raddbgi_dump\raddbgi_dump_main.c %compile_link% %out%raddbgi_dump.exe || exit /b 1
if "%raddbgi_breakpad_from_pdb%"=="1" %compile% ..\src\raddbgi_breakpad_from_pdb\raddbgi_breakpad_from_pdb_main.c %compile_link% %out%raddbgi_breakpad_from_pdb.exe || exit /b 1
if "%rdi_from_pdb%"=="1" %compile% ..\src\rdi_from_pdb\rdi_from_pdb_main.c %compile_link% %out%rdi_from_pdb.exe || exit /b 1
if "%rdi_from_dwarf%"=="1" %compile% ..\src\rdi_from_dwarf\rdi_from_dwarf.c %compile_link% %out%rdi_from_dwarf.exe || exit /b 1
if "%rdi_dump%"=="1" %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
if "%rdi_breakpad_from_pdb%"=="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" %compile% ..\src\scratch\ryan_scratch.c %compile_link% %out%ryan_scratch.exe || exit /b 1
if "%cpp_tests%"=="1" %compile% ..\src\scratch\i_hate_c_plus_plus.cpp %compile_link% %out%cpp_tests.exe || exit /b 1
if "%look_at_raddbg%"=="1" %compile% ..\src\scratch\look_at_raddbg.c %compile_link% %out%look_at_raddbg.exe || exit /b 1
+6 -6
View File
@@ -74,7 +74,7 @@ commands =
},
.rjf_f4 =
{
.win = "build raddbgi_from_pdb release telemetry && pushd build && raddbgi_from_pdb.exe --exe:UnrealEditorFortnite.exe --pdb:UnrealEditorFortnite.pdb --out:UnrealEditorFortnite.raddbgi --capture && popd",
.win = "build rdi_from_pdb release telemetry && pushd build && rdi_from_pdb.exe --exe:UnrealEditorFortnite.exe --pdb:UnrealEditorFortnite.pdb --out:UnrealEditorFortnite.rdi --capture && popd",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
@@ -83,7 +83,7 @@ commands =
},
.rjf_f5 =
{
.win = "pushd build && raddbgi_from_pdb.exe --exe:raddbg.exe --pdb:raddbg.pdb --out:raddbg.raddbg --capture && popd",
.win = "pushd build && rdi_from_pdb.exe --exe:raddbg.exe --pdb:raddbg.pdb --out:raddbg.rdi --capture && popd",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
@@ -108,18 +108,18 @@ commands =
.save_dirty_files = true,
.cursor_at_end = false,
},
.build_raddbgi_from_pdb =
.build_rdi_from_pdb =
{
.win = "build raddbgi_from_pdb",
.win = "build rdi_from_pdb",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
.save_dirty_files = true,
.cursor_at_end = false,
},
.build_raddbgi_dump =
.build_rdi_dump =
{
.win = "build raddbgi_dump",
.win = "build rdi_dump",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
@@ -4,11 +4,11 @@
////////////////////////////////////////////////////////////////
// RAD Debug Info, (R)AD(D)BG(I) Format Library
//
// Defines standard RADDBGI debug information format types and
// Defines standard RDI debug information format types and
// functions.
#ifndef RADDBGI_FORMAT_H
#define RADDBGI_FORMAT_H
#ifndef RDI_FORMAT_H
#define RDI_FORMAT_H
////////////////////////////////////////////////////////////////
// Overridable procedure decoration
@@ -924,4 +924,4 @@ RDI_PROC RDI_EvalConversionKind rdi_eval_conversion_rule(RDI_EvalTypeGroup in, R
RDI_PROC RDI_U8* rdi_eval_conversion_message(RDI_EvalConversionKind conversion_kind, RDI_U64 *lennout);
RDI_PROC RDI_S32 rdi_eval_opcode_type_compatible(RDI_EvalOp op, RDI_EvalTypeGroup group);
#endif // RADDBGI_FORMAT_H
#endif // RDI_FORMAT_H
@@ -5,14 +5,14 @@
// RAD Debug Info Make, (R)AD(D)BG(I) (M)ake Library
//
// Library for building loose data structures which contain
// RADDBGI debug information, and baking that down into the
// proper flattened RADDBGI format.
// RDI debug information, and baking that down into the
// proper flattened RDI format.
//
// Requires prior inclusion of the RAD Debug Info, (R)AD(D)BG(I)
// Format Library, in raddbgi_format.h.
// Format Library, in rdi_format.h.
#ifndef RADDBGI_MAKE_H
#define RADDBGI_MAKE_H
#ifndef RDI_MAKE_H
#define RDI_MAKE_H
////////////////////////////////
//~ rjf: Overrideable Memory Operations
@@ -1252,4 +1252,4 @@ RDI_PROC RDIM_BakeSectionList rdim_bake_idx_run_section_list_from_idx_run_map(RD
RDI_PROC RDIM_String8List rdim_serialized_strings_from_params_bake_section_list(RDIM_Arena *arena, RDIM_BakeParams *params, RDIM_BakeSectionList *sections);
#endif // RADDBGI_MAKE_H
#endif // RDI_MAKE_H
+1 -1
View File
@@ -375,7 +375,7 @@
// [x] new fuzzy searching layer
// [x] robustify dbgi layer to renames (cache should not be based only on
// path - must invalidate naturally when new filetime occurs)
// [x] raddbgi file regeneration too strict
// [x] rdi file regeneration too strict
#ifndef RADDBG_H
#define RADDBG_H
+10 -10
View File
@@ -22,10 +22,10 @@
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format_parse.c"
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
@@ -34,7 +34,7 @@
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "ico/ico.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "mdesk/mdesk.h"
#include "hash_store/hash_store.h"
#include "file_stream/file_stream.h"
@@ -48,9 +48,9 @@
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb/raddbgi_from_pdb.h"
#include "rdi_from_pdb/rdi_from_pdb.h"
#include "regs/regs.h"
#include "regs/raddbgi/regs_raddbgi.h"
#include "regs/rdi/regs_rdi.h"
#include "type_graph/type_graph.h"
#include "dbgi/dbgi.h"
#include "dasm_cache/dasm_cache.h"
@@ -73,7 +73,7 @@
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "ico/ico.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "mdesk/mdesk.c"
#include "hash_store/hash_store.c"
#include "file_stream/file_stream.c"
@@ -87,9 +87,9 @@
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb/raddbgi_from_pdb.c"
#include "rdi_from_pdb/rdi_from_pdb.c"
#include "regs/regs.c"
#include "regs/raddbgi/regs_raddbgi.c"
#include "regs/rdi/regs_rdi.c"
#include "type_graph/type_graph.c"
#include "dbgi/dbgi.c"
#include "dasm_cache/dasm_cache.c"
@@ -5,17 +5,17 @@
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "raddbgi_breakpad_from_pdb"
#define BUILD_TITLE "rdi_breakpad_from_pdb"
#define BUILD_CONSOLE_INTERFACE 1
////////////////////////////////
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.c"
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
@@ -24,27 +24,27 @@
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "coff/coff.h"
#include "codeview/codeview.h"
#include "codeview/codeview_stringize.h"
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb/raddbgi_from_pdb.h"
#include "rdi_from_pdb/rdi_from_pdb.h"
//- rjf: [c]
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "coff/coff.c"
#include "codeview/codeview.c"
#include "codeview/codeview_stringize.c"
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb/raddbgi_from_pdb.c"
#include "rdi_from_pdb/rdi_from_pdb.c"
////////////////////////////////
//~ rjf: Baking Tasks
@@ -209,7 +209,7 @@ entry_point(CmdLine *cmdline)
//- rjf: display help
if(do_help || user2convert->errors.node_count != 0)
{
fprintf(stderr, "--- raddbgi_breakpad_from_pdb -------------------------------------------------\n\n");
fprintf(stderr, "--- rdi_breakpad_from_pdb -----------------------------------------------------\n\n");
fprintf(stderr, "This utility converts debug information from PDBs into the textual Breakpad\n");
fprintf(stderr, "symbol information format, used for various external utilities, using the RAD\n");
@@ -2,7 +2,7 @@
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: RADDBGI Enum -> String Functions
//~ rjf: RDI Enum -> String Functions
internal String8
rdi_string_from_data_section_tag(RDI_DataSectionTag tag){
@@ -79,7 +79,7 @@ rdi_string_from_local_kind(RDI_LocalKind local_kind){
}
////////////////////////////////
//~ rjf: RADDBGI Flags -> String Functions
//~ rjf: RDI Flags -> String Functions
internal void
rdi_stringize_binary_section_flags(Arena *arena, String8List *out,
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_DUMP_H
#define RADDBGI_DUMP_H
#ifndef RDI_DUMP_H
#define RDI_DUMP_H
////////////////////////////////
//~ rjf: RADDBG Stringize Helper Types
@@ -39,7 +39,7 @@ struct RDI_ScopeBundle
};
////////////////////////////////
//~ rjf: RADDBGI Enum -> String Functions
//~ rjf: RDI Enum -> String Functions
internal String8 rdi_string_from_data_section_tag(RDI_DataSectionTag tag);
internal String8 rdi_string_from_arch(RDI_Arch arch);
@@ -49,7 +49,7 @@ internal String8 rdi_string_from_member_kind(RDI_MemberKind member_kind);
internal String8 rdi_string_from_local_kind(RDI_LocalKind local_kind);
////////////////////////////////
//~ rjf: RADDBGI Flags -> String Functions
//~ rjf: RDI Flags -> String Functions
internal void rdi_stringize_binary_section_flags(Arena *arena, String8List *out, RDI_BinarySectionFlags flags);
internal void rdi_stringize_type_modifier_flags(Arena *arena, String8List *out, RDI_TypeModifierFlags flags);
@@ -57,7 +57,7 @@ internal void rdi_stringize_user_defined_type_flags(Arena *arena, String8List *o
internal void rdi_stringize_link_flags(Arena *arena, String8List *out, RDI_LinkFlags flags);
////////////////////////////////
//~ rjf: RADDBG Compound Stringize Functions
//~ rjf: RDI Compound Stringize Functions
internal void rdi_stringize_data_sections(Arena *arena, String8List *out, RDI_Parsed *parsed, U32 indent_level);
internal void rdi_stringize_top_level_info(Arena *arena, String8List *out, RDI_Parsed *parsed, RDI_TopLevelInfo *tli, U32 indent_level);
@@ -72,4 +72,4 @@ internal void rdi_stringize_thread_variable(Arena *arena, String8List *out, RDI_
internal void rdi_stringize_procedure(Arena *arena, String8List *out, RDI_Parsed *parsed, RDI_Procedure *proc, U32 indent_level);
internal void rdi_stringize_scope(Arena *arena, String8List *out, RDI_Parsed *parsed, RDI_ScopeBundle *bundle, RDI_Scope *scope, U32 indent_level);
#endif // RADDBGI_DUMP_H
#endif // RDI_DUMP_H
@@ -8,27 +8,27 @@
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "raddbgi_dump"
#define BUILD_TITLE "rdi_dump"
#define BUILD_CONSOLE_INTERFACE 1
////////////////////////////////
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.c"
//- rjf: [h]
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "raddbgi_dump.h"
#include "rdi_dump.h"
//- rjf: [c]
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "raddbgi_dump.c"
#include "rdi_dump.c"
////////////////////////////////
//~ rjf: Entry Point
@@ -73,8 +73,8 @@ entry_point(CmdLine *cmd_line)
// rjf: extract input file path & load data
input_name = str8_list_first(&cmd_line->inputs);
if(input_name.size > 0) { input_data = os_data_from_file_path(arena, input_name); }
else {str8_list_pushf(arena, &errors, "error (input): No input RADDBGI file specified.");}
if(input_name.size != 0 && input_data.size == 0) { str8_list_pushf(arena, &errors, "error (input): No input RADDBGI file successfully loaded; either the path or file contents are invalid."); }
else {str8_list_pushf(arena, &errors, "error (input): No input RDI file specified.");}
if(input_name.size != 0 && input_data.size == 0) { str8_list_pushf(arena, &errors, "error (input): No input RDI file successfully loaded; either the path or file contents are invalid."); }
// rjf: extract dump options
{
@@ -116,7 +116,7 @@ entry_point(CmdLine *cmd_line)
parse_status = rdi_parse(input_data.str, input_data.size, &raddbg_);
if(parse_status != RDI_ParseStatus_Good)
{
str8_list_pushf(arena, &errors, "error (parse): RADDBGI file wasn't parsed successfully. (0x%x)", parse_status);
str8_list_pushf(arena, &errors, "error (parse): RDI file wasn't parsed successfully. (0x%x)", parse_status);
}
}
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_DWARF_H
#define RADDBGI_DWARF_H
#ifndef RDI_DWARF_H
#define RDI_DWARF_H
// https://dwarfstd.org/doc/DWARF4.pdf
// https://dwarfstd.org/doc/DWARF5.pdf
@@ -1489,5 +1489,5 @@ static String8 dwarf_string_from_line_ext_op(DWARF_LineExtOp op);
static String8 dwarf_string_from_line_entry_format(DWARF_LineEntryFormat format);
static String8 dwarf_string_from_section_code(DWARF_SectionCode sec_code);
#endif //RADDBGI_DWARF_H
#endif //RDI_DWARF_H
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_DWARF_STRINGIZE_H
#define RADDBGI_DWARF_STRINGIZE_H
#ifndef RDI_DWARF_STRINGIZE_H
#define RDI_DWARF_STRINGIZE_H
////////////////////////////////
//~ DWARF Stringize Functions
@@ -25,4 +25,4 @@ dwarf_stringize_addr(Arena *arena, String8List *out, DWARF_AddrUnit *unit, U32 i
#endif //RADDBGI_DWARF_STRINGIZE_H
#endif //RDI_DWARF_STRINGIZE_H
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_ELF_H
#define RADDBGI_ELF_H
#ifndef RDI_ELF_H
#define RDI_ELF_H
// https://refspecs.linuxfoundation.org/elf/elf.pdf
@@ -514,4 +514,4 @@ static String8 elf_string_from_symbol_binding(ELF_SymbolBinding binding);
static String8 elf_string_from_symbol_type(ELF_SymbolType type);
static String8 elf_string_from_symbol_visibility(ELF_SymbolVisibility visibility);
#endif //RADDBGI_ELF_H
#endif //RDI_ELF_H
@@ -1,27 +1,27 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_rdi_format/rdi_format.h"
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "raddbgi_elf.h"
#include "raddbgi_dwarf.h"
#include "rdi_elf.h"
#include "rdi_dwarf.h"
#include "raddbgi_dwarf_stringize.h"
#include "rdi_dwarf_stringize.h"
#include "raddbgi_from_dwarf.h"
#include "rdi_from_dwarf.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_rdi_format/rdi_format.c"
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "raddbgi_elf.c"
#include "raddbgi_dwarf.c"
#include "rdi_elf.c"
#include "rdi_dwarf.c"
#include "raddbgi_dwarf_stringize.c"
#include "rdi_dwarf_stringize.c"
// TODO(allen):
// [ ] need sample data for .debug_names
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_FROM_DWARF_H
#define RADDBGI_FROM_DWARF_H
#ifndef RDI_FROM_DWARF_H
#define RDI_FROM_DWARF_H
////////////////////////////////
//~ Program Parameters Type
@@ -47,4 +47,4 @@ static DWARFCONV_Params *dwarf_convert_params_from_cmd_line(Arena *arena, CmdLin
#endif //RADDBGI_FROM_DWARF_H
#endif //RDI_FROM_DWARF_H
@@ -147,7 +147,7 @@ Case("source_path_name_map",NormalSourcePathNameMap)\
}
////////////////////////////////
//~ rjf: COFF <-> RADDBGI Canonical Conversions
//~ rjf: COFF <-> RDI Canonical Conversions
internal RDI_BinarySectionFlags
p2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags)
@@ -169,7 +169,7 @@ p2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags)
}
////////////////////////////////
//~ rjf: CodeView <-> RADDBGI Canonical Conversions
//~ rjf: CodeView <-> RDI Canonical Conversions
internal RDI_Arch
p2r_rdi_arch_from_cv_arch(CV_Arch cv_arch)
@@ -2935,7 +2935,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
//- rjf: types pass 2: produce per-itype itype chain
//
// this pass is to ensure that subsequent passes always produce types for
// dependent itypes first - guaranteeing raddbgi's "only reference backward"
// dependent itypes first - guaranteeing rdi's "only reference backward"
// rule (which eliminates cycles). each itype slot gets a list of itypes,
// starting with the deepest dependency - when types are produced per-itype,
// this chain is walked, so that deeper dependencies are built first, and
@@ -2974,7 +2974,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
//- rjf: types pass 3: construct all types from TPI
//
// this doesn't gather struct/class/union/enum members, which is done by
// subsequent passes, to build RADDBGI "UDT" information, which is distinct
// subsequent passes, to build RDI "UDT" information, which is distinct
// from regular type info.
//
RDIM_Type **itype_type_ptrs = 0;
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_FROM_PDB_H
#define RADDBGI_FROM_PDB_H
#ifndef RDI_FROM_PDB_H
#define RDI_FROM_PDB_H
////////////////////////////////
//~ rjf: Export Artifact Flags
@@ -514,12 +514,12 @@ internal U64 p2r_hash_from_voff(U64 voff);
internal P2R_User2Convert *p2r_user2convert_from_cmdln(Arena *arena, CmdLine *cmdline);
////////////////////////////////
//~ rjf: COFF => RADDBGI Canonical Conversions
//~ rjf: COFF => RDI Canonical Conversions
internal RDI_BinarySectionFlags p2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags);
////////////////////////////////
//~ rjf: CodeView => RADDBGI Canonical Conversions
//~ rjf: CodeView => RDI Canonical Conversions
internal RDI_Arch p2r_rdi_arch_from_cv_arch(CV_Arch arch);
internal RDI_RegisterCode p2r_rdi_reg_code_from_cv_reg_code(RDI_Arch arch, CV_Reg reg_code);
@@ -626,4 +626,4 @@ internal P2R_Bake2Serialize *p2r_bake(Arena *arena, P2R_Convert2Bake *in);
internal P2R_Bake2Serialize *p2r_compress(Arena *arena, P2R_Bake2Serialize *in);
#endif // RADDBGI_FROM_PDB_H
#endif // RDI_FROM_PDB_H
@@ -8,15 +8,15 @@
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "raddbgi_from_pdb"
#define BUILD_TITLE "rdi_from_pdb"
#define BUILD_CONSOLE_INTERFACE 1
////////////////////////////////
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format.c"
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
@@ -24,27 +24,27 @@
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "coff/coff.h"
#include "codeview/codeview.h"
#include "codeview/codeview_stringize.h"
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb.h"
#include "rdi_from_pdb.h"
//- rjf: [c]
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "coff/coff.c"
#include "codeview/codeview.c"
#include "codeview/codeview_stringize.c"
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb.c"
#include "rdi_from_pdb.c"
////////////////////////////////
//~ rjf: Entry Point
@@ -62,7 +62,7 @@ entry_point(CmdLine *cmdline)
//- rjf: display help
if(do_help || user2convert->errors.node_count != 0)
{
fprintf(stderr, "--- raddbgi_from_pdb ----------------------------------------------------------\n\n");
fprintf(stderr, "--- rdi_from_pdb --------------------------------------------------------------\n\n");
fprintf(stderr, "This utility converts debug information from PDBs into the RAD Debug Info.\n");
fprintf(stderr, "format. The following arguments are accepted:\n\n");
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#include "lib_raddbgi_make/raddbgi_make.c"
#include "lib_rdi_make/rdi_make.c"
@@ -45,6 +45,6 @@
#define RDIM_ProfBegin(...) ProfBeginDynamic(__VA_ARGS__)
#define RDIM_ProfEnd(...) ProfEnd()
#include "lib_raddbgi_make/raddbgi_make.h"
#include "lib_rdi_make/rdi_make.h"
#endif // RDI_CONS_LOCAL_H
@@ -3,10 +3,10 @@
//- GENERATED CODE
#ifndef REGS_RADDBGI_META_H
#define REGS_RADDBGI_META_H
#ifndef REGS_RDI_META_H
#define REGS_RDI_META_H
C_LINKAGE_BEGIN
C_LINKAGE_END
#endif // REGS_RADDBGI_META_H
#endif // REGS_RDI_META_H
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#include "regs/raddbgi/generated/regs_raddbgi.meta.c"
#include "regs/rdi/generated/regs_rdi.meta.c"
@@ -1,10 +1,10 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef REGS_RADDBGI_H
#define REGS_RADDBGI_H
#ifndef REGS_RDI_H
#define REGS_RDI_H
internal RDI_RegisterCode regs_rdi_code_from_arch_reg_code(Architecture arch, REGS_RegCode code);
internal REGS_RegCode regs_reg_code_from_arch_rdi_code(Architecture arch, RDI_RegisterCode reg);
#endif //REGS_RADDBGI_H
#endif //REGS_RDI_H
+10 -10
View File
@@ -15,16 +15,16 @@
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.c"
//- rjf: [h]
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "mdesk/mdesk.h"
#include "hash_store/hash_store.h"
#include "file_stream/file_stream.h"
@@ -38,9 +38,9 @@
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb/raddbgi_from_pdb.h"
#include "rdi_from_pdb/rdi_from_pdb.h"
#include "regs/regs.h"
#include "regs/raddbgi/regs_raddbgi.h"
#include "regs/rdi/regs_rdi.h"
#include "type_graph/type_graph.h"
#include "dbgi/dbgi.h"
#include "demon/demon_inc.h"
@@ -52,7 +52,7 @@
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "mdesk/mdesk.c"
#include "hash_store/hash_store.c"
#include "file_stream/file_stream.c"
@@ -66,9 +66,9 @@
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb/raddbgi_from_pdb.c"
#include "rdi_from_pdb/rdi_from_pdb.c"
#include "regs/regs.c"
#include "regs/raddbgi/regs_raddbgi.c"
#include "regs/rdi/regs_rdi.c"
#include "type_graph/type_graph.c"
#include "dbgi/dbgi.c"
#include "demon/demon_inc.c"