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)
{

View File

@@ -105,7 +105,7 @@ fn Backtrace! backtrace_load_element(String execpath, void* buffer, void* load_a
String s = process::execute_stdout_to_buffer(buf[:1024],
{ "atos", "-o", execpath, "-arch", env::AARCH64 ? "arm64" : "x86_64", "-l",
string::tformat("%p", load_address),
string::tformat("%p", buffer),
string::tformat("%p", buffer - 1),
"-fullPath" })!;
String[] parts = s.tsplit(" ");
if (parts.len == 4)

View File

@@ -5723,7 +5723,7 @@ INLINE void llvm_emit_call_invocation(GenContext *c, BEValue *result_value,
// 10. Create the actual call (remember to emit a loc, because we might have shifted loc emitting the params)
if (c->debug.builder) llvm_emit_debug_location(c, span);
EMIT_SPAN(c, span);
llvm_emit_raw_call(c, result_value, prototype, func_type, func, arg_values, arg_count, inline_flag, error_var, sret_return, &synthetic_return_param);

View File

@@ -1 +1 @@
#define COMPILER_VERSION "0.4.702"
#define COMPILER_VERSION "0.4.703"