Improve debug binary location detection

This commit is contained in:
Justine Tunney 2023-11-16 23:26:05 -08:00
parent 68c7c9c1e0
commit 7a9e176ecf
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
17 changed files with 92 additions and 50 deletions

View file

@ -229,8 +229,8 @@ static relegated void __oncrash_impl(int sig, struct siginfo *si,
Append(b, " %s %s %s %s\n", names.sysname, names.version, names.nodename,
names.release);
Append(
b, " cosmoaddr2line %s%s %lx %s\n", __argv[0],
endswith(__argv[0], ".com") ? ".dbg" : "", ctx ? ctx->uc_mcontext.PC : 0,
b, " cosmoaddr2line %s %lx %s\n", FindDebugBinary(),
ctx ? ctx->uc_mcontext.PC : 0,
DescribeBacktrace(ctx ? (struct StackFrame *)ctx->uc_mcontext.BP
: (struct StackFrame *)__builtin_frame_address(0)));
if (ctx) {