mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 22:19:10 +00:00
Improve debug binary location detection
This commit is contained in:
parent
68c7c9c1e0
commit
7a9e176ecf
17 changed files with 92 additions and 50 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/symbols.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
|
@ -46,10 +47,9 @@ relegated wontreturn void __die(void) {
|
|||
strcpy(host, "unknown");
|
||||
gethostname(host, sizeof(host));
|
||||
kprintf("%serror: %s on %s pid %d tid %d has perished%s\n"
|
||||
"cosmoaddr2line %s%s %s\n",
|
||||
"cosmoaddr2line %s %s\n",
|
||||
__nocolor ? "" : "\e[1;31m", program_invocation_short_name, host,
|
||||
getpid(), gettid(), __nocolor ? "" : "\e[0m", __argv[0],
|
||||
endswith(__argv[0], ".com") ? ".dbg" : "",
|
||||
getpid(), gettid(), __nocolor ? "" : "\e[0m", FindDebugBinary(),
|
||||
DescribeBacktrace(__builtin_frame_address(0)));
|
||||
_Exit(77);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue