dwarf debug info option in builds, fix heuristic to try to load debug info from exe itself

This commit is contained in:
Ryan Fleury
2025-10-01 15:36:36 -07:00
parent db66beaf22
commit 7707ba1d60
6 changed files with 47 additions and 30 deletions
+9 -13
View File
@@ -2,28 +2,24 @@
// Licensed under the MIT license (https://opensource.org/license/mit/)
internal B32
dw_is_dwarf_present_coff_section_table(String8 raw_image,
String8 string_table,
U64 section_count,
COFF_SectionHeader *section_table)
dw_is_dwarf_present_coff_section_table(String8 string_table, U64 section_count, COFF_SectionHeader *section_table)
{
B32 is_dwarf_present = 0;
for (U64 i = 0; i < section_count; ++i) {
COFF_SectionHeader *header = &section_table[i];
String8 name = coff_name_from_section_header(string_table, header);
for EachIndex(idx, section_count)
{
COFF_SectionHeader *header = &section_table[idx];
String8 name = coff_name_from_section_header(string_table, header);
DW_SectionKind s = dw_section_kind_from_string(name);
if (s == DW_Section_Null) {
if(s == DW_Section_Null)
{
s = dw_section_dwo_kind_from_string(name);
}
is_dwarf_present = s != DW_Section_Null;
if (is_dwarf_present) {
if(is_dwarf_present)
{
break;
}
}
return is_dwarf_present;
}