diff --git a/src/rdi_from_dwarf/rdi_from_dwarf.c b/src/rdi_from_dwarf/rdi_from_dwarf.c index 445281a6..36fd2e51 100644 --- a/src/rdi_from_dwarf/rdi_from_dwarf.c +++ b/src/rdi_from_dwarf/rdi_from_dwarf.c @@ -2861,10 +2861,16 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params) // make file path String8 path; { - String8List path_list = {0}; - str8_list_push_node(&path_list, &(String8Node){ .string = lookup->vm->header.dir_table.v[src->dir_idx] }); + Temp temp = temp_begin(scratch.arena); + PathStyle path_style = PathStyle_Null; + path_style = path_style_from_str8(lookup->vm->header.dir_table.v[src->dir_idx]); + if (path_style == PathStyle_Relative) { + path_style = path_style_from_str8(src->path); + } + String8List path_list = str8_split_path(temp.arena, lookup->vm->header.dir_table.v[src->dir_idx]); str8_list_push_node(&path_list, &(String8Node){ .string = src->path }); path = str8_path_list_join_by_style(arena, &path_list, path_style); + temp_end(temp); } // fill out source file diff --git a/src/torture/dbg_tests/basic_stepping_test.c b/src/torture/dbg_tests/basic_stepping_test.c index a60c5e05..1edac62d 100644 --- a/src/torture/dbg_tests/basic_stepping_test.c +++ b/src/torture/dbg_tests/basic_stepping_test.c @@ -36,11 +36,11 @@ int foo(); int main() /// 1: step_into { /// 2: at /// 3: step_over - int x = foo(123); /// 4: at + int x = foo(123); /// 4: at /// 5: step_into /// 10: at: -2 /// 11: step_over - printf("Hello, world!\n"); /// 12: at + printf("Hello, world!\n"); /// 12: at /// 13: step_over /// 14: run }