summaryrefslogtreecommitdiff
path: root/src/trace/Debugger.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/trace/Debugger.zig')
-rw-r--r--src/trace/Debugger.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/trace/Debugger.zig b/src/trace/Debugger.zig
index 5310ad3..f4f945b 100644
--- a/src/trace/Debugger.zig
+++ b/src/trace/Debugger.zig
@@ -66,6 +66,8 @@ allocations: std.ArrayList(Watch) = .empty,
/// The most read of them at a stop, in bytes: a stop's cost must not grow
/// with the target's heap.
allocation_watch: usize = 256 << 10,
+/// glibc's heap, recorded at every stop as `heap.zig` reads it (`--heap`): null for not at all.
+heap: ?@import("heap.zig").Watch = null,
breakpoints: std.ArrayList(Breakpoint) = .empty,
/// The current thread's registers at its last stop.
regs: Regs = .{},
@@ -490,6 +492,7 @@ fn report(d: *Debugger, stop: Stop) !Stop {
for (d.watches.items) |w| try d.snapshot(w.addr, w.len);
for (d.declared.items) |w| try d.snapshot(w.addr, w.len);
try d.snapshotAllocations();
+ if (d.heap) |*h| try h.atStop(d);
try d.emitCode();
try d.emitTelescope();
}
@@ -1136,7 +1139,7 @@ pub fn cfi(d: *Debugger, pc: u64) ?Symbols.Cfi {
/// The target's memory as a walk of the call chain reads it, every word it
/// reads recorded, and the frame of every function it goes through
/// (`emitFunction`): so a reader walks the same chain from the recording.
-const Recorded = struct {
+pub const Recorded = struct {
d: *Debugger,
failed: ?anyerror = null,
/// The stack as last read, a page at a time: a walk goes up it.