mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-10 03:21:37 -07:00
define enum for image type
This commit is contained in:
@@ -454,6 +454,15 @@ typedef enum OperatingSystem
|
|||||||
}
|
}
|
||||||
OperatingSystem;
|
OperatingSystem;
|
||||||
|
|
||||||
|
typedef enum ImageType
|
||||||
|
{
|
||||||
|
Image_Null,
|
||||||
|
Image_CoffPe,
|
||||||
|
Image_Elf32,
|
||||||
|
Image_Elf64,
|
||||||
|
Image_Macho
|
||||||
|
} ImageType;
|
||||||
|
|
||||||
typedef enum Arch
|
typedef enum Arch
|
||||||
{
|
{
|
||||||
Arch_Null,
|
Arch_Null,
|
||||||
|
|||||||
@@ -1473,15 +1473,15 @@ dw_ext_from_params(String8 producer, Arch arch, ImageType image_type)
|
|||||||
DW_Ext ext = DW_Ext_Null;
|
DW_Ext ext = DW_Ext_Null;
|
||||||
switch (image_type) {
|
switch (image_type) {
|
||||||
case Image_Null: break;
|
case Image_Null: break;
|
||||||
case Image_COFF_PE: {
|
case Image_CoffPe: {
|
||||||
if (str8_match(str8_lit("clang"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
if (str8_match(str8_lit("clang"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
||||||
ext = DW_Ext_GNU | DW_Ext_LLVM;
|
ext = DW_Ext_GNU | DW_Ext_LLVM;
|
||||||
} else if (str8_match(str8_lit("GNU"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
} else if (str8_match(str8_lit("GNU"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
||||||
ext = DW_Ext_GNU;
|
ext = DW_Ext_GNU;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case Image_ELF32:
|
case Image_Elf32:
|
||||||
case Image_ELF64: {
|
case Image_Elf64: {
|
||||||
if (str8_match(str8_lit("clang"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
if (str8_match(str8_lit("clang"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
||||||
ext = DW_Ext_GNU | DW_Ext_LLVM;
|
ext = DW_Ext_GNU | DW_Ext_LLVM;
|
||||||
} else if (str8_match(str8_lit("GNU"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
} else if (str8_match(str8_lit("GNU"), producer, StringMatchFlag_RightSideSloppy|StringMatchFlag_CaseInsensitive)) {
|
||||||
|
|||||||
@@ -5159,7 +5159,7 @@ coff_print_obj(Arena *arena, String8List *out, String8 indent, String8 raw_data,
|
|||||||
|
|
||||||
if (opts & RD_Option_Dwarf) {
|
if (opts & RD_Option_Dwarf) {
|
||||||
DW_SectionArray dwarf_sections = rd_dw_sections_from_coff_section_table(scratch.arena, raw_data, string_table_off, header->section_count, sections);
|
DW_SectionArray dwarf_sections = rd_dw_sections_from_coff_section_table(scratch.arena, raw_data, string_table_off, header->section_count, sections);
|
||||||
dw_format(arena, out, indent, opts, &dwarf_sections, arch, Image_COFF_PE);
|
dw_format(arena, out, indent, opts, &dwarf_sections, arch, Image_CoffPe);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:;
|
exit:;
|
||||||
@@ -6857,7 +6857,7 @@ pe_print(Arena *arena, String8List *out, String8 indent, String8 raw_data, RD_Op
|
|||||||
|
|
||||||
if (opts & RD_Option_Dwarf) {
|
if (opts & RD_Option_Dwarf) {
|
||||||
DW_SectionArray dwarf_sections = rd_dw_sections_from_coff_section_table(scratch.arena, raw_data, string_table_off, coff_header->section_count, sections);
|
DW_SectionArray dwarf_sections = rd_dw_sections_from_coff_section_table(scratch.arena, raw_data, string_table_off, coff_header->section_count, sections);
|
||||||
dw_format(arena, out, indent, opts, &dwarf_sections, arch, Image_COFF_PE);
|
dw_format(arena, out, indent, opts, &dwarf_sections, arch, Image_CoffPe);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:;
|
exit:;
|
||||||
|
|||||||
Reference in New Issue
Block a user