r4065 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sat May 9 18:49:49 CEST 2009


Author: phk
Date: 2009-05-09 18:49:49 +0200 (Sat, 09 May 2009)
New Revision: 4065

Modified:
   trunk/varnish-cache/bin/varnishd/cache_panic.c
   trunk/varnish-cache/bin/varnishd/common.h
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Pass a void* to Symbol_Lookup() to avoid stdint requirement on common.h



Modified: trunk/varnish-cache/bin/varnishd/cache_panic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_panic.c	2009-05-09 16:46:55 UTC (rev 4064)
+++ trunk/varnish-cache/bin/varnishd/cache_panic.c	2009-05-09 16:49:49 UTC (rev 4065)
@@ -273,7 +273,7 @@
 	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]);

Modified: trunk/varnish-cache/bin/varnishd/common.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/common.h	2009-05-09 16:46:55 UTC (rev 4064)
+++ trunk/varnish-cache/bin/varnishd/common.h	2009-05-09 16:49:49 UTC (rev 4065)
@@ -46,7 +46,7 @@
 
 /* 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))
 

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2009-05-09 16:46:55 UTC (rev 4064)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2009-05-09 16:49:49 UTC (rev 4065)
@@ -410,13 +410,15 @@
 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 @@
 	}
 	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);
 }
 



More information about the varnish-commit mailing list