Commit 744c5ad3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix two issues in our backtrace code:

use "nm -an", not "nm -agn" which supresses local symbols.

Let backtrace_symbols() handle anything past _end.
parent 7b69a1de
......@@ -237,7 +237,9 @@ Symbol_Lookup(struct vsb *vsb, void *ptr)
}
if (s0 == NULL)
return (-1);
VSB_printf(vsb, "%p: %s+%jx", ptr, s0->n, (uintmax_t)pp - s0->a);
if (!strcmp(s0->n, "_end"))
return (-1);
VSB_printf(vsb, "%p: %s+0x%jx", ptr, s0->n, (uintmax_t)pp - s0->a);
return (0);
}
......@@ -249,7 +251,7 @@ Symbol_hack(const char *a0)
uintptr_t a;
struct symbols *s;
bprintf(buf, "nm -agn %s 2>/dev/null", a0);
bprintf(buf, "nm -an %s 2>/dev/null", a0);
fi = popen(buf, "r");
if (fi == NULL)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment