mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Document __demangle() and fix a const func ptr bug
This commit is contained in:
parent
c67faf61df
commit
9aa353d88b
7 changed files with 618 additions and 670 deletions
File diff suppressed because it is too large
Load diff
|
@ -810,7 +810,8 @@ privileged static size_t kformat(char *b, size_t n, const char *fmt,
|
|||
/* *p++ = '&'; */
|
||||
s = (*_weaken(__symtab))->name_base +
|
||||
(*_weaken(__symtab))->names[idx];
|
||||
if (__is_mangled(s) && __demangle(cxxbuf, s, sizeof(cxxbuf)) != -1)
|
||||
if (_weaken(__is_mangled) && _weaken(__is_mangled)(s) &&
|
||||
_weaken(__demangle)(cxxbuf, s, sizeof(cxxbuf)) != -1)
|
||||
s = cxxbuf;
|
||||
goto FormatString;
|
||||
}
|
||||
|
|
|
@ -90,8 +90,9 @@ dontinstrument dontasan int PrintBacktraceUsingSymbols(
|
|||
symbol = 0;
|
||||
addend = 0;
|
||||
}
|
||||
if ((name = __get_symbol_name(st, symbol)) && __is_mangled(name)) {
|
||||
__demangle(cxxbuf, name, sizeof(cxxbuf));
|
||||
if ((name = __get_symbol_name(st, symbol)) &&
|
||||
(_weaken(__is_mangled) && _weaken(__is_mangled)(name))) {
|
||||
_weaken(__demangle)(cxxbuf, name, sizeof(cxxbuf));
|
||||
kprintf("%012lx %lx %s%+d\n", frame, addr, cxxbuf, addend);
|
||||
name = cxxbuf;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue