mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Add support for symbol table in .com files
This change fixes minor bugs and adds a feature, which lets us store the ELF symbol table, inside the ZIP directory. We use the path /zip/.symtab which can be safely removed using a zip editing tool, to make the binary smaller after compilation. This supplements the existing method of using a separate .com.dbg file, which is still supported. The intent is people don't always know that it's a good idea to download the debug file. It's not great having someone's first experience be a crash report, that only has numbers rather than symbols. This will help fix that!
This commit is contained in:
parent
393ca4be40
commit
23b72eb617
61 changed files with 963 additions and 510 deletions
|
@ -102,18 +102,13 @@ privileged noinstrument noasan noubsan void ftracer(void) {
|
|||
}
|
||||
|
||||
textstartup void ftrace_install(void) {
|
||||
const char *path;
|
||||
if ((path = FindDebugBinary())) {
|
||||
if ((g_symbols = OpenSymbolTable(path))) {
|
||||
laststamp = kStartTsc;
|
||||
g_lastsymbol = -1;
|
||||
g_skew = GetNestingLevelImpl(__builtin_frame_address(0));
|
||||
ftrace_enabled = 1;
|
||||
__hook(ftrace_hook, g_symbols);
|
||||
} else {
|
||||
kprintf("error: --ftrace failed to open symbol table\r\n");
|
||||
}
|
||||
if ((g_symbols = GetSymbolTable())) {
|
||||
laststamp = kStartTsc;
|
||||
g_lastsymbol = -1;
|
||||
g_skew = GetNestingLevelImpl(__builtin_frame_address(0));
|
||||
ftrace_enabled = 1;
|
||||
__hook(ftrace_hook, g_symbols);
|
||||
} else {
|
||||
kprintf("error: --ftrace needs concomitant .com.dbg binary\r\n");
|
||||
kprintf("error: --ftrace failed to open symbol table\r\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue