Commit 490aca62 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Pass a void* to Symbol_Lookup() to avoid stdint requirement on common.h



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4065 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ec016db1
......@@ -273,7 +273,7 @@ pan_backtrace(void)
vsb_printf(vsp, "Backtrace:\n");
for (i = 0; i < size; i++) {
vsb_printf (vsp, " ");
if (Symbol_Lookup(vsp, (uintptr_t)array[i]) < 0) {
if (Symbol_Lookup(vsp, array[i]) < 0) {
char **strings;
strings = backtrace_symbols(&array[i], 1);
vsb_printf(vsp, "%p: %s", array[i], strings[0]);
......
......@@ -46,7 +46,7 @@ extern struct varnish_stats *VSL_stats;
/* varnishd.c */
struct vsb;
int Symbol_Lookup(struct vsb *vsb, uintptr_t ptr);
int Symbol_Lookup(struct vsb *vsb, void *ptr);
#define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr))
......
......@@ -410,13 +410,15 @@ struct symbols {
static VTAILQ_HEAD(,symbols) symbols = VTAILQ_HEAD_INITIALIZER(symbols);
int
Symbol_Lookup(struct vsb *vsb, uintptr_t ptr)
Symbol_Lookup(struct vsb *vsb, void *ptr)
{
struct symbols *s, *s0;
uintptr_t pp;
pp = (uintptr_t)ptr;
s0 = NULL;
VTAILQ_FOREACH(s, &symbols, list) {
if (s->a > ptr)
if (s->a > pp)
continue;
if (s0 != NULL && s->a < s0->a)
continue;
......@@ -424,9 +426,9 @@ Symbol_Lookup(struct vsb *vsb, uintptr_t ptr)
}
if (s0 == NULL)
return (-1);
vsb_printf(vsb, "%p", (void *)ptr);
vsb_printf(vsb, "%p", ptr);
if (s0 != NULL)
vsb_printf(vsb, ": %s+%jx", s0->n, (uintmax_t)ptr - s0->a);
vsb_printf(vsb, ": %s+%jx", s0->n, (uintmax_t)pp - s0->a);
return (0);
}
......
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