<feed xmlns='http://www.w3.org/2005/Atom'>
<title>computeranim.git/src/cli/disasm.zig, branch main</title>
<subtitle>Tracing debugger and animations of running programs (ztrace, canim)</subtitle>
<id>https://git.0x4200.cafe/computeranim.git/atom?h=main</id>
<link rel='self' href='https://git.0x4200.cafe/computeranim.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/'/>
<updated>2026-11-10T17:48:26Z</updated>
<entry>
<title>context: eight instructions above the pc and eight below; where a branch goes</title>
<updated>2026-11-10T17:48:26Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T17:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=ed46c51fe127377eb1fde8dee83da984e0f61860'/>
<id>urn:sha1:ed46c51fe127377eb1fde8dee83da984e0f61860</id>
<content type='text'>
A function is decoded once from its start, so the instructions before the
pc are known: each instruction's string now says the length of the one
before it, and ztrace show prints eight above and eight below, as pwndbg
does. A call, a jump or a return at the pc is a branch event with its
target (named) and, for a conditional jump, whether the flags take it.
</content>
</entry>
<entry>
<title>context: what an instruction is about to touch, and the call chain</title>
<updated>2026-11-10T17:39:55Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T17:35:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=97ce7f485fc0419df693fdf16d634e9e9a6085fc'/>
<id>urn:sha1:97ce7f485fc0419df693fdf16d634e9e9a6085fc</id>
<content type='text'>
At a stop the instruction at the pc is decoded against the registers it
will run with (capstone's operands): a touch event for each memory operand
(address, size, read or write), what is there recorded with it, and what a
write left there read back at the next stop. An instruction-level
recording so has every memory write of the stepped thread, nothing watched.
The frames of the call chain are recorded and their return addresses
named; telescope.backtrace walks them from the recording and ztrace show
prints them. Process.read no longer panics on address 0.
</content>
</entry>
<entry>
<title>context: disassembly, telescopes and names in every stop; strings as one table</title>
<updated>2026-11-10T17:12:08Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-10T16:36:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/computeranim.git/commit/?id=02aa51a6f54235cf18e627dbbfe21f21e502eb0b'/>
<id>urn:sha1:02aa51a6f54235cf18e627dbbfe21f21e502eb0b</id>
<content type='text'>
For a viewer to show what pwndbg's context shows, the debugger records it
while the memory is there: each register and the top of the stack followed
as pointers three deep (--telescope), every code address met named, eight
instructions from the pc disassembled by capstone (built from source for
x86, into the command only; pinned as in 03-codenomicom). zt.telescope
reads a chain back with the kind of memory each link points into, and
ztrace show prints the context, coloured on a terminal as pwndbg colours.

The thirty thousand strings of a small run showed that a string map in
each keyframe costs 700 bytes of tree a string: strings are now one table
for the recording, appended a batch and read whole at open. fib(12) by
instruction with everything on: 9 MB, 71 000 moments/s.
</content>
</entry>
</feed>
