about summary refs log tree commit diff stats
path: root/subx/039debug.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-07-01 22:46:07 -0700
committerKartik Agaram <vc@akkartik.com>2019-07-01 23:09:58 -0700
commit120a740871dce0fbdc6d1dda09075540ebd8e683 (patch)
tree7a5d0d34d11a4185d56c7afd9efaffebe8dffd7d /subx/039debug.cc
parent4d0a047f65eae8521d9ff936c7139db01a11f6f6 (diff)
downloadmu-120a740871dce0fbdc6d1dda09075540ebd8e683.tar.gz
some primitives for emitting traces
Kinda hacky, but might scale enough for machine code.

This was really hard to debug. Single tests passed, but when I ran all
tests I got breakage because tests long before (from the 056trace layer)
were not cleaning up properly.

My instinct was to call clear-stream on Trace-stream, which was wrong
(the trace didn't have the wrong contents, it was literally a bad
object). It was also wrong in a counter-productive way: calling
clear-stream on a real Trace stream (which is the size of a page of
memory) takes a long time in emulated mode.
Diffstat (limited to 'subx/039debug.cc')
-rw-r--r--subx/039debug.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/subx/039debug.cc b/subx/039debug.cc
index 8aa40558..a592e198 100644
--- a/subx/039debug.cc
+++ b/subx/039debug.cc
@@ -74,9 +74,9 @@ Watch_points.clear();
 :(code)
 void dump_watch_points() {
   if (Watch_points.empty()) return;
-  dbg << "watch points:" << end();
+  trace(Callstack_depth, "dbg") << "watch points:" << end();
   for (map<string, uint32_t>::iterator p = Watch_points.begin();  p != Watch_points.end();  ++p)
-    dbg << "  " << p->first << ": " << HEXWORD << p->second << " -> " << HEXWORD << read_mem_u32(p->second) << end();
+    trace(Callstack_depth, "dbg") << "  " << p->first << ": " << HEXWORD << p->second << " -> " << HEXWORD << read_mem_u32(p->second) << end();
 }
 
 :(before "End Globals")