Skip to content

Commit

Permalink
Fixes to native backtrace.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Nov 12, 2023
1 parent f323d48 commit a51776c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ jobs:
../build/c3c compile-run examples/load_world.c3
../build/c3c compile-run examples/process.c3
../build/c3c compile-run examples/ls.c3
../build/c3c compile-run --system-linker=no linux_stack.c3
../build/c3c compile-run --reloc=none --system-linker=no linux_stack.c3
- name: Compile run unit tests
run: |
Expand Down
3 changes: 1 addition & 2 deletions lib/std/os/linux/linux.c3
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn Backtrace! backtrace_load_element(void* addr, Allocator* allocator = mem::hea
void* obj_address = addr - (uptr)info.dli_fbase + (uptr)elf_module_image_base(info.dli_fname.str_view())!;
ZString obj_path = info.dli_fname;
ZString sname = info.dli_sname ? info.dli_sname : (ZString)"???";
String s = process::execute_stdout_to_buffer(buf, { "addr2line", "-p", "-C", "-f", "-e", obj_path.str_view(), string::tformat("0x%x", obj_address) })!;
String s = process::execute_stdout_to_buffer(buf, { "addr2line", "-p", "-i", "-C", "-f", "-e", obj_path.str_view(), string::tformat("0x%x", obj_address) })!;
String[] parts = s.tsplit(" at ");
if (parts.len != 2)
{
Expand Down Expand Up @@ -194,7 +194,6 @@ fn BacktraceList! backtrace_load(Allocator* allocator)
for (usz i = 0; i < size; i++)
{
Backtrace trace = backtrace_load_element(bt_buffer[i], allocator)!;
io::printn(trace);
list.append(trace);
}
};
Expand Down

0 comments on commit a51776c

Please sign in to comment.