mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-12 23:31:38 -07:00
plug in dwarf converter to radbin; hook up to both rdi generation & breakpad generation; radbin exe -> pdb / elf -> dwarf inferences; cleanup / unification passes
This commit is contained in:
@@ -111,7 +111,6 @@ pushd build
|
||||
if "%raddbg%"=="1" set didbuild=1 && %compile% ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg.exe || exit /b 1
|
||||
if "%radlink%"=="1" set didbuild=1 && %compile% ..\src\linker\lnk.c %compile_link% %linker% /NOIMPLIB %linker% /NATVIS:"%~dp0\src\linker\linker.natvis" %out%radlink.exe || exit /b 1
|
||||
if "%radbin%"=="1" set didbuild=1 && %compile% ..\src\radbin\radbin_main.c %compile_link% %out%radbin.exe || exit /b 1
|
||||
if "%radcon%"=="1" set didbuild=1 && %compile% ..\src\radcon\radcon_main.c %compile_link% %out%radcon.exe || exit /b 1
|
||||
if "%raddump%"=="1" set didbuild=1 && %compile% ..\src\raddump\raddump_main.c %compile_link% %out%raddump.exe || exit /b 1
|
||||
if "%tester%"=="1" set didbuild=1 && %compile% ..\src\tester\tester_main.c %compile_link% %out%tester.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
|
||||
|
||||
@@ -487,14 +487,16 @@ typedef enum OperatingSystem
|
||||
}
|
||||
OperatingSystem;
|
||||
|
||||
typedef enum ImageType
|
||||
typedef enum ExecutableImageKind
|
||||
{
|
||||
Image_Null,
|
||||
Image_CoffPe,
|
||||
Image_Elf32,
|
||||
Image_Elf64,
|
||||
Image_Macho
|
||||
} ImageType;
|
||||
ExecutableImageKind_Null,
|
||||
ExecutableImageKind_CoffPe,
|
||||
ExecutableImageKind_Elf32,
|
||||
ExecutableImageKind_Elf64,
|
||||
ExecutableImageKind_Macho,
|
||||
ExecutableImageKind_COUNT
|
||||
}
|
||||
ExecutableImageKind;
|
||||
|
||||
typedef enum Arch
|
||||
{
|
||||
|
||||
@@ -3989,13 +3989,8 @@ ctrl_thread__module_open(CTRL_Handle process, CTRL_Handle module, Rng1U64 vaddr_
|
||||
file_header_off + sizeof(COFF_FileHeader) + opt_ext_size);
|
||||
|
||||
//- rjf: read optional header
|
||||
U16 optional_magic = 0;
|
||||
U64 image_base = 0;
|
||||
U64 entry_point = 0;
|
||||
U32 data_dir_count = 0;
|
||||
U64 virt_section_align = 0;
|
||||
U64 file_section_align = 0;
|
||||
Rng1U64 *data_dir_franges = 0;
|
||||
if(opt_ext_size > 0)
|
||||
{
|
||||
// rjf: read magic number
|
||||
@@ -4011,10 +4006,7 @@ ctrl_thread__module_open(CTRL_Handle process, CTRL_Handle module, Rng1U64 vaddr_
|
||||
{
|
||||
PE_OptionalHeader32 pe_optional = {0};
|
||||
dmn_process_read_struct(process.dmn_handle, vaddr_range.min + opt_ext_off_range.min, &pe_optional);
|
||||
image_base = pe_optional.image_base;
|
||||
entry_point = pe_optional.entry_point_va;
|
||||
virt_section_align = pe_optional.section_alignment;
|
||||
file_section_align = pe_optional.file_alignment;
|
||||
reported_data_dir_offset = sizeof(pe_optional);
|
||||
reported_data_dir_count = pe_optional.data_dir_count;
|
||||
}break;
|
||||
@@ -4022,10 +4014,7 @@ ctrl_thread__module_open(CTRL_Handle process, CTRL_Handle module, Rng1U64 vaddr_
|
||||
{
|
||||
PE_OptionalHeader32Plus pe_optional = {0};
|
||||
dmn_process_read_struct(process.dmn_handle, vaddr_range.min + opt_ext_off_range.min, &pe_optional);
|
||||
image_base = pe_optional.image_base;
|
||||
entry_point = pe_optional.entry_point_va;
|
||||
virt_section_align = pe_optional.section_alignment;
|
||||
file_section_align = pe_optional.file_alignment;
|
||||
reported_data_dir_offset = sizeof(pe_optional);
|
||||
reported_data_dir_count = pe_optional.data_dir_count;
|
||||
}break;
|
||||
|
||||
+37
-34
@@ -5,72 +5,75 @@ internal B32
|
||||
dw_is_dwarf_present_elf_section_table(String8 raw_image, ELF_BinInfo *bin)
|
||||
{
|
||||
Temp scratch = scratch_begin(0,0);
|
||||
|
||||
|
||||
B32 is_dwarf_present = 0;
|
||||
|
||||
|
||||
ELF_Shdr64Array sections = elf_shdr64_array_from_bin(scratch.arena, raw_image, &bin->hdr);
|
||||
|
||||
|
||||
for (U64 i = 0; i < sections.count; ++i) {
|
||||
ELF_Shdr64 *shdr = §ions.v[i];
|
||||
String8 name = elf_name_from_shdr64(raw_image, &bin->hdr, bin->sh_name_range, shdr);
|
||||
|
||||
|
||||
if (shdr->sh_type != ELF_SectionCode_ProgBits) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
DW_SectionKind s = dw_section_kind_from_string(name);
|
||||
if (s == DW_Section_Null) {
|
||||
s = dw_section_dwo_kind_from_string(name);
|
||||
}
|
||||
|
||||
|
||||
is_dwarf_present = s != DW_Section_Null;
|
||||
if (is_dwarf_present) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scratch_end(scratch);
|
||||
return is_dwarf_present;
|
||||
}
|
||||
|
||||
#define SINFL_IMPLEMENTATION
|
||||
#include "third_party/sinfl/sinfl.h"
|
||||
|
||||
internal DW_Input
|
||||
dw_input_from_elf_section_table(Arena *arena, String8 raw_image, ELF_BinInfo *bin)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
|
||||
DW_Input result = {0};
|
||||
B32 sect_status[ArrayCount(result.sec)] = {0};
|
||||
|
||||
|
||||
ELF_Shdr64Array sections = elf_shdr64_array_from_bin(scratch.arena, raw_image, &bin->hdr);
|
||||
|
||||
|
||||
for (U64 sect_idx = 1; sect_idx < sections.count; ++sect_idx) {
|
||||
ELF_Shdr64 *shdr = §ions.v[sect_idx];
|
||||
|
||||
|
||||
// skip BSS sections
|
||||
if (shdr->sh_type != ELF_SectionCode_ProgBits) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
String8 name = elf_name_from_shdr64(raw_image, &bin->hdr, bin->sh_name_range, shdr);
|
||||
|
||||
|
||||
DW_SectionKind s = dw_section_kind_from_string(name);
|
||||
B32 is_dwo = 0;
|
||||
if (s == DW_Section_Null) {
|
||||
s = dw_section_dwo_kind_from_string(name);
|
||||
is_dwo = 1;
|
||||
}
|
||||
|
||||
|
||||
if (s != DW_Section_Null) {
|
||||
if (sect_status[s]) {
|
||||
Assert(!"too many debug sections with identical name, picking first");
|
||||
} else {
|
||||
Rng1U64 raw_data_range = rng_1u64(shdr->sh_offset, shdr->sh_offset + shdr->sh_size);
|
||||
String8 data = str8_substr(raw_image, raw_data_range);
|
||||
|
||||
|
||||
// ELF was compiled with compressed debug info
|
||||
if (shdr->sh_flags & ELF_Shf_Compressed) {
|
||||
String8 comp_data_with_header = data;
|
||||
|
||||
|
||||
// read header
|
||||
ELF_Chdr64 chdr64 = {0};
|
||||
U64 chdr_size = 0;
|
||||
@@ -86,38 +89,38 @@ dw_input_from_elf_section_table(Arena *arena, String8 raw_image, ELF_BinInfo *bi
|
||||
chdr64 = elf_chdr64_from_chdr32(chdr32);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AssertAlways(IsPow2(chdr64.ch_addr_align));
|
||||
|
||||
|
||||
// skip header
|
||||
String8 comp_data = str8_skip(comp_data_with_header, chdr_size);
|
||||
|
||||
|
||||
// push buffer for the decompressor
|
||||
U8 *decomp_buffer = push_array_no_zero_aligned(arena, U8, chdr64.ch_size, chdr64.ch_addr_align);
|
||||
U64 actual_decomp_size = 0;
|
||||
|
||||
// decompress
|
||||
switch (chdr64.ch_type) {
|
||||
case ELF_CompressType_None: {
|
||||
AssertAlways(!"unexpected compression type");
|
||||
} break;
|
||||
case ELF_CompressType_ZLib: {
|
||||
actual_decomp_size = zsinflate(decomp_buffer, chdr64.ch_size, comp_data.str, comp_data.size);
|
||||
} break;
|
||||
case ELF_CompressType_ZStd: {
|
||||
// TODO: zstd lib
|
||||
NotImplemented;
|
||||
} break;
|
||||
default: InvalidPath; break;
|
||||
case ELF_CompressType_None: {
|
||||
AssertAlways(!"unexpected compression type");
|
||||
} break;
|
||||
case ELF_CompressType_ZLib: {
|
||||
actual_decomp_size = zsinflate(decomp_buffer, chdr64.ch_size, comp_data.str, comp_data.size);
|
||||
} break;
|
||||
case ELF_CompressType_ZStd: {
|
||||
// TODO: zstd lib
|
||||
NotImplemented;
|
||||
} break;
|
||||
default: InvalidPath; break;
|
||||
}
|
||||
|
||||
|
||||
// TODO: error handling
|
||||
AssertAlways(actual_decomp_size == chdr64.ch_size);
|
||||
|
||||
|
||||
// set decompressed section data
|
||||
data = str8(decomp_buffer, actual_decomp_size);
|
||||
}
|
||||
|
||||
|
||||
sect_status[s] = 1;
|
||||
DW_Section *d = &result.sec[s];
|
||||
d->name = push_str8_copy(arena, name);
|
||||
@@ -126,7 +129,7 @@ dw_input_from_elf_section_table(Arena *arena, String8 raw_image, ELF_BinInfo *bi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -83,18 +83,20 @@ void raddbg_annotate_vaddr_range__impl(void *ptr, unsigned __int64 size, char *f
|
||||
////////////////////////////////
|
||||
//~ Win32 Implementations
|
||||
|
||||
#if defined(RADDBG_MARKUP_IMPLEMENTATION) && !defined(RADDBG_MARKUP_STUBS)
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32) && !defined(RADDBG_MARKUP_STUBS)
|
||||
|
||||
//- section allocating
|
||||
#pragma section(".raddbg", read, write)
|
||||
#define raddbg_exe_data __declspec(allocate(".raddbg"))
|
||||
|
||||
//- one-time implementations
|
||||
#if defined(RADDBG_MARKUP_IMPLEMENTATION)
|
||||
|
||||
//- default includes
|
||||
#if RADDBG_MARKUP_DEFAULT_VSNPRINTF
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
//- section allocating
|
||||
#pragma section(".raddbg", read, write)
|
||||
#define raddbg_exe_data __declspec(allocate(".raddbg"))
|
||||
|
||||
//- first byte of exe data section -> is attached
|
||||
static raddbg_exe_data unsigned char raddbg_is_attached_byte_marker[1];
|
||||
|
||||
@@ -459,8 +461,8 @@ raddbg_annotate_vaddr_range__impl(void *ptr, unsigned __int64 size, char *fmt, .
|
||||
}
|
||||
}
|
||||
|
||||
#endif // defined(_WIN32)
|
||||
#endif // defined(RADDBG_MARKUP_IMPLEMENTATION)
|
||||
#endif // defined(_WIN32) && !defined(RADDBG_MARKUP_STUBS)
|
||||
|
||||
////////////////////////////////
|
||||
//~ Win32 STL Type Views
|
||||
|
||||
+12
-8
@@ -26,6 +26,10 @@ bucket_list_pop(BucketList *list)
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
#define XXH_STATIC_LINKING_ONLY
|
||||
#include "third_party/xxHash/xxhash.c"
|
||||
#include "third_party/xxHash/xxhash.h"
|
||||
|
||||
internal U64
|
||||
hash_table_hasher(String8 string)
|
||||
{
|
||||
@@ -47,7 +51,7 @@ hash_table_purge(HashTable *ht)
|
||||
{
|
||||
// reset key count
|
||||
ht->count = 0;
|
||||
|
||||
|
||||
// concat buckets
|
||||
for (U64 ibucket = 0; ibucket < ht->cap; ++ibucket) {
|
||||
bucket_list_concat_in_place(&ht->free_buckets, &ht->buckets[ibucket]);
|
||||
@@ -339,20 +343,20 @@ internal U64Array
|
||||
remove_duplicates_u64_array(Arena *arena, U64Array arr)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
|
||||
HashTable *ht = hash_table_init(scratch.arena, ((U64)(F64)arr.count * 0.5));
|
||||
|
||||
|
||||
for (U64 i = 0; i < arr.count; ++i) {
|
||||
KeyValuePair *is_present = hash_table_search_u64(ht, arr.v[i]);
|
||||
if (!is_present) {
|
||||
hash_table_push_u64_raw(scratch.arena, ht, arr.v[i], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
U64Array result = {0};
|
||||
result.count = ht->count;
|
||||
result.v = keys_from_hash_table_u64(arena, ht);
|
||||
|
||||
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
@@ -361,10 +365,10 @@ internal String8List
|
||||
remove_duplicates_str8_list(Arena *arena, String8List list)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
|
||||
String8List result = {0};
|
||||
HashTable *ht = hash_table_init(scratch.arena, list.node_count);
|
||||
|
||||
|
||||
for (String8Node *node = list.first; node != 0; node = node->next) {
|
||||
KeyValuePair *is_present = hash_table_search_string(ht, node->string);
|
||||
if (!is_present) {
|
||||
@@ -372,7 +376,7 @@ remove_duplicates_str8_list(Arena *arena, String8List list)
|
||||
str8_list_push(arena, &result, node->string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -151,6 +151,27 @@ os_string_from_file_range(Arena *arena, OS_Handle file, Rng1U64 range)
|
||||
return result;
|
||||
}
|
||||
|
||||
internal String8
|
||||
os_file_read_cstring(Arena *arena, OS_Handle file, U64 off)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
String8List block_list = {0};
|
||||
for(U64 cursor = off, stride = 256;; cursor += stride)
|
||||
{
|
||||
U8 *raw_block = push_array_no_zero(scratch.arena, U8, stride);
|
||||
U64 read_size = os_file_read(file, r1u64(cursor, cursor + stride), raw_block);
|
||||
String8 block = str8_cstring_capped(raw_block, raw_block+read_size);
|
||||
str8_list_push(scratch.arena, &block_list, block);
|
||||
if(read_size != stride || (block.size+1 <= read_size && block.str[block.size] == 0))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
String8 result = str8_list_join(arena, &block_list, 0);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Process Launcher Helpers
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ internal B32 os_append_data_to_file_path(String8 path, String8 data);
|
||||
internal OS_FileID os_id_from_file_path(String8 path);
|
||||
internal S64 os_file_id_compare(OS_FileID a, OS_FileID b);
|
||||
internal String8 os_string_from_file_range(Arena *arena, OS_Handle file, Rng1U64 range);
|
||||
internal String8 os_file_read_cstring(Arena *arena, OS_Handle file, U64 off);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Process Launcher Helpers
|
||||
|
||||
+39
-60
@@ -543,7 +543,7 @@ pe_bin_info_from_data(Arena *arena, String8 data)
|
||||
data_dir_count = ClampTop(reported_data_dir_count, data_dir_max);
|
||||
|
||||
// rjf: convert PE directories to ranges
|
||||
data_dir_franges = push_array(arena, Rng1U64, data_dir_count);
|
||||
data_dir_franges = push_array(arena, Rng1U64, Max(data_dir_count, PE_DataDirectoryIndex_COUNT));
|
||||
for(U32 dir_idx = 0; dir_idx < data_dir_count; dir_idx += 1)
|
||||
{
|
||||
U64 dir_offset = optional_range.min + reported_data_dir_offset + sizeof(PE_DataDirectory)*dir_idx;
|
||||
@@ -620,87 +620,66 @@ pe_bin_info_from_data(Arena *arena, String8 data)
|
||||
}
|
||||
|
||||
internal PE_DebugInfoList
|
||||
pe_parse_debug_directory(Arena *arena, String8 raw_image, String8 raw_debug_dir)
|
||||
pe_debug_info_list_from_raw_debug_dir(Arena *arena, String8 raw_image, String8 raw_debug_dir)
|
||||
{
|
||||
PE_DebugInfoList result = {0};
|
||||
|
||||
PE_DebugDirectory *debug_entry = str8_deserial_get_raw_ptr(raw_debug_dir, 0, sizeof(*debug_entry));
|
||||
PE_DebugDirectory *debug_entry_opl = debug_entry + raw_debug_dir.size/sizeof(*debug_entry_opl);
|
||||
for (PE_DebugDirectory *entry = debug_entry; entry < debug_entry_opl; ++entry) {
|
||||
switch (entry->type) {
|
||||
default: {
|
||||
PE_DebugInfoNode *n = push_array(arena, PE_DebugInfoNode, 1);
|
||||
n->v.header = *entry;
|
||||
n->v.u.raw_data = str8_substr(raw_image, rng_1u64(entry->foff, entry->foff + entry->size));
|
||||
|
||||
SLLQueuePush(result.first, result.last, n);
|
||||
++result.count;
|
||||
} break;
|
||||
case PE_DebugDirectoryType_CODEVIEW: {
|
||||
U32 cv_magic = 0;
|
||||
str8_deserial_read_struct(raw_image, entry->foff, &cv_magic);
|
||||
|
||||
switch (cv_magic) {
|
||||
case PE_CODEVIEW_PDB20_MAGIC: {
|
||||
for(PE_DebugDirectory *entry = debug_entry; entry < debug_entry_opl; entry += 1)
|
||||
{
|
||||
PE_DebugInfoNode *n = push_array(arena, PE_DebugInfoNode, 1);
|
||||
SLLQueuePush(result.first, result.last, n);
|
||||
result.count += 1;
|
||||
n->v.header = *entry;
|
||||
switch(entry->type)
|
||||
{
|
||||
default:{}break;
|
||||
case PE_DebugDirectoryType_CODEVIEW:
|
||||
{
|
||||
str8_deserial_read_struct(raw_image, entry->foff, &n->v.cv_magic);
|
||||
switch(n->v.cv_magic)
|
||||
{
|
||||
case PE_CODEVIEW_PDB20_MAGIC:
|
||||
{
|
||||
PE_CvHeaderPDB20 cv = {0};
|
||||
U64 cv_read_size = str8_deserial_read_struct(raw_image, entry->foff, &cv);
|
||||
if (cv_read_size == sizeof(cv)) {
|
||||
if(cv_read_size == sizeof(cv))
|
||||
{
|
||||
String8 path = {0};
|
||||
str8_deserial_read_cstr(raw_image, entry->foff+sizeof(cv), &path);
|
||||
|
||||
PE_DebugInfoNode *n = push_array(arena, PE_DebugInfoNode, 1);
|
||||
n->v.header = *entry;
|
||||
n->v.u.codeview.pdb20.header = cv;
|
||||
n->v.u.codeview.pdb20.path = path;
|
||||
|
||||
SLLQueuePush(result.first, result.last, n);
|
||||
++result.count;
|
||||
} else {
|
||||
Assert(!"unable to read PE_CvHeaderPDB20");
|
||||
n->v.cv_pdb20_header = cv;
|
||||
n->v.path = path;
|
||||
}
|
||||
} break;
|
||||
case PE_CODEVIEW_PDB70_MAGIC: {
|
||||
}break;
|
||||
case PE_CODEVIEW_PDB70_MAGIC:
|
||||
{
|
||||
PE_CvHeaderPDB70 cv = {0};
|
||||
U64 cv_read_size = str8_deserial_read_struct(raw_image, entry->foff, &cv);
|
||||
if (cv_read_size == sizeof(cv)) {
|
||||
if(cv_read_size == sizeof(cv))
|
||||
{
|
||||
String8 path = {0};
|
||||
str8_deserial_read_cstr(raw_image, entry->foff+sizeof(cv), &path);
|
||||
|
||||
PE_DebugInfoNode *n = push_array(arena, PE_DebugInfoNode, 1);
|
||||
n->v.header = *entry;
|
||||
n->v.u.codeview.pdb70.header = cv;
|
||||
n->v.u.codeview.pdb70.path = path;
|
||||
|
||||
SLLQueuePush(result.first, result.last, n);
|
||||
++result.count;
|
||||
} else {
|
||||
Assert(!"unable to read PE_CvHeaderPDB70");
|
||||
n->v.cv_pdb70_header = cv;
|
||||
n->v.path = path;
|
||||
}
|
||||
} break;
|
||||
case PE_CODEVIEW_RDI_MAGIC: {
|
||||
}break;
|
||||
case PE_CODEVIEW_RDI_MAGIC:
|
||||
{
|
||||
PE_CvHeaderRDI cv = {0};
|
||||
U64 cv_read_size = str8_deserial_read_struct(raw_image, entry->foff, &cv);
|
||||
if (cv_read_size == sizeof(cv)) {
|
||||
if(cv_read_size == sizeof(cv))
|
||||
{
|
||||
String8 path = {0};
|
||||
str8_deserial_read_cstr(raw_image, entry->foff+sizeof(cv), &path);
|
||||
|
||||
PE_DebugInfoNode *n = push_array(arena, PE_DebugInfoNode, 1);
|
||||
n->v.header = *entry;
|
||||
n->v.u.codeview.rdi.header = cv;
|
||||
n->v.u.codeview.rdi.path = path;
|
||||
|
||||
SLLQueuePush(result.first, result.last, n);
|
||||
++result.count;
|
||||
} else {
|
||||
Assert(!"unable to read PE_CvHeaderRDI");
|
||||
n->v.cv_rdi_header = cv;
|
||||
n->v.path = path;
|
||||
}
|
||||
} break;
|
||||
default: break;
|
||||
}break;
|
||||
default:{}break;
|
||||
}
|
||||
} break;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+8
-25
@@ -1012,30 +1012,13 @@ struct PE_BinInfo
|
||||
typedef struct PE_DebugInfo
|
||||
{
|
||||
PE_DebugDirectory header;
|
||||
union
|
||||
{
|
||||
union
|
||||
{
|
||||
U32 magic;
|
||||
struct
|
||||
{
|
||||
PE_CvHeaderPDB20 header;
|
||||
String8 path;
|
||||
} pdb20;
|
||||
struct
|
||||
{
|
||||
PE_CvHeaderPDB70 header;
|
||||
String8 path;
|
||||
} pdb70;
|
||||
struct
|
||||
{
|
||||
PE_CvHeaderRDI header;
|
||||
String8 path;
|
||||
} rdi;
|
||||
} codeview;
|
||||
String8 raw_data;
|
||||
} u;
|
||||
} PE_DebugInfo;
|
||||
U32 cv_magic;
|
||||
PE_CvHeaderPDB20 cv_pdb20_header;
|
||||
PE_CvHeaderPDB70 cv_pdb70_header;
|
||||
PE_CvHeaderRDI cv_rdi_header;
|
||||
String8 path;
|
||||
}
|
||||
PE_DebugInfo;
|
||||
|
||||
typedef struct PE_DebugInfoNode
|
||||
{
|
||||
@@ -1075,7 +1058,7 @@ internal String8 pe_string_from_dll_characteristics(Arena *arena, PE_DllCharacte
|
||||
internal B32 pe_check_magic(String8 data);
|
||||
internal PE_BinInfo pe_bin_info_from_data(Arena *arena, String8 data);
|
||||
|
||||
internal PE_DebugInfoList pe_parse_debug_directory(Arena *arena, String8 raw_image, String8 raw_debug_dir);
|
||||
internal PE_DebugInfoList pe_debug_info_list_from_raw_debug_dir(Arena *arena, String8 raw_image, String8 raw_debug_dir);
|
||||
internal PE_ParsedStaticImportTable pe_static_imports_from_data(Arena *arena, B32 is_pe32, U64 section_count, COFF_SectionHeader *sections, String8 raw_data, Rng1U64 dir_file_range);
|
||||
internal PE_ParsedDelayImportTable pe_delay_imports_from_data(Arena *arena, B32 is_pe32, U64 section_count, COFF_SectionHeader *sections, String8 raw_data, Rng1U64 dir_file_range);
|
||||
internal PE_ParsedExportTable pe_exports_from_data(Arena *arena, U64 section_count, COFF_SectionHeader *sections, String8 raw_data, Rng1U64 dir_file_range, Rng1U64 dir_virt_range);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//- GENERATED CODE
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
String8 rb_file_format_display_name_table[9] =
|
||||
String8 rb_file_format_display_name_table[10] =
|
||||
{
|
||||
{0},
|
||||
str8_lit_comp("PDB"),
|
||||
@@ -13,7 +13,8 @@ str8_lit_comp("COFF (OBJ)"),
|
||||
str8_lit_comp("COFF (Big OBJ)"),
|
||||
str8_lit_comp("COFF (Archive)"),
|
||||
str8_lit_comp("COFF (Thin Archive)"),
|
||||
str8_lit_comp("ELF"),
|
||||
str8_lit_comp("ELF32"),
|
||||
str8_lit_comp("ELF64"),
|
||||
str8_lit_comp("RDI"),
|
||||
};
|
||||
|
||||
|
||||
@@ -15,13 +15,14 @@ RB_FileFormat_COFF_OBJ,
|
||||
RB_FileFormat_COFF_BigOBJ,
|
||||
RB_FileFormat_COFF_Archive,
|
||||
RB_FileFormat_COFF_ThinArchive,
|
||||
RB_FileFormat_ELF,
|
||||
RB_FileFormat_ELF32,
|
||||
RB_FileFormat_ELF64,
|
||||
RB_FileFormat_RDI,
|
||||
RB_FileFormat_COUNT,
|
||||
} RB_FileFormat;
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 rb_file_format_display_name_table[9];
|
||||
extern String8 rb_file_format_display_name_table[10];
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
|
||||
+579
-394
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,42 @@
|
||||
|
||||
#include "radbin/generated/radbin.meta.h"
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: File Types
|
||||
|
||||
typedef U32 RB_FileFormatFlags;
|
||||
enum
|
||||
{
|
||||
RB_FileFormatFlag_HasDWARF = (1<<0),
|
||||
};
|
||||
|
||||
typedef struct RB_File RB_File;
|
||||
struct RB_File
|
||||
{
|
||||
RB_FileFormat format;
|
||||
RB_FileFormatFlags format_flags;
|
||||
String8 path;
|
||||
String8 data;
|
||||
};
|
||||
|
||||
typedef struct RB_FileNode RB_FileNode;
|
||||
struct RB_FileNode
|
||||
{
|
||||
RB_FileNode *next;
|
||||
RB_File *v;
|
||||
};
|
||||
|
||||
typedef struct RB_FileList RB_FileList;
|
||||
struct RB_FileList
|
||||
{
|
||||
RB_FileNode *first;
|
||||
RB_FileNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
read_only global RB_File rb_file_nil = {0};
|
||||
#define rb_file_list_first(list) ((list)->first ? (list)->first->v : &rb_file_nil)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Top-Level Entry Point
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ RB_FileFormatTable:
|
||||
{ COFF_BigOBJ "COFF (Big OBJ)" }
|
||||
{ COFF_Archive "COFF (Archive)" }
|
||||
{ COFF_ThinArchive "COFF (Thin Archive)" }
|
||||
{ ELF "ELF" }
|
||||
{ ELF32 "ELF32" }
|
||||
{ ELF64 "ELF64" }
|
||||
{ RDI "RDI" }
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
//- rjf: [h]
|
||||
#include "base/base_inc.h"
|
||||
#include "linker/hash_table.h"
|
||||
#include "os/os_inc.h"
|
||||
#include "path/path.h"
|
||||
#include "async/async.h"
|
||||
@@ -28,17 +29,25 @@
|
||||
#include "elf/elf_parse.h"
|
||||
#include "codeview/codeview.h"
|
||||
#include "codeview/codeview_parse.h"
|
||||
#include "dwarf/dwarf.h"
|
||||
#include "dwarf/dwarf_parse.h"
|
||||
#include "dwarf/dwarf_coff.h"
|
||||
#include "dwarf/dwarf_elf.h"
|
||||
#include "msf/msf.h"
|
||||
#include "msf/msf_parse.h"
|
||||
#include "pdb/pdb.h"
|
||||
#include "pdb/pdb_parse.h"
|
||||
#include "pdb/pdb_stringize.h"
|
||||
#include "rdi_from_coff/rdi_from_coff.h"
|
||||
#include "rdi_from_elf/rdi_from_elf.h"
|
||||
#include "rdi_from_pdb/rdi_from_pdb.h"
|
||||
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.h"
|
||||
#include "rdi_from_dwarf/rdi_from_dwarf.h"
|
||||
#include "radbin/radbin.h"
|
||||
|
||||
//- rjf: [c]
|
||||
#include "base/base_inc.c"
|
||||
#include "linker/hash_table.c"
|
||||
#include "os/os_inc.c"
|
||||
#include "path/path.c"
|
||||
#include "async/async.c"
|
||||
@@ -51,13 +60,20 @@
|
||||
#include "elf/elf_parse.c"
|
||||
#include "codeview/codeview.c"
|
||||
#include "codeview/codeview_parse.c"
|
||||
#include "dwarf/dwarf.c"
|
||||
#include "dwarf/dwarf_parse.c"
|
||||
#include "dwarf/dwarf_coff.c"
|
||||
#include "dwarf/dwarf_elf.c"
|
||||
#include "msf/msf.c"
|
||||
#include "msf/msf_parse.c"
|
||||
#include "pdb/pdb.c"
|
||||
#include "pdb/pdb_parse.c"
|
||||
#include "pdb/pdb_stringize.c"
|
||||
#include "rdi_from_coff/rdi_from_coff.c"
|
||||
#include "rdi_from_elf/rdi_from_elf.c"
|
||||
#include "rdi_from_pdb/rdi_from_pdb.c"
|
||||
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.c"
|
||||
#include "rdi_from_dwarf/rdi_from_dwarf.c"
|
||||
#include "radbin/radbin.c"
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
+71
-71
@@ -13,12 +13,12 @@ internal RC_Context
|
||||
rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
|
||||
if (cmdl->inputs.node_count > 2) {
|
||||
fprintf(stderr, "error: too many input files on the command line.\n");
|
||||
os_abort(1);
|
||||
}
|
||||
|
||||
|
||||
B32 is_pe_present = 0;
|
||||
B32 is_pdb_present = 0;
|
||||
B32 is_elf_present = 0;
|
||||
@@ -31,7 +31,7 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
String8 elf_data = {0};
|
||||
String8 elf_debug_name = {0};
|
||||
String8 elf_debug_data = {0};
|
||||
|
||||
|
||||
//
|
||||
// Set typed inputs
|
||||
//
|
||||
@@ -71,7 +71,7 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
}
|
||||
is_elf_debug_present = 1;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Pick conversion driver
|
||||
//
|
||||
@@ -87,18 +87,18 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
os_abort(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Load inputs
|
||||
//
|
||||
for (String8Node *input_n = cmdl->inputs.first; input_n != 0; input_n = input_n->next) {
|
||||
String8 input_data = os_data_from_file_path(arena, input_n->string);
|
||||
|
||||
|
||||
if (input_data.size == 0) {
|
||||
fprintf(stderr, "unable to read input %.*s\n", str8_varg(input_n->string));
|
||||
os_abort(1);
|
||||
}
|
||||
|
||||
|
||||
if (pe_check_magic(input_data)) {
|
||||
if (is_pe_present) {
|
||||
fprintf(stderr, "error: too many PE files are specified on the command line\n");
|
||||
@@ -139,7 +139,7 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
fprintf(stderr, "error: unknown file format %.*s\n", str8_varg(input_n->string));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Validate input combos
|
||||
//
|
||||
@@ -159,54 +159,54 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
}
|
||||
os_abort(1);
|
||||
}
|
||||
|
||||
|
||||
if (is_pe_present && (is_elf_present || is_elf_debug_present)) {
|
||||
fprintf(stderr, "error: command line has too many image types specified.\n");
|
||||
os_abort(1);
|
||||
}
|
||||
|
||||
|
||||
ImageType image = Image_Null;
|
||||
|
||||
|
||||
ExecutableImageKind image = ExecutableImageKind_Null;
|
||||
String8 image_name = {0};
|
||||
String8 image_data = {0};
|
||||
String8 debug_name = {0};
|
||||
String8 debug_data = {0};
|
||||
|
||||
|
||||
B32 check_guid = 0;
|
||||
Guid pe_pdb_guid = {0};
|
||||
|
||||
|
||||
B32 elf_has_debug_link = 0;
|
||||
ELF_GnuDebugLink debug_link = {0};
|
||||
|
||||
|
||||
//
|
||||
// Input has PE/COFF
|
||||
//
|
||||
if (is_pe_present) {
|
||||
image = Image_CoffPe;
|
||||
image = ExecutableImageKind_CoffPe;
|
||||
image_name = pe_name;
|
||||
image_data = pe_data;
|
||||
|
||||
|
||||
PE_BinInfo pe = pe_bin_info_from_data(scratch.arena, pe_data);
|
||||
String8 raw_debug_dir = str8_substr(pe_data, pe.data_dir_franges[PE_DataDirectoryIndex_DEBUG]);
|
||||
PE_DebugInfoList debug_dir = pe_parse_debug_directory(scratch.arena, pe_data, raw_debug_dir);
|
||||
PE_DebugInfoList debug_dir = pe_debug_info_list_from_raw_debug_dir(scratch.arena, pe_data, raw_debug_dir);
|
||||
for (PE_DebugInfoNode *debug_n = debug_dir.first; debug_n != 0; debug_n = debug_n->next) {
|
||||
PE_DebugInfo *debug = &debug_n->v;
|
||||
if (debug->header.type == PE_DebugDirectoryType_CODEVIEW) {
|
||||
if (debug->u.codeview.magic == PE_CODEVIEW_PDB70_MAGIC) {
|
||||
check_guid = 1;
|
||||
pe_pdb_guid = debug->u.codeview.pdb70.header.guid;
|
||||
|
||||
|
||||
if (!is_pdb_present) {
|
||||
pdb_name = debug->u.codeview.pdb70.path;
|
||||
pdb_data = rc_data_from_file_path(arena, pdb_name);
|
||||
is_pdb_present = 1;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (driver == RC_Driver_Null || driver == RC_Driver_Dwarf) {
|
||||
PE_BinInfo pe = pe_bin_info_from_data(scratch.arena, pe_data);
|
||||
String8 raw_section_table = str8_substr(pe_data, pe.section_table_range);
|
||||
@@ -224,19 +224,19 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (is_elf_present || is_elf_debug_present) {
|
||||
if (driver != RC_Driver_Null && driver != RC_Driver_Dwarf) {
|
||||
fprintf(stderr, "error: ELF inputs are only supported when using DWARF driver.\n");
|
||||
os_abort(1);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Load image ELF
|
||||
//
|
||||
ELF_BinInfo elf = elf_bin_from_data(elf_data);
|
||||
B32 has_elf_dwarf = dw_is_dwarf_present_elf_section_table(elf_data, &elf);
|
||||
|
||||
|
||||
//
|
||||
// ELF doesn't have debug info and no .debug was specified on command line,
|
||||
// try to load .debug via debug link
|
||||
@@ -248,54 +248,54 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
elf_debug_data = rc_data_from_file_path(arena, debug_link.path);
|
||||
is_elf_debug_present = 1;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Load .debug ELF
|
||||
//
|
||||
ELF_BinInfo elf_debug = elf_bin_from_data(elf_debug_data);
|
||||
B32 has_elf_debug_dwarf = dw_is_dwarf_present_elf_section_table(elf_debug_data, &elf_debug);
|
||||
|
||||
|
||||
//
|
||||
// Input is image ELF and .debug ELF
|
||||
//
|
||||
B32 is_split_elf = is_elf_present && is_elf_debug_present && !has_elf_dwarf && has_elf_debug_dwarf;
|
||||
if (is_split_elf) {
|
||||
driver = RC_Driver_Dwarf;
|
||||
image = ELF_HdrIs64Bit(elf.hdr.e_ident) ? Image_Elf64 : Image_Elf32;
|
||||
image = ELF_HdrIs64Bit(elf.hdr.e_ident) ? ExecutableImageKind_Elf64 : ExecutableImageKind_Elf32;
|
||||
image_name = elf_name;
|
||||
image_data = elf_data;
|
||||
debug_name = elf_debug_name;
|
||||
debug_data = elf_debug_data;
|
||||
goto driver_found;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Input ELF is image with debug info
|
||||
//
|
||||
B32 is_monolithic_elf = is_elf_present && !is_elf_debug_present && has_elf_dwarf;
|
||||
if (is_monolithic_elf) {
|
||||
driver = RC_Driver_Dwarf;
|
||||
image = ELF_HdrIs64Bit(elf.hdr.e_ident) ? Image_Elf64 : Image_Elf32;
|
||||
image = ELF_HdrIs64Bit(elf.hdr.e_ident) ? ExecutableImageKind_Elf64 : ExecutableImageKind_Elf32;
|
||||
image_name = elf_name;
|
||||
image_data = elf_data;
|
||||
debug_name = elf_name;
|
||||
debug_data = elf_data;
|
||||
goto driver_found;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Input ELF is .debug
|
||||
//
|
||||
B32 is_debug_elf = !is_elf_present && is_elf_debug_present && has_elf_debug_dwarf;
|
||||
if (is_debug_elf) {
|
||||
driver = RC_Driver_Dwarf;
|
||||
image = ELF_HdrIs64Bit(elf_debug.hdr.e_ident) ? Image_Elf64 : Image_Elf32;
|
||||
image = ELF_HdrIs64Bit(elf_debug.hdr.e_ident) ? ExecutableImageKind_Elf64 : ExecutableImageKind_Elf32;
|
||||
debug_name = elf_debug_name;
|
||||
debug_data = elf_debug_data;
|
||||
goto driver_found;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Input is PDB
|
||||
//
|
||||
@@ -312,9 +312,9 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
InvalidPath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
driver_found:;
|
||||
|
||||
|
||||
//
|
||||
// Handle -out param
|
||||
//
|
||||
@@ -332,8 +332,8 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
out_name = path_replace_file_extension(arena, debug_name, str8_lit("rdi"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Validate driver input
|
||||
//
|
||||
@@ -342,8 +342,8 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
fprintf(stderr, "error: DWARF is an invalid input for PDB driver\n");
|
||||
os_abort(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
RC_Context ctx = {0};
|
||||
ctx.driver = driver;
|
||||
ctx.image = image;
|
||||
@@ -352,23 +352,23 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
ctx.debug_name = debug_name;
|
||||
ctx.debug_data = debug_data;
|
||||
ctx.flags = RC_Flag_Strings|
|
||||
RC_Flag_IndexRuns|
|
||||
RC_Flag_BinarySections|
|
||||
RC_Flag_Units|
|
||||
RC_Flag_Procedures|
|
||||
RC_Flag_GlobalVariables|
|
||||
RC_Flag_ThreadVariables|
|
||||
RC_Flag_Scopes|
|
||||
RC_Flag_Locals|
|
||||
RC_Flag_Types|
|
||||
RC_Flag_UDTs|
|
||||
RC_Flag_LineInfo|
|
||||
RC_Flag_GlobalVariableNameMap|
|
||||
RC_Flag_ThreadVariableNameMap|
|
||||
RC_Flag_ProcedureNameMap|
|
||||
RC_Flag_TypeNameMap|
|
||||
RC_Flag_LinkNameProcedureNameMap|
|
||||
RC_Flag_NormalSourcePathNameMap;
|
||||
RC_Flag_IndexRuns|
|
||||
RC_Flag_BinarySections|
|
||||
RC_Flag_Units|
|
||||
RC_Flag_Procedures|
|
||||
RC_Flag_GlobalVariables|
|
||||
RC_Flag_ThreadVariables|
|
||||
RC_Flag_Scopes|
|
||||
RC_Flag_Locals|
|
||||
RC_Flag_Types|
|
||||
RC_Flag_UDTs|
|
||||
RC_Flag_LineInfo|
|
||||
RC_Flag_GlobalVariableNameMap|
|
||||
RC_Flag_ThreadVariableNameMap|
|
||||
RC_Flag_ProcedureNameMap|
|
||||
RC_Flag_TypeNameMap|
|
||||
RC_Flag_LinkNameProcedureNameMap|
|
||||
RC_Flag_NormalSourcePathNameMap;
|
||||
if (check_guid) {
|
||||
ctx.flags |= RC_Flag_CheckPdbGuid;
|
||||
ctx.guid = pe_pdb_guid;
|
||||
@@ -378,7 +378,7 @@ rc_context_from_cmd_line(Arena *arena, CmdLine *cmdl)
|
||||
ctx.debug_link = debug_link;
|
||||
}
|
||||
ctx.out_name = out_name;
|
||||
|
||||
|
||||
scratch_end(scratch);
|
||||
return ctx;
|
||||
}
|
||||
@@ -387,40 +387,40 @@ internal String8List
|
||||
rc_run(Arena *arena, RC_Context *rc)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
|
||||
ProfBegin("Convert");
|
||||
RDIM_LocalState *local_state = rdim_local_init();
|
||||
RDIM_BakeParams *convert2bake = 0;
|
||||
switch (rc->driver) {
|
||||
case RC_Driver_Null: break;
|
||||
case RC_Driver_Dwarf: convert2bake = d2r_convert(scratch.arena, local_state, rc); break;
|
||||
case RC_Driver_Pdb: convert2bake = p2r_convert(scratch.arena, local_state, rc); break;
|
||||
case RC_Driver_Null: break;
|
||||
case RC_Driver_Dwarf: convert2bake = d2r_convert(scratch.arena, local_state, rc); break;
|
||||
case RC_Driver_Pdb: convert2bake = p2r_convert(scratch.arena, local_state, rc); break;
|
||||
}
|
||||
ProfEnd();
|
||||
|
||||
|
||||
if (rc->errors.node_count) {
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
ProfBegin("Bake");
|
||||
RDIM_BakeResults bake2srlz = rdim_bake(local_state, convert2bake);
|
||||
ProfEnd();
|
||||
|
||||
|
||||
ProfBegin("Serialize Bake");
|
||||
RDIM_SerializedSectionBundle srlz2file = rdim_serialized_section_bundle_from_bake_results(&bake2srlz);
|
||||
ProfEnd();
|
||||
|
||||
|
||||
RDIM_SerializedSectionBundle srlz2file_compressed = srlz2file;
|
||||
if (rc->flags & RC_Flag_Compress) {
|
||||
ProfBegin("Compress");
|
||||
srlz2file_compressed = rdim_compress(scratch.arena, &srlz2file);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
|
||||
ProfBegin("Serialize");
|
||||
String8List raw_rdi = rdim_file_blobs_from_section_bundle(scratch.arena, &srlz2file_compressed);
|
||||
ProfEnd();
|
||||
|
||||
|
||||
scratch_end(scratch);
|
||||
return raw_rdi;
|
||||
}
|
||||
@@ -456,25 +456,25 @@ rc_main(CmdLine *cmdl)
|
||||
fprintf(stderr, " -driver:<PDB|DWARF> Sets converter for debug info\n");
|
||||
} else {
|
||||
Temp scratch = scratch_begin(0,0);
|
||||
|
||||
|
||||
// make converter context
|
||||
RC_Context rc = rc_context_from_cmd_line(scratch.arena, cmdl);
|
||||
|
||||
|
||||
// make RDI from context
|
||||
String8List raw_rdi = rc_run(scratch.arena, &rc);
|
||||
|
||||
|
||||
// output RDI
|
||||
if (rc.errors.node_count == 0) {
|
||||
if (!os_write_data_list_to_file_path(rc.out_name, raw_rdi)) {
|
||||
str8_list_pushf(scratch.arena, &rc.errors, "no write access to path %.*s", str8_varg(rc.out_name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// report any errors
|
||||
for (String8Node *error_n = rc.errors.first; error_n != 0; error_n = error_n->next) {
|
||||
fprintf(stderr, "error: %.*s\n", str8_varg(error_n->string));
|
||||
}
|
||||
|
||||
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ typedef enum
|
||||
|
||||
typedef struct RC_Context
|
||||
{
|
||||
ImageType image;
|
||||
ExecutableImageKind image;
|
||||
RC_Driver driver;
|
||||
String8 image_name;
|
||||
String8 image_data;
|
||||
|
||||
+18
-19
@@ -1031,10 +1031,10 @@ d2r_cu_contrib_map_from_aranges(Arena *arena, DW_Input *input, U64 image_base)
|
||||
return cm;
|
||||
}
|
||||
|
||||
internal RDIM_Rng1U64List
|
||||
internal RDIM_Rng1U64ChunkList
|
||||
d2r_voff_ranges_from_cu_info_off(D2R_CompUnitContribMap map, U64 info_off)
|
||||
{
|
||||
RDIM_Rng1U64List voff_ranges = {0};
|
||||
RDIM_Rng1U64ChunkList voff_ranges = {0};
|
||||
U64 voff_list_idx = u64_array_bsearch(map.info_off_arr, map.count, info_off);
|
||||
if (voff_list_idx < map.count) {
|
||||
voff_ranges = map.voff_range_arr[voff_list_idx];
|
||||
@@ -1073,7 +1073,7 @@ d2r_push_scope(Arena *arena, RDIM_ScopeChunkList *scopes, U64 scope_chunk_cap, D
|
||||
return scope;
|
||||
}
|
||||
|
||||
internal RDIM_BakeParams *
|
||||
internal RDIM_BakeParams
|
||||
d2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
@@ -1091,7 +1091,7 @@ d2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in)
|
||||
RDIM_BinarySectionList binary_sections = {0};
|
||||
DW_Input input = {0};
|
||||
|
||||
if (in->image == Image_CoffPe) {
|
||||
if (in->image == ExecutableImageKind_CoffPe) {
|
||||
PE_BinInfo pe = pe_bin_info_from_data(scratch.arena, in->image_data);
|
||||
|
||||
// get image arch
|
||||
@@ -1111,7 +1111,7 @@ d2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in)
|
||||
|
||||
// make DWARF input
|
||||
input = dw_input_from_coff_section_table(scratch.arena, in->image_data, string_table, section_count, section_table);
|
||||
} else if (in->image == Image_Elf32 || in->image == Image_Elf64) {
|
||||
} else if (in->image == ExecutableImageKind_Elf32 || in->image == ExecutableImageKind_Elf64) {
|
||||
ELF_BinInfo elf = elf_bin_from_data(in->debug_data);
|
||||
|
||||
// get image arch
|
||||
@@ -2066,19 +2066,19 @@ d2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in)
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
RDIM_BakeParams *bake_params = push_array(arena, RDIM_BakeParams, 1);
|
||||
bake_params->top_level_info = top_level_info;
|
||||
bake_params->binary_sections = binary_sections;
|
||||
bake_params->units = units;
|
||||
bake_params->types = types;
|
||||
bake_params->udts = udts;
|
||||
bake_params->src_files = src_files;
|
||||
bake_params->line_tables = line_tables;
|
||||
bake_params->global_variables = gvars;
|
||||
bake_params->thread_variables = tvars;
|
||||
bake_params->procedures = procs;
|
||||
bake_params->scopes = scopes;
|
||||
bake_params->inline_sites = inline_sites;
|
||||
RDIM_BakeParams bake_params = {0};
|
||||
bake_params.top_level_info = top_level_info;
|
||||
bake_params.binary_sections = binary_sections;
|
||||
bake_params.units = units;
|
||||
bake_params.types = types;
|
||||
bake_params.udts = udts;
|
||||
bake_params.src_files = src_files;
|
||||
bake_params.line_tables = line_tables;
|
||||
bake_params.global_variables = gvars;
|
||||
bake_params.thread_variables = tvars;
|
||||
bake_params.procedures = procs;
|
||||
bake_params.scopes = scopes;
|
||||
bake_params.inline_sites = inline_sites;
|
||||
|
||||
scratch_end(scratch);
|
||||
return bake_params;
|
||||
@@ -2148,4 +2148,3 @@ rdi_reg_from_dw_reg(Arch arch, DW_Reg v, RDI_RegCode *code_out, U64 *off_out, U6
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ typedef struct D2R_TagNode
|
||||
|
||||
typedef struct D2R_CompUnitContribMap
|
||||
{
|
||||
U64 count;
|
||||
U64 *info_off_arr;
|
||||
RDIM_Rng1U64List *voff_range_arr;
|
||||
U64 count;
|
||||
U64 *info_off_arr;
|
||||
RDIM_Rng1U64ChunkList *voff_range_arr;
|
||||
} D2R_CompUnitContribMap;
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
//~ rjf: post-0.9.19 TODO notes
|
||||
//
|
||||
//- memory view
|
||||
// [x] auto-annotations for non-locals
|
||||
// [ ] have smaller visible range than entire memory
|
||||
// space, within some bounds (e.g. 64KB)
|
||||
// [ ] dynamically expand memory space, based on
|
||||
@@ -180,6 +179,7 @@
|
||||
// [x] if a breakpoint matches the entry point's starting address, its hit count
|
||||
// is not correctly incremented.
|
||||
// [x] output: add option for scroll-to-bottom - ensure this shows up in universal ctx menu
|
||||
// [x] auto-annotations for non-locals
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Build Options
|
||||
@@ -203,6 +203,7 @@
|
||||
|
||||
//- rjf: [h]
|
||||
#include "base/base_inc.h"
|
||||
#include "linker/hash_table.h"
|
||||
#include "os/os_inc.h"
|
||||
#include "async/async.h"
|
||||
#include "rdi_format/rdi_format_local.h"
|
||||
@@ -225,7 +226,14 @@
|
||||
#include "pdb/pdb.h"
|
||||
#include "pdb/pdb_parse.h"
|
||||
#include "pdb/pdb_stringize.h"
|
||||
#include "dwarf/dwarf.h"
|
||||
#include "dwarf/dwarf_parse.h"
|
||||
#include "dwarf/dwarf_coff.h"
|
||||
#include "dwarf/dwarf_elf.h"
|
||||
#include "rdi_from_coff/rdi_from_coff.h"
|
||||
#include "rdi_from_elf/rdi_from_elf.h"
|
||||
#include "rdi_from_pdb/rdi_from_pdb.h"
|
||||
#include "rdi_from_dwarf/rdi_from_dwarf.h"
|
||||
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.h"
|
||||
#include "radbin/radbin.h"
|
||||
#include "regs/regs.h"
|
||||
@@ -249,6 +257,7 @@
|
||||
|
||||
//- rjf: [c]
|
||||
#include "base/base_inc.c"
|
||||
#include "linker/hash_table.c"
|
||||
#include "os/os_inc.c"
|
||||
#include "async/async.c"
|
||||
#include "rdi_format/rdi_format_local.c"
|
||||
@@ -271,7 +280,14 @@
|
||||
#include "pdb/pdb.c"
|
||||
#include "pdb/pdb_parse.c"
|
||||
#include "pdb/pdb_stringize.c"
|
||||
#include "dwarf/dwarf.c"
|
||||
#include "dwarf/dwarf_parse.c"
|
||||
#include "dwarf/dwarf_coff.c"
|
||||
#include "dwarf/dwarf_elf.c"
|
||||
#include "rdi_from_coff/rdi_from_coff.c"
|
||||
#include "rdi_from_elf/rdi_from_elf.c"
|
||||
#include "rdi_from_pdb/rdi_from_pdb.c"
|
||||
#include "rdi_from_dwarf/rdi_from_dwarf.c"
|
||||
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.c"
|
||||
#include "radbin/radbin.c"
|
||||
#include "regs/regs.c"
|
||||
|
||||
@@ -3043,7 +3043,7 @@ dw_print_debug_str(Arena *arena, String8List *out, String8 indent, DW_Input *inp
|
||||
}
|
||||
|
||||
internal void
|
||||
dw_print_debug_loc(Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ImageType image_type, B32 relaxed)
|
||||
dw_print_debug_loc(Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ExecutableImageKind image_type, B32 relaxed)
|
||||
{
|
||||
#if 0
|
||||
DW_Section info = input->sec[DW_Section_Info];
|
||||
@@ -3190,7 +3190,7 @@ dw_print_debug_loc(Arena *arena, String8List *out, String8 indent, DW_Input *inp
|
||||
}
|
||||
|
||||
internal void
|
||||
dw_print_debug_ranges(Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ImageType image_type, B32 relaxed)
|
||||
dw_print_debug_ranges(Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ExecutableImageKind image_type, B32 relaxed)
|
||||
{
|
||||
NotImplemented;
|
||||
#if 0
|
||||
@@ -3956,7 +3956,7 @@ dw_print_debug_str_offsets(Arena *arena, String8List *out, String8 indent, DW_In
|
||||
}
|
||||
|
||||
internal void
|
||||
dw_format(Arena *arena, String8List *out, String8 indent, RD_Option opts, DW_Input *input, Arch arch, ImageType image_type)
|
||||
dw_format(Arena *arena, String8List *out, String8 indent, RD_Option opts, DW_Input *input, Arch arch, ExecutableImageKind image_type)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
@@ -6610,7 +6610,7 @@ coff_print_obj(Arena *arena, String8List *out, String8 indent, String8 raw_data,
|
||||
|
||||
if (opts & RD_Option_Dwarf) {
|
||||
DW_Input dwarf_input = dw_input_from_coff_section_table(scratch.arena, raw_data, raw_string_table, header->section_count, section_table);
|
||||
dw_format(arena, out, indent, opts, &dwarf_input, arch, Image_CoffPe);
|
||||
dw_format(arena, out, indent, opts, &dwarf_input, arch, ExecutableImageKind_CoffPe);
|
||||
}
|
||||
|
||||
exit:;
|
||||
@@ -7111,7 +7111,7 @@ pe_print_debug_diretory(Arena *arena, String8List *out, String8 indent, String8
|
||||
rd_printf("# Debug Directory");
|
||||
rd_indent();
|
||||
|
||||
PE_DebugInfoList debug_info_list = pe_parse_debug_directory(scratch.arena, raw_data, raw_dir);
|
||||
PE_DebugInfoList debug_info_list = pe_debug_info_list_from_raw_debug_dir(scratch.arena, raw_data, raw_dir);
|
||||
U64 i = 0;
|
||||
for (PE_DebugInfoNode *entry = debug_info_list.first; entry != 0; entry = entry->next, ++i) {
|
||||
PE_DebugInfo *de = &entry->v;
|
||||
@@ -8300,7 +8300,7 @@ pe_print(Arena *arena, String8List *out, String8 indent, String8 raw_data, RD_Op
|
||||
|
||||
if (opts & RD_Option_Dwarf) {
|
||||
DW_Input dwarf_input = dw_input_from_coff_section_table(scratch.arena, raw_data, raw_string_table, file_header->section_count, sections);
|
||||
dw_format(arena, out, indent, opts, &dwarf_input, arch, Image_CoffPe);
|
||||
dw_format(arena, out, indent, opts, &dwarf_input, arch, ExecutableImageKind_CoffPe);
|
||||
}
|
||||
|
||||
exit:;
|
||||
@@ -8317,7 +8317,7 @@ elf_print_dwarf_expressions(Arena *arena, String8List *out, String8 indent, Stri
|
||||
Arch arch = arch_from_elf_machine(bin.hdr.e_machine);
|
||||
DW_Input dwarf_input = dw_input_from_elf_section_table(scratch.arena, raw_data, &bin);
|
||||
ELF_Class elf_class = bin.hdr.e_ident[ELF_Identifier_Class];
|
||||
ImageType image_type = elf_class == ELF_Class_32 ? Image_Elf32 : elf_class == ELF_Class_64 ? Image_Elf64 : ELF_Class_None;
|
||||
ExecutableImageKind image_type = elf_class == ELF_Class_32 ? ExecutableImageKind_Elf32 : elf_class == ELF_Class_64 ? ExecutableImageKind_Elf64 : ELF_Class_None;
|
||||
B32 relaxed = 1;
|
||||
Rng1U64List cu_ranges = dw_unit_ranges_from_data(scratch.arena, dwarf_input.sec[DW_Section_Info].data);
|
||||
DW_ListUnitInput lu_input = dw_list_unit_input_from_input(scratch.arena, &dwarf_input);
|
||||
|
||||
@@ -231,8 +231,8 @@ internal void dw_print_debug_info (Arena *arena, String8List *out, String8
|
||||
internal void dw_print_debug_abbrev (Arena *arena, String8List *out, String8 indent, DW_Input *input);
|
||||
internal void dw_print_debug_line (Arena *arena, String8List *out, String8 indent, DW_Input *input, DW_ListUnitInput lu_input, B32 relaxed);
|
||||
internal void dw_print_debug_str (Arena *arena, String8List *out, String8 indent, DW_Input *input);
|
||||
internal void dw_print_debug_loc (Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ImageType image_type, B32 relaxed);
|
||||
internal void dw_print_debug_ranges (Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ImageType image_type, B32 relaxed);
|
||||
internal void dw_print_debug_loc (Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ExecutableImageKind image_type, B32 relaxed);
|
||||
internal void dw_print_debug_ranges (Arena *arena, String8List *out, String8 indent, DW_Input *input, Arch arch, ExecutableImageKind image_type, B32 relaxed);
|
||||
internal void dw_print_debug_aranges (Arena *arena, String8List *out, String8 indent, DW_Input *input);
|
||||
internal void dw_print_debug_addr (Arena *arena, String8List *out, String8 indent, DW_Input *input);
|
||||
internal void dw_print_debug_loclists (Arena *arena, String8List *out, String8 indent, DW_Input *input, Rng1U64Array segment_vranges, Arch arch);
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
// Copyright (c) Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
internal RDI_Arch
|
||||
c2r_rdi_arch_from_coff_machine(COFF_MachineType machine)
|
||||
{
|
||||
switch (machine) {
|
||||
case COFF_MachineType_X86: return RDI_Arch_X86;
|
||||
case COFF_MachineType_X64: return RDI_Arch_X64;
|
||||
|
||||
case COFF_MachineType_Unknown:
|
||||
case COFF_MachineType_Am33:
|
||||
case COFF_MachineType_Arm:
|
||||
case COFF_MachineType_Arm64:
|
||||
case COFF_MachineType_ArmNt:
|
||||
case COFF_MachineType_Ebc:
|
||||
case COFF_MachineType_Ia64:
|
||||
case COFF_MachineType_M32R:
|
||||
case COFF_MachineType_Mips16:
|
||||
case COFF_MachineType_MipsFpu:
|
||||
case COFF_MachineType_MipsFpu16:
|
||||
case COFF_MachineType_PowerPc:
|
||||
case COFF_MachineType_PowerPcFp:
|
||||
case COFF_MachineType_R4000:
|
||||
case COFF_MachineType_RiscV32:
|
||||
case COFF_MachineType_RiscV64:
|
||||
case COFF_MachineType_Sh3:
|
||||
case COFF_MachineType_Sh3Dsp:
|
||||
case COFF_MachineType_Sh4:
|
||||
case COFF_MachineType_Sh5:
|
||||
case COFF_MachineType_Thumb:
|
||||
case COFF_MachineType_WceMipsV2:
|
||||
NotImplemented;
|
||||
default:
|
||||
return RDI_Arch_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
internal RDI_BinarySectionFlags
|
||||
c2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags)
|
||||
{
|
||||
RDI_BinarySectionFlags result = 0;
|
||||
if(flags & COFF_SectionFlag_MemRead)
|
||||
{
|
||||
result |= RDI_BinarySectionFlag_Read;
|
||||
}
|
||||
if(flags & COFF_SectionFlag_MemWrite)
|
||||
{
|
||||
result |= RDI_BinarySectionFlag_Write;
|
||||
}
|
||||
if(flags & COFF_SectionFlag_MemExecute)
|
||||
{
|
||||
result |= RDI_BinarySectionFlag_Execute;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal RDIM_BinarySectionList
|
||||
c2r_rdi_binary_sections_from_coff_sections(Arena *arena, String8 image_data, String8 string_table, U64 sectab_count, COFF_SectionHeader *sectab)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
|
||||
RDIM_BinarySectionList binary_sections = {0};
|
||||
|
||||
for (U64 isec = 0; isec < sectab_count; ++isec) {
|
||||
COFF_SectionHeader *coff_sec = §ab[isec];
|
||||
RDIM_BinarySection *sec = rdim_binary_section_list_push(arena, &binary_sections);
|
||||
|
||||
sec->name = coff_name_from_section_header(string_table, coff_sec);
|
||||
sec->flags = c2r_rdi_binary_section_flags_from_coff_section_flags(coff_sec->flags);
|
||||
sec->voff_first = coff_sec->voff;
|
||||
sec->voff_opl = coff_sec->voff + coff_sec->vsize;
|
||||
sec->foff_first = coff_sec->foff;
|
||||
sec->foff_opl = coff_sec->foff + coff_sec->fsize;
|
||||
}
|
||||
|
||||
ProfEnd();
|
||||
return binary_sections;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef RDI_FROM_COFF_H
|
||||
#define RDI_FROM_COFF_H
|
||||
|
||||
internal RDI_Arch c2r_rdi_arch_from_coff_machine(COFF_MachineType machine);
|
||||
internal RDI_BinarySectionFlags c2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags);
|
||||
internal RDIM_BinarySectionList c2r_rdi_binary_sections_from_coff_sections(Arena *arena, String8 image_data, String8 string_table, U64 sectab_count, COFF_SectionHeader *sectab);
|
||||
|
||||
#endif // RDI_FROM_COFF_H
|
||||
+509
-331
File diff suppressed because it is too large
Load Diff
@@ -3,32 +3,23 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef U64 D2R_ConvertFlags;
|
||||
enum
|
||||
typedef struct D2R_ConvertParams D2R_ConvertParams;
|
||||
struct D2R_ConvertParams
|
||||
{
|
||||
#define X(t,n,k) D2R_ConvertFlag_##t = (1ull << RDI_SectionKind_##t),
|
||||
RDI_SectionKind_XList
|
||||
#undef X
|
||||
D2R_ConvertFlag_StrictParse,
|
||||
String8 dbg_name;
|
||||
String8 dbg_data;
|
||||
String8 exe_name;
|
||||
String8 exe_data;
|
||||
ExecutableImageKind exe_kind;
|
||||
RDIM_SubsetFlags subset_flags;
|
||||
B32 deterministic;
|
||||
};
|
||||
|
||||
typedef struct D2R_User2Convert
|
||||
{
|
||||
String8 input_exe_name;
|
||||
String8 input_exe_data;
|
||||
String8 input_debug_name;
|
||||
String8 input_debug_data;
|
||||
String8 output_name;
|
||||
D2R_ConvertFlags flags;
|
||||
String8List errors;
|
||||
} D2R_User2Convert;
|
||||
|
||||
typedef struct D2R_TypeTable
|
||||
{
|
||||
HashTable *ht;
|
||||
RDIM_TypeChunkList *types;
|
||||
U64 type_chunk_cap;
|
||||
RDIM_Type *void_type;
|
||||
RDIM_Type *varg_type;
|
||||
} D2R_TypeTable;
|
||||
|
||||
@@ -42,28 +33,18 @@ typedef struct D2R_TagNode
|
||||
|
||||
typedef struct D2R_CompUnitContribMap
|
||||
{
|
||||
U64 count;
|
||||
U64 *info_off_arr;
|
||||
RDIM_Rng1U64List *voff_range_arr;
|
||||
U64 count;
|
||||
U64 *info_off_arr;
|
||||
RDIM_Rng1U64ChunkList *voff_range_arr;
|
||||
} D2R_CompUnitContribMap;
|
||||
|
||||
////////////////////////////////
|
||||
// Command Line -> Conversion Inputs
|
||||
|
||||
internal D2R_User2Convert * d2r_user2convert_from_cmdln(Arena *arena, CmdLine *cmdline);
|
||||
internal RDIM_BakeParams d2r_convert(Arena *arena, ASYNC_Root *async_root, D2R_ConvertParams *params);
|
||||
|
||||
////////////////////////////////
|
||||
// Top-Level Conversion Entry Point
|
||||
|
||||
internal RDIM_BakeParams * d2r_convert (Arena *arena, D2R_User2Convert *in);
|
||||
internal RDIM_BakeResults d2r_bake (RDIM_LocalState *state, RDIM_BakeParams *in);
|
||||
internal RDIM_SerializedSectionBundle d2r_compress(Arena *arena, RDIM_SerializedSectionBundle in);
|
||||
|
||||
////////////////////////////////
|
||||
// Enum Conversion
|
||||
|
||||
internal RDI_Language rdi_language_from_dw_language(DW_Language v);
|
||||
internal RDI_RegCodeX86 rdi_reg_from_dw_reg_x86(DW_RegX86 v);
|
||||
internal B32 rdi_reg_from_dw_reg_x64(DW_RegX64 v, RDI_RegCodeX64 *code_out, U64 *off_out, U64 *size_out);
|
||||
internal B32 rdi_reg_from_dw_reg(Arch arch, DW_Reg v, RDI_RegCode *code_out, U64 *off_out, U64 *size_out);
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
internal RDIM_BinarySectionList
|
||||
e2r_rdi_binary_sections_from_elf_section_table(Arena *arena, ELF_Shdr64Array shdrs)
|
||||
{
|
||||
RDIM_BinarySectionList result = {0};
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef RDI_FROM_ELF_H
|
||||
#define RDI_FROM_ELF_H
|
||||
|
||||
internal RDIM_BinarySectionList e2r_rdi_binary_sections_from_elf_section_table(Arena *arena, ELF_Shdr64Array shdrs);
|
||||
|
||||
#endif // RDI_FROM_ELF_H
|
||||
Reference in New Issue
Block a user