Fix emit location.

This commit is contained in:
Christoffer Lerno
2023-11-13 21:42:38 +01:00
parent 9345e4270a
commit 587d5578ab
4 changed files with 4 additions and 4 deletions

View File

@@ -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", "-i", "-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 - 1) })!;
String[] parts = s.tsplit(" at ");
if (parts.len != 2)
{