mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
infer path style from exe type
This commit is contained in:
committed by
Ryan Fleury
parent
36b22c06b1
commit
b091233a33
@@ -2585,6 +2585,7 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
|
|||||||
Arch arch = Arch_Null;
|
Arch arch = Arch_Null;
|
||||||
U64 image_base = 0;
|
U64 image_base = 0;
|
||||||
DW_Input input = {0};
|
DW_Input input = {0};
|
||||||
|
PathStyle path_style = PathStyle_Null;
|
||||||
|
|
||||||
switch(params->exe_kind) {
|
switch(params->exe_kind) {
|
||||||
default:{}break;
|
default:{}break;
|
||||||
@@ -2597,6 +2598,7 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
|
|||||||
image_base = pe.image_base;
|
image_base = pe.image_base;
|
||||||
binary_sections = c2r_rdi_binary_sections_from_coff_sections(arena, params->exe_data, string_table, pe.section_count, section_table);
|
binary_sections = c2r_rdi_binary_sections_from_coff_sections(arena, params->exe_data, string_table, pe.section_count, section_table);
|
||||||
input = dw_input_from_coff_section_table(scratch.arena, params->exe_data, string_table, pe.section_count, section_table);
|
input = dw_input_from_coff_section_table(scratch.arena, params->exe_data, string_table, pe.section_count, section_table);
|
||||||
|
path_style = PathStyle_WindowsAbsolute;
|
||||||
} break;
|
} break;
|
||||||
case ExecutableImageKind_Elf32:
|
case ExecutableImageKind_Elf32:
|
||||||
case ExecutableImageKind_Elf64: {
|
case ExecutableImageKind_Elf64: {
|
||||||
@@ -2605,6 +2607,7 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
|
|||||||
image_base = elf_base_addr_from_bin(&bin);
|
image_base = elf_base_addr_from_bin(&bin);
|
||||||
binary_sections = e2r_rdi_binary_sections_from_elf_section_table(arena, bin.shdrs);
|
binary_sections = e2r_rdi_binary_sections_from_elf_section_table(arena, bin.shdrs);
|
||||||
input = dw_input_from_elf_bin(scratch.arena, params->dbg_data, &bin);
|
input = dw_input_from_elf_bin(scratch.arena, params->dbg_data, &bin);
|
||||||
|
path_style = PathStyle_UnixAbsolute;
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2677,8 +2680,8 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
|
|||||||
DW_LineFile *file = &file_table->v[file_idx];
|
DW_LineFile *file = &file_table->v[file_idx];
|
||||||
String8 file_path = dw_path_from_file_idx(scratch.arena, &line_table->vm_header, file_idx);
|
String8 file_path = dw_path_from_file_idx(scratch.arena, &line_table->vm_header, file_idx);
|
||||||
String8List file_path_split = str8_split_path(scratch.arena, file_path);
|
String8List file_path_split = str8_split_path(scratch.arena, file_path);
|
||||||
str8_path_list_resolve_dots_in_place(&file_path_split, PathStyle_WindowsAbsolute);
|
str8_path_list_resolve_dots_in_place(&file_path_split, path_style);
|
||||||
String8 file_path_resolved = str8_path_list_join_by_style(scratch.arena, &file_path_split, PathStyle_WindowsAbsolute);
|
String8 file_path_resolved = str8_path_list_join_by_style(scratch.arena, &file_path_split, path_style);
|
||||||
RDIM_SrcFile *src_file = hash_table_search_path_raw(source_file_ht, file_path_resolved);
|
RDIM_SrcFile *src_file = hash_table_search_path_raw(source_file_ht, file_path_resolved);
|
||||||
if (src_file == 0) {
|
if (src_file == 0) {
|
||||||
src_file = rdim_src_file_chunk_list_push(arena, &src_files, SRC_FILE_CAP);
|
src_file = rdim_src_file_chunk_list_push(arena, &src_files, SRC_FILE_CAP);
|
||||||
|
|||||||
Reference in New Issue
Block a user