diff lwasm/symbol.c @ 433:b1adf549d181

Add some debugging instrumentation for tracking an expression bug There's no reason not to keep the instrumentation so into the repo it goes.
author William Astle <lost@l-w.ca>
date Mon, 23 Jan 2017 22:54:19 -0700
parents 8764142b3192
children
line wrap: on
line diff
--- a/lwasm/symbol.c	Fri Nov 18 21:25:43 2016 -0700
+++ b/lwasm/symbol.c	Mon Jan 23 22:54:19 2017 -0700
@@ -252,6 +252,8 @@
 	int local = 0;
 	struct symtabe *s;
 	int cdir;
+
+	debug_message(as, 100, "Look up symbol %s", sym);
 	
 	// check if this is a local symbol
 	if (strchr(sym, '@') || strchr(sym, '?'))
@@ -283,13 +285,17 @@
 		}
 		
 		if (!cdir)
+		{
+			debug_message(as, 100, "Found symbol %s: %s, %s", sym, s -> symbol, lw_expr_print(s -> value));
 			return s;
+		}
 		
 		if (cdir < 0)
 			s = s -> left;
 		else
 			s = s -> right;
 	}
+	debug_message(as, 100, "Symbol not found %s", sym);
 	return NULL;
 }