From 576a78b4de02c4c6566c327d85c465554d293975 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 12:49:15 -0300 Subject: design: the overflow as bytes; a minimap in each pane From the user. In the pair a frame is a dump of eight bytes a row read by its own fields, so each turn of the loop is one more letter and the letters are seen to cross from buf into the saved rbp and the return address, which reads as code until they reach it. Each pane with more than it shows carries its own minimap, a strip of its column of the map at four units a row with the pane's window outlined and what happens off the window marked there; the corner minimap is gone, and in the dive each column of the map folds into its pane's strip. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- design/README.md | 226 ++- design/mock/09-context-480.png | Bin 36033 -> 36283 bytes design/mock/09-context.png | Bin 232320 -> 224163 bytes design/mock/09-context.svg | 2600 ++++++++++++++------------------- design/mock/10-context-step-480.png | Bin 36917 -> 37286 bytes design/mock/10-context-step.png | Bin 236387 -> 228491 bytes design/mock/10-context-step.svg | 2608 ++++++++++++++------------------- design/mock/11-context-lens-480.png | Bin 36603 -> 37128 bytes design/mock/11-context-lens.png | Bin 225200 -> 217422 bytes design/mock/11-context-lens.svg | 2485 ++++++++++++------------------- design/mock/20-dive.png | Bin 1321188 -> 1665696 bytes design/mock/21-loupe-480.png | Bin 38102 -> 38344 bytes design/mock/21-loupe.png | Bin 243789 -> 235323 bytes design/mock/21-loupe.svg | 2753 ++++++++++++++--------------------- design/mock/26-pair-rest-480.png | Bin 30674 -> 33643 bytes design/mock/26-pair-rest.png | Bin 208546 -> 215411 bytes design/mock/26-pair-rest.svg | 447 ++++-- design/mock/27-pair-store-480.png | Bin 21819 -> 25106 bytes design/mock/27-pair-store.png | Bin 154167 -> 171996 bytes design/mock/27-pair-store.svg | 67 + design/mock/28-pair-part-480.png | Bin 32174 -> 34966 bytes design/mock/28-pair-part.png | Bin 214064 -> 220279 bytes design/mock/28-pair-part.svg | 451 ++++-- design/mock/38-pair-ret-480.png | Bin 0 -> 36174 bytes design/mock/38-pair-ret.png | Bin 0 -> 219525 bytes design/mock/38-pair-ret.svg | 509 +++++++ design/mock/39-minimap-1to1.png | Bin 0 -> 53199 bytes design/mock/context.py | 7 +- design/mock/map.py | 184 ++- design/mock/pair.py | 311 +++- design/motion.md | 106 +- 31 files changed, 5992 insertions(+), 6762 deletions(-) create mode 100644 design/mock/38-pair-ret-480.png create mode 100644 design/mock/38-pair-ret.png create mode 100644 design/mock/38-pair-ret.svg create mode 100644 design/mock/39-minimap-1to1.png diff --git a/design/README.md b/design/README.md index 86a217e..3ac5fb6 100644 --- a/design/README.md +++ b/design/README.md @@ -11,7 +11,7 @@ scene that draws every block in every state is the test of this page. - The numbers are tokens in `anim/src/theme.zig`: [what to change there](#token-changes). -![the working frame, mid-step, its minimap in the corner](mock/10-context-step.png) +![the working frame, mid-step, each pane with its minimap](mock/10-context-step.png) ## The rules @@ -76,7 +76,7 @@ this table. | | [`source`](#source) | a window on the file | 14, 8 or 10 lines | | | [`disasm`](#disasm) | the instructions round the pc | 17 or 9 rows; a [`descent`](#descent): a window a call deep, the kernel at the floor; a [`graph`](#graph): the function's blocks | | | [`lens`](#lenses) | a drawing of some state over the program's two columns, and in the third the pane it is a view of | `beside`, `subject` | -| | [`hexdump`](#hexdump) | memory, a `bytes` row a line | typed or by `fields`; `more` rows; `seen`; `given`; `memory` | +| | [`hexdump`](#hexdump) | memory, a `bytes` row a line | typed or by `fields`; `eight` (a stack frame, a word a row); `more` rows; `seen`; `given`; `memory` | | | [`loupe`](#loupe) | the memory round a pointer's target, floating over the context | two at most, in depth | | | [`nodes`](#nodes) [`array`](#array) [`calls`](#calls) [`syscalls`](#syscalls) [`blocks`](#graph) `pages` | the drawings a lens can hold | `nodes` in two rows, a `bin` heading the second | | 4 tie | [`thread`](#4-ties) | the current line is these instructions | standing | @@ -86,9 +86,9 @@ this table. | 5 frame | [`stage`](#5-the-frame) | the working frame: the band and the two columns | split `none`, `beside`, `subject` | | | [`segments`](#segments) | the process's address space to scale, each end enlarged, its bands' addresses at their edges | treatments A (default), B, C; the ink's source: a band framed when a word is inked; a dump's place | | | [`aligned`](#aligned) | the source and its instructions in one panel, each line level with its code | `interleaved`, `columns`; a split a scene chooses | -| | [`pair`](#pair) | two runs of one program against each other, a seam between them | `only here`, `differs`; the shadow on an ASan run's stack | +| | [`pair`](#pair) | two runs of one program against each other, a seam between them | `only here`, `differs`; each run's frame as bytes, an ASan run's shadow beside its rows | | | [`map`](#the-map-and-the-minimap) | the working frame unfolded, every panel whole: 3840 by 2160 | the key | -| | [`minimap`](#the-map-and-the-minimap) | the map at a twentieth, in the working frame's corner | windows, marks, `flash` | +| | [`minimap`](#the-map-and-the-minimap) | a pane's whole column of the map, small, in a strip at its right | its window, marks, `flash` | | | [`clock`](#clock-and-caption) | where in the recording | | | | [`caption`](#clock-and-caption) | the narrator | | | | [`veil`](#clock-and-caption) | page over what a beat does not touch, or a pace cannot show | | @@ -110,9 +110,9 @@ master is two pixels a unit. It is where a scene is told, and everything in it reads at 1080p. **The map** is 3840 by 2160 units at the same type size: the working frame unfolded, every panel at its full length. It is shown filling the frame (at half its size, so at 1080p its text is -texture), and small in the corner of the working frame as the -[`minimap`](#the-map-and-the-minimap). The working frame's panels are -windows onto the map's columns. +texture), and a column at a time, small, in a strip inside each pane of the +working frame as its [`minimap`](#the-map-and-the-minimap). The working +frame's panels are windows onto the map's columns. | Token | Value | | --- | --- | @@ -457,7 +457,7 @@ An instruction, pwndbg's way: what it is, and what its operands are now. | 134 | line | the source line this run of instructions came from, ranged right in three characters, faint; on the first row of each run only; gold and bold for the current line. Wide numbers (see [`line`](#line)) widen it, and every column right of it moves by the extra: mnemonic, operands and annotation, the row's room 12 characters less for six digits | | 180 | mnemonic | keyword, bold; `nop` and `endbr64` faint, with their operands: padding, which touches nothing | | 264 | operands | as the disassembler writes them, whole, less the size words (`qword ptr `): a [`width`](#width) after the bracket where no register says the size. A jump's or call's target is an `address` in code ink; a PLT stub's, named by the stub: `401070 open@plt` | -| 564 | annotation | from 564, or a character after operands that run past it; a chain, cut at its far end by the chain's rule | +| 564 | annotation | from 564 (540 in a pane with a [minimap](#the-map-and-the-minimap), whose strip takes 48 of the row), or a character after operands that run past it; a chain, cut at its far end by the chain's rule | **Wide addresses.** An address of more than seven digits (a library's twelve, `7ffff7d10fc5`) moves every column right of it by the extra, 12 a @@ -470,7 +470,7 @@ edge. Operands are never cut where the row has room, and never inside `[]`: we do not hide what the instruction says. When the operands and the whole annotation do not fit, in this order: -1. the annotation moves left to where it just fits, never left of 564; +1. the annotation moves left to where it just fits, never left of 564 (540 beside a minimap); 2. the operands give way to the annotation: they end where it begins, in a faint `…`. A cut that would fall inside `[]` falls before the `[`, and the annotation's first hop is the address the brackets named. @@ -625,7 +625,7 @@ since every pointer's reading names its target. but not shown: in the step that writes or reads it, a stub along its lane to the panel's rule, head on the rule; otherwise nothing. No count, unlike a link's stub: the lane has no room for one, the reading names the -address, and the minimap shows where. +address, and the panel's minimap shows where. **Which form carries a pointer**, when more than one could: @@ -852,9 +852,10 @@ the run will reach but has not yet. the lanes. A descent on the map stacks graphs: a caller folded to the block that holds its waiting call and one block either side, the callee's graph whole under it, the kernel's window under that. -- **The minimap** shows it at a twentieth: block outlines, row strokes, - edges 1 px, the pc's block gold. A sprint on the map reads there as the - gold going from block to block. +- **The disassembly's minimap** stays the linear column, each block's + first row ticked at its left (2, `rule`), the pc's row gold. A sprint + on the map reads on the map itself as the gold going from block to + block. - **The working frame** keeps the linear rows (rule 6) and shows their blocks: a 2-unit `rule` across over each block's first row, and the block's visits ranged right in that row's annotation room (`×11`, @@ -974,6 +975,38 @@ Its runs come one of two ways. program's memory is drawn when the debug info does not type it, or the meaning is the file's and not the C's (an SQLite page). +**`eight`: a stack frame as bytes.** Where what a step does to the stack +is a byte at a time (a loop storing into a buffer, a `strcpy`, an +overflow), the words of the [`stack`](#stack) panel hide it: a word going +`41`, `4141`, `414141` says neither that a letter was written nor where +one field ends and the next begins. The frame is then a hexdump by +`fields`, eight bytes a row, so that a row is one word of the stack: + +| x | Column | | +| --- | --- | --- | +| 12 | pins | rsp's and rbp's `row` pins on their rows, as the stack's | +| 62 | shadow | in a run built with ASan, the row's shadow byte, as on a [`slot`](#slot) | +| 118 | address | in its region's ink, `lead`. No offset from rsp: the reading needs the room, and the pins say where rsp is | +| 274 | eight `byte`s | on a pitch of 30, each field's on its paper (`raised`), what no field covers `loose`. A field's run never crosses a row, so a boundary between fields is a row's edge or a gap in the paper | +| 522 | reading | the field's name in Go 18 `dim` (`buf[0..7]`, `i`, `saved rbp`, `return`), then what its type makes of its bytes: a buffer's text in quotes in a string's ink, a count in decimal, a pointer as `points` and its address and name. A pointer that is no longer an address reads as the number it is, `0x4141414141414141`, with no arrow and no name. A string too long for the row is cut at the frame's span with a faint `…` | +| 866 | span | the frame's [`call`](#call) span, as the stack's, its name on a row whose reading is short | + +The fields are the frame's own, from the debug info and the call frame +information: its locals, the saved registers, the return address; in an +ASan run's fake frame its header (`magic`, `descr`, `pc`, `real stack`), +the buffer and the redzones. **A byte stored past the field the store +aimed at keeps that field's ink**: the letters a loop writes into `buf` +are in a string's ink in `buf`, and stay in it when they land in the +saved rbp and the return address, whose readings say what the CPU will +make of them (`→ 7fffffffed41`, then `→ 401141 fill+1`, then `0x41414141`). +So each turn is one more byte and one more letter, and the moment the +letters cross from one field into the next is a row's edge being crossed. +The store's byte is struck as in `bytes` (one byte, never the word). + +It is the stack panel's other form, a scene's choice: the default +everywhere is the words with their chains; `eight` where the narration is +about bytes. A pair puts it in each column (mocks 26 to 28 and 38). + **`more`.** Rows that hold no field (a dump by `fields`), or a gap in the addresses (a typed one), are one row: at the address column, `more`'s arrow and three dots, then the count of rows it stands for in faint mono @@ -1124,8 +1157,8 @@ stem down the gutter's right lane (x 962) from the foot of its row to the tag. Where the step changes a word of the stack under it, it does not open in that step. On the map it is a panel of its own beside the memory it shows (the map has room), and on -the minimap a lifted box there, its target's row outlined in its region's -ink. +the working frame it has no minimap of its own: the pane it lies over keeps +its strip, covered where the loupe covers it. **How many.** Two at most. A third, followed from the second, closes the first as it opens, so a chain of any length is walked two loupes at a @@ -1213,11 +1246,11 @@ The working frame: where a scene is told. | margin | 0 to 48 | page | | stage | 48 to 888 | 840: the lens band and the two columns | | clock | 898 to 902 | | -| caption | 912 to 1032; the minimap at its right end, 1664 to 1856 by 912 to 1020 | | +| caption | 912 to 1032; the clock's count ranged right at 1856 | | | margin | 1032 to 1080 | page | -No data below 888 but the minimap, which the narration never depends on: -a player's controls may cover its foot. +No data below 888: the caption and the clock's count, which a player's +controls may cover the foot of, and which the narration says again. **The program column** (left): source over disassembly: what was written, what runs. **The state column** (right): registers over stack: what they @@ -1232,7 +1265,7 @@ thing about the layout a scene chooses. | `subject` | 296, 48 to 344 | 200, 48 to 248: 7 rows | 10 lines, 356 to 628 | 9, 640 to 888 | 260 to 700 | 6, 712 to 888 | in the stack; the view of `calls` | Each panel is a window onto a column of the [map](#the-map-and-the-minimap), -and the minimap shows where. **What gave** for seventeen instructions: a +and its minimap shows where. **What gave** for seventeen instructions: a lens, the whole of a function and seventeen instructions do not fit one column of 840. So the lens left the program column for a band of its own; the backtrace became spans on the stack; the flags moved into rip's row; @@ -1241,13 +1274,13 @@ eight lines. As the subject the drawing takes eight rows from the disassembly, the source gets two back, and the view stops two rows short of the drawing so that the stack keeps six slots. With a lens open the source is a window of eight or ten lines on the file: the map holds the -rest, and the minimap shows it. +rest, and the source's minimap shows it. | Of the frame | `none` | `beside` | `subject` | | --- | --- | --- | --- | | context | 68% | 56% | 48% | | lens band (the drawing and its view) | | 13% | 21% | -| caption band, with the minimap | 10% | 10% | 10% | +| caption band | 10% | 10% | 10% | ### Direction and nearness @@ -1405,13 +1438,13 @@ once, the ones that differ twice, one on each side of a seam. | --- | --- | | the seam | the gutter between the columns (944 to 976): the left column is one run, the right the other, each panel's tag naming its run (`plain · disassembly`, `asan · disassembly`). Down is still deeper in each; across the seam is the other run | | the source | shared when both runs are the same file: one panel across both columns, 1792 wide, five lines (48 to 200). Each run's current line is marked on its own side of it: the left run's gold plaque on the number at the left, the right run's ranged right at the panel's right edge, the wash across the row once when both are on it. Two files: two panels, as below | -| each column | its run's context cut to what the scene's line touches: its disassembly, nine rows (212 to 460); the registers the line reads or writes and rip, rsp, rbp, four rows (472 to 600); the stack frame from rsp to the return address, ten rows (612 to 884). A run built with ASan adds the shadow to its stack's rows ([`slot`](#slot)) | -| alignment | the two disassemblies are scrolled so that the current line's first row is at one height on both; below it each runs on. The two stacks are scrolled so that the same variable's first row (`buf`) is at one height. Corresponding things face each other across the seam | +| each column | its run's context cut to what the scene's line touches: its disassembly, nine rows (212 to 460); the registers the line reads or writes and rip, rsp, rbp, four rows (472 to 600); the frame, ten rows (612 to 884): the stack panel's words, or, where the scene's stores are bytes (an overflow), the frame as bytes ([`hexdump`](#hexdump) `eight`). A run built with ASan adds the shadow to its frame's rows. A dump of ten rows is the stack panel's height, so the four registers and the nine instructions keep their places and nothing gives | +| alignment | the two disassemblies are scrolled so that the current line's first row is at one height on both; below it each runs on. The two frames are scrolled so that the same variable's first row (`buf`) is at one height: then what lies past it faces what lies past it (plain's saved rbp and return address, ASan's redzone). Rows the alignment shows that hold no field are loose bytes. Corresponding things face each other across the seam | | only here | a row one run has and the other has not (the instrumentation; a function only one build calls): a 4-unit `dim` bar on its seam-side edge. Its counterpart is the page facing it, or nothing | | differs | a value that differs from its counterpart at the same step (the saved rbp kept on one side and overwritten on the other): a 4-unit `bright` bar on its seam-side edge, on both sides. It is the difference across runs; a strike is a change in time, and both can stand together | | the clock | one rule, counting the pair's steps; under it, ranged right, each run's moment: `plain moment 61 · asan moment 412` | | the caption | one, for the pair: it narrates the difference | -| the minimap | both runs' maps at a fortieth, side by side in its box (96 by 54 each), each with its windows. The map itself is one run's at a time: a `surface` goes to the side in focus | +| the minimaps | each pane's own, as anywhere, its run's column; the shared source's at its right end. The map is one run's at a time: a `surface` goes to the side in focus | **Keeping the two in step.** A pair's step is one source line in both runs, or one turn of a loop when the narration says so: the unit both @@ -1433,10 +1466,12 @@ struck. A run that writes to stderr (ASan's report) shows it in its own column, in place of its registers and its disassembly's lower rows once it has -stopped: a panel of the run's output, its lines as written, the ones the -narration names framed. +stopped: a panel of the run's output, its lines as written and cut at its +edge with `…`, the words the narration names framed bright (mock 38). Its +disassembly keeps the rows down to the call that stopped it, which reads +`never returned`; its frame keeps its last picture. -Mocks 26 to 28; [the scene](motion.md#a-scene-asan-against-a-plain-build). +Mocks 26 to 28 and 38; [the scene](motion.md#a-scene-asan-against-a-plain-build). ### The map and the minimap @@ -1485,34 +1520,81 @@ lens's drawing, and the loupes open. it there, and the map is never on screen for reading at 1080p: it is for where, not for what. -**The minimap** is the map at a twentieth, 192 by 108, in the working -frame's corner: the caption band's right end, 1664 to 1856 across and 912 -to 1020 down, under the clock's right end. The caption keeps its 1400 (it -ends at 1464); the clock's count moves left of the minimap, ranged right -at 1648. +**The minimap** is a pane's own: its whole column of the map, small, in a +strip inside its frame at its right, the way a code editor shows a file +beside its text. Every pane that shows less than its column has one: the +source, the disassembly, the stack, a dump (the band's view, a hexdump +panel), a backtrace longer than twice its window. The registers show all +their rows and have none; a lens's drawing is whole and has none; a loupe +has none (it is held over the frame for a step or two, and its tag says +what it is). | Part | Drawn | | --- | --- | -| ground | the page, framed 1 in `rule` | -| panels | each map panel's outline, 1 in `rule`; a lens's drawing a `raised` block; a loupe a `lift` block | -| rows | each row of text a stroke 1 high, from where its text starts as long as it is (a twentieth of its characters' width), in its dominant ink at 45% toward the page: the file's shape, the stack's chains, a dump's bytes | -| windows | each working panel's window, 1 in primary, the panel in focus 2 | -| marks | the current row a gold stroke across its column, 2 high; a strike a vermilion block 3 by 3 at the row's start; a read a 3 by 3 frame in read's colour; held a vermilion pixel; the thread a gold stroke across the gutter | - -A mark outside every window is on the minimap and nowhere else: when the -step strikes a word the stack's window does not show, its block on the -minimap strikes with it, and `flash`es (a ring 8 across drawing out to -14 and gone, 12 f) so the eye goes there once. That is how nothing is -hidden at the working frame's size: it is only small. The minimap is -secondary action: every change on it starts 6 f after the primary onset -it follows, never on that frame; it fades and never travels, except its -windows, which glide with their scrolls. +| strip | 40 wide, inside the pane's frame at its right, 2 in from the rule, over its body (under the tag), on `well` (`101a48`). The pane's content keeps 8 from it: a pane with a strip has 832 for its content, the frame and tag still 880 | +| scale | fixed: a row of the map is 4 units (a stroke 3 high, 1 between), a row's 880 units 36 (a character two thirds of a unit). A column that fits is drawn whole from the strip's top; a longer one shows the rows round the pane's window, the window in the strip's middle and the strip clamped to the column's ends, with three faint dots at an end where it goes on, and it scrolls with the pane | +| rows | each run of text a stroke from where it starts, as long as it is, in its ink 65% of the way from the page: the file's indents and lengths; the disassembly's address, mnemonic, operands and a call's name; the stack's chains in their inks; a dump's bytes and readings. No text: at 4 units a row none could be read | +| window | the rows the pane shows, framed 2 in primary across the strip: the brightest thing in it | +| marks | at the row's left, 4 by 4, in this order: the current row gold (the pc's in the disassembly, the line's in the source), a strike vermilion, a read in read's colour; held a vermilion 2 by 2. An `arc` with an end off the window: a 2-unit line in its ink down the strip's left edge between its two rows. A block's first row (a graph's, shown linear): a 2-unit `rule` tick at the strip's left | + +It says where the window is in the whole (the line in the file, the +function among its neighbours, the frame in the stack, the node's row in +the heap), and what happens outside the window. A mark outside the window +is on the minimap and nowhere else: when the step strikes a word the +stack's window does not show, its row on the minimap strikes with it and +`flash`es so the eye goes there once. That is how nothing is hidden at the +working frame's size: it is only small. The minimap is secondary action: +every change on it starts 6 f after the primary onset it follows, never on +that frame. Its window glides with the pane's `scroll`. A far jump in the +same column (a `continue` to another loop, a return to a caller in view) +shows there first: the mark's new row lights gold on the strip and the +window glides to it (24 f, `glide`) before the pane fades through (12 out, +12 in); a jump out of the column (another function, another file) fades +the strip through with the pane. + +**What it costs**, measured on the rows the videos draw: 48 units of each +pane's width. The source's lines are cut four characters sooner (at 63 in +place of 67). The disassembly's annotation starts at 540 in place of 564, +so its room loses 24, not 48: `1004098 → 1004070 ← 9` stays whole, and +operands longer than 23 characters push it right as before. The stack's +roles and spans move 48 left and its chains end 48 sooner (one hop fewer, +then `more`, where a chain was long: `sqlite3VdbeExec+189…` is cut four +characters sooner). A dump's reading is cut 48 sooner, its pins 48 to the +left (`malloc's: a chunk of 32` still whole). The registers lose nothing, +and the registers carry the longest chains. + +**In the other forms.** + +- A [`descent`](#descent): one strip for the panel, the column of the + deepest window's function (the pc's), its window framed; the callers' + windows are other functions and not in it. A `descend` or `ascend` + fades the strip through (12 f) as the new window opens. +- The [`graph`](#graph) and the `blocks` lens: the lens's drawing is whole + and has none; its view, the disassembly round the pc, has the linear + column's strip with each block's first row ticked. The graph itself is + on the map, which is its own whole. +- [`aligned`](#aligned): one strip at the right of its 1792 panel, the + listing's whole column, a row of the listing a row of the strip; in + `columns` a row's two cells side by side, at the one scale. +- A [`pair`](#pair): each column's panes their own strips, and the shared + source its one. +- A [`loupe`](#loupe): none of its own; the pane it lies over keeps its + strip, covered where the loupe covers it. + +**The corner minimap is gone.** The working frame carried the whole map at +a twentieth in the caption band's corner (192 by 108): a column was 44 +units wide there and a row 1.2, and nothing in it could be told apart. +The map stays the picture of everything at once (a scene's opening, a +sprint, a far `continue`); in the working frame each pane carries its own +column at a size that reads, beside the rows it is the whole of, and the +`dive` makes each column into its pane's strip. The caption band is the +caption's and the clock's. ### clock and caption - **`clock`**: a 2-unit rule the width of the stage at y 900; gold, 4 high, along it as far as the recording has run; `moment 72 of 95` in - mono 20, faint, ranged right at 1648, left of the minimap. It says where the recording is, so + mono 20, faint, ranged right at 1856. It says where the recording is, so at a walk and a run it is still while a step plays: when the step's mark has landed, the step's piece of gold fades in (12 f; 8 f at a run) and the count changes as the fade starts. At a sprint the gold grows @@ -1561,9 +1643,9 @@ Frames at 60 a second. `s` is the frame a strike lands. Curves: | `travel` | a value, a card or a pin going from one place to another | `glide`. A value or card: 30 f to 200 units, 36 f to 400, 48 f beyond. A pin goes along its lane, 18 f after the strike that moved it: in a drawing 30 f to the next node or cell, 36 f to one farther; in the stack's lane 24 f to the next row and 2 f a further row, 36 f at most. A pin that comes fades in over 12 f rising 8 units; one that goes fades out over 12 f; a name joining or leaving a pin cross-fades over 12 f. On a `link` the pin rides the line's head instead. 8 f at a run; at a sprint only at a phrase's end | | `open` | a loupe, from a pointer | the pointer's hop framed `read` (6 f); the stem draws from it to the loupe's place, head first, 18 f (30 f over 600 units), `standard`; the loupe rises with the stem's head: it fades in over 12 f from 8 units lower, its shadow growing from nothing to its offset (18 f, `standard`); the target's bright frame lands 6 f after. From a pointer inside a loupe the same, over it, and a third closes the first as it starts. In the slot of the level that read the pointer, or on a beat the caption names | | `close` | a loupe | the deepest first: its stem draws back into its pointer (12 f) and the loupe sinks, fading out over 12 f as it falls 8 units and its shadow shrinks; with the advance of the step it opened in. A loupe the narration keeps across steps closes at each advance and opens again in the idea's slot of the next step that concerns it (36 f, as `open`): the steps between are not drawn under it. Open 120 f without a change is the most | -| `dive` | from the map to the working frame | one continuous move in which the windows become the panels and the map becomes the minimap. 0 to 6: the windows' outlines go bright. 6 to 24: the rest of the map takes the veil (50%). 24 to 96, `glide`: each window goes from its place on the map to its panel's place, its scale on a logarithm from the map's (half, filling the frame) to the frame's (whole), so its rows grow from 10 units to 20 under the eye, the panels 6 f apart in the frame's reading order (drawing, view, source, registers, disassembly, stack), each drawn over those before; the map, veiled, goes the same 72 f to the minimap's rect (1664, 912, 192 by 108), continuously, its scale from a half to a twentieth on its logarithm, so the windows rise out of it as it falls away; it is never dropped or hidden on the way; their outlines stay on it and land as the minimap's windows; as it lands (90 to 96) it crossfades into the minimap's own drawing. 72 to 96: the drawing, whose sizes differ between the two, crossfades from the map's to the frame's within its box. 84 to 96: the frame's tags, rules and lanes fade in; the veil on the map lifts as it lands. 96 to 132: still | -| `surface` | from the working frame to the map | the dive backwards, a little quicker: 0 to 12 the tags, rules and lanes fade out; 12 to 84, `glide`, the panels shrink into their windows as the minimap grows to fill the frame; 84 to 96 its veil lifts; then the map is still 36 f before anything plays on it | -| `flash` | the minimap, at a mark no window shows | a ring 8 across in the mark's colour draws out to 14 and is gone, 12 f, with the mark's own strike or read | +| `dive` | from the map to the working frame | one continuous move in which the windows become the panels and each pane's column of the map becomes its minimap. 0 to 6: the windows' outlines go bright. 6 to 24: the rest of the map takes the veil (50%). 24 to 96, `glide`: each window goes from its place on the map to its panel's place, its scale on a logarithm from the map's (half, filling the frame) to the frame's (whole), so its rows grow from 10 units to 20 under the eye, the panels 6 f apart in the frame's reading order (drawing, view, source, registers, disassembly, stack), each drawn over those before; on the same move the rest of each window's column (the map's panel it is a window on) squeezes into its pane's strip: from its place at half size to the strip's rect, its width and its height each on its logarithm (to 36 of 880, and 4 of 24 a row), so the text thins to strokes as it lands, the window's outline riding on it to become the strip's window; the map's parts no pane takes (the backtrace, the key, the memory round pointers, a loupe's panel) fade where they are, 24 to 72. 72 to 96: the drawing, whose sizes differ between the two, crossfades from the map's to the frame's within its box. 84 to 96: each squeezed column crossfades into its strip's strokes; the frame's tags, rules and lanes fade in; the veil goes with the last of the map. 96 to 132: still (mock 20) | +| `surface` | from the working frame to the map | the dive backwards, a little quicker: 0 to 12 the tags, rules and lanes fade out and each strip's strokes become its column's text; 12 to 84, `glide`, each pane shrinks into its window on the map as its strip unfolds into the column round it, the map's other parts fading in where they are; 84 to 96 the veil lifts; then the map is still 36 f before anything plays on it | +| `flash` | a pane's minimap, at a mark its window does not show | a ring 8 across in the mark's colour, on the mark's row in the strip, draws out to 14 and is gone, 12 f, with the mark's own strike or read | | `descend` | a call the narration follows down | 0 to 12 fire on the call row; rsp struck (24); the stack slides and the return address is struck (30 to 60), as for any call; then the caller's window closes round its call row, in two moves and never both at once: 66 to 78 the rows it gives up fade (those after its return row, and from its top as many as the callee needs), then 78 to 96 the rows it keeps glide up to their places (`glide`), where they move at all; 84 to 96 the call row's plaque becomes the ring; 96 to 114 the call lane draws down from the ring, head first, `standard`; 108 to 120 the callee's head fades in rising 8 as the lane reaches it; 114 to 138 its rows, top down, 2 f apart, 12 f each; 138 to 150 the advance: the plaque lands on the callee's first row, and the source line goes `waiting` (6 f) where the callee has none. Through a stub's `jmp`: the stub's other rows fade (12 f), then its `jmp` row, `pass`, glides to its place (18 f, `glide`), the lane runs on to the next head (18 f), the next window comes in the same way. A label that changes with it (the stack span's name, the source's tag) crossfades, 12 f | | `cross` | a `syscall` row, in a descent | 0 to 12 fire; 18 to 36 the registers that carry the call framed as read, 6 f apart, the argument rows under the row with them (`echo`); 48 to 72 the crossing lane draws down, 3 units, vellum; 66 to 78 the kernel's window opens as it lands, the vellum filling down from the lane's head; 78 to 90 its head and the call fade in, 6 f apart; the work (bytes given or filled, motion.md's chart); `returns` struck; then the answer climbs the lane (24 f) and rax is struck as it lands, the clobbered registers 6 f apart after it, the log's new row fading in (secondary); hold 36; the advance: the kernel's window draws back up into the lane (12 f) and the lane into the plaque (12 f) as the plaque moves on | | `ascend` | a `ret` out of a descent's window | 0 to 12 fire; 18 to 24 the return address framed as read on the stack; rsp struck (36); 48 to 72 the window closes, its rows fading bottom up, 2 f apart, 12 f each, its head last; 72 to 84 the lane draws back up into the ring; the caller's window opens in the reverse order of its closing: 84 to 102 the rows it kept glide back down (`glide`), then 102 to 114 the rows it gave up fade in; 114 to 126 the ring becomes a trail bar, the call row's annotation takes the result (6 f), and the plaque lands on the row after the call; the source line from `waiting` to `current` | @@ -1582,9 +1664,9 @@ Frames at 60 a second. `s` is the frame a strike lands. Curves: | `cascade` | a step | `fire` (12); then its effects a level at a time, 18 f apart: CPU (`reg`s, the pc's annotation), memory (`slot`s, `bytes`), the idea (the drawing, by `project`); each armed, then struck; hold 36 f after the last strike and 12 f a further value, 84 at most; `advance`; rest 24 f. A level with nothing on screen to change gives up its slot | | `continue` | a stop far from the last: a breakpoint, not a step. Where the windows' new places are farther than their own heights (another function, another file), it is told on the map: `surface`, the jump there, `dive` | `fire` on the line it leaves from; then the levels as in a `cascade`, but CPU is a wave: every register that changed is struck 2 f after the one above it, in pwndbg's order, the fill in over 6 f, no arm and no pulse (a dozen pulses at once are a flash, and a dozen arms a crowd); memory: the stack's window scrolls or fades to its new place, and the [backtrace](#backtrace)'s frames leave, slide and arrive; the idea; hold 36 f after the last strike; `advance`, the source and disassembly fading through if far; rest. Its marks are only on what was on screen to change | | `run` | steps that need not be read | over a graph, the mark goes from block to block in 8 f, each edge taken flashes to gold and cools in 8 f, counts change in place; at a sprint (on the map) the gold moves only when the block changes, 4 f at most each, the trail's three edges following and the lanes' counts ticking, and the picture settles at the phrase's end. Elsewhere: 18 f a step; no fire, arm or pulse; the mark, cards, nodes and pins ease in 8 f; no strikes, no held corners and no arcs drawing: a value changes in place under an 8 f crossfade, unmarked, and what the run changed is shown settled when it ends (its arcs fade in, 8 f, standing; no corners); no ties but the thread. A caption never names what a run veils. Registers, stack and disassembly are veiled from the first shortened step to the last; the source, the band and the clock are not. 24 steps at most. A run longer than a phrase may `surface` and play on the map | -| `sprint` | steps to be got through | 4 f a step. The drawing grows and the clock sweeps; the source and the band's view are veiled as well; the mark and the pins move only at a phrase's end. Each change of pace ramps at 0.6 of the step before. A sprint plays on the map: `surface` before it, `dive` after it, at the stop it reaches; the windows glide with the pc, the minimap's marks flash and fade | +| `sprint` | steps to be got through | 4 f a step. The drawing grows and the clock sweeps; the source and the band's view are veiled as well; the mark and the pins move only at a phrase's end. Each change of pace ramps at 0.6 of the step before. A sprint plays on the map: `surface` before it, `dive` after it, at the stop it reaches; the windows glide with the pc, the marks flash and fade | | `establish` | a scene's opening | done by 54 f: the panels fade in, 18 f each, 6 f apart (registers, stack, source, disassembly, the band's view, the drawing's panel: 0 to 48); from 30 f the drawing's elements fade in rising 8 units, 12 f each, 2 f apart in address order and all begun by 42 f, each with its row's quiet bracket (an `echo`: no lines). The first caption arrives at 60 f | -| `scroll` | a `source`, `disasm` or `stack` window | whole rows, 24 f, `glide`, before the level it makes room for; marks ride with their rows; the window's outline on the minimap glides with it, the same 24 f. A column's `lead` and the line numbers are the rows' on screen: they change on the scroll's first frame, never before. A window going farther than its own height (ten lines, nine instructions, six slots) does not scroll, which would only blur: it fades out (12 f) and in at its new place (12 f), and what it brings comes in with no marks | +| `scroll` | a `source`, `disasm` or `stack` window | whole rows, 24 f, `glide`, before the level it makes room for; marks ride with their rows; the window on the pane's minimap glides with it, the same 24 f (a window fading through moves on its minimap with the fade's out, so the strip shows where it went first). A column's `lead` and the line numbers are the rows' on screen: they change on the scroll's first frame, never before. A window going farther than its own height (ten lines, nine instructions, six slots) does not scroll, which would only blur: it fades out (12 f) and in at its new place (12 f), and what it brings comes in with no marks | | `relayout` | a change of split | the drawing fades out (12 f); every panel moves to its new box, clipped to the box as it moves (48 f, `glide`); the drawing fades in at its new size (12 f). Nothing else moves under it | | `visit` | the camera | the target framed first (24 f), the rest veiled (18 f); the move 72 f, `glide`. The panel's tag and whole rows in frame, the rows the visit's steps change in its middle third, never at its edge; a stack visited holds its window still. A visit never veils or clears a panel a drawn tie starts or ends in: it waits until the tie has drawn back, or frames both ends. 120 f at most without a change; back | | `say` | the caption | out 12 f, gap 6 f, in 18 f; the numbers are under [caption](#clock-and-caption) | @@ -1681,7 +1763,7 @@ python3 -B context.py && for n in 12-calls-subject 13-sqlite-row 14-sqlite-page; resvg 17-operands.svg 17-operands.png python3 -B heap.py && for n in 18-heap 18-heap-free; do resvg $n.svg $n.png && resvg -w 480 $n.svg $n-480.png; done python3 -B graph.py && for n in 22-graph-sort 23-graph-open 24-graph-strip 25-blocks-lens; do resvg $n.svg $n.png; done -python3 -B pair.py && for n in 26-pair-rest 27-pair-store 28-pair-part; do resvg $n.svg $n.png && resvg -w 480 $n.svg $n-480.png; done +python3 -B pair.py && for n in 26-pair-rest 27-pair-store 28-pair-part 38-pair-ret; do resvg $n.svg $n.png && resvg -w 480 $n.svg $n-480.png; done python3 -B intro.py && for n in 29-intro-bytes 30-intro-words 31-intro-stack 32-intro-code 33-aligned 34-segments \ 35-segments-abc 36-aligned-columns 37-regroup; do resvg $n.svg $n.png; done for n in 30-intro-words 34-segments 36-aligned-columns; do resvg -w 480 $n.svg $n-480.png; done @@ -1694,16 +1776,17 @@ python3 -B gen.py # 1 to 8, then resvg the same way | Mock | Is | Blocks it shows | | --- | --- | --- | -| [9](mock/09-context.png) | `beside`, at rest: `targets/list` stopped at the load in `reverse` (`mock/list-dbg.txt`, moment 2) | every panel; the band as two panels; `address` with `lead`; `chain` cut by `more`; `reg`, rip with flags; `slot` with offsets and roles, `pin` row; `call` spans; `insn` current, ahead, outside under a rule and its name; `line`; `bytes` by fields with number, pointer, loose; an `arc` standing in the view; `nodes` with pins under, two names on one; `thread`; marks current, held; the minimap, its windows | -| [10](mock/10-context-step.png) | the same, mid-step: the load done (moment 3) | `struck` on rdi; `read` on the annotation, the run and the node's half (`echo`); `link` ending in rdi's pin; `projection`; the read pointer's `arc` at full ink; the minimap | -| [11](mock/11-context-lens.png) | `subject`, mid-step | the band at 296 and 200, the drawing a size up, a dump of seven, nine instructions, six slots; the minimap with the subject's windows | +| [9](mock/09-context.png) | `beside`, at rest: `targets/list` stopped at the load in `reverse` (`mock/list-dbg.txt`, moment 2) | every panel; the band as two panels; `address` with `lead`; `chain` cut by `more`; `reg`, rip with flags; `slot` with offsets and roles, `pin` row; `call` spans; `insn` current, ahead, outside under a rule and its name; `line`; `bytes` by fields with number, pointer, loose; an `arc` standing in the view; `nodes` with pins under, two names on one; `thread`; marks current, held; each pane's minimap (source, disassembly, stack, the view), its window, the current row; the registers and the drawing without | +| [10](mock/10-context-step.png) | the same, mid-step: the load done (moment 3) | `struck` on rdi; `read` on the annotation, the run and the node's half (`echo`); `link` ending in rdi's pin; `projection`; the read pointer's `arc` at full ink; the minimaps: the pc gold and the read cyan on the disassembly's, the read row on the view's; the annotation at 540, whole | +| [11](mock/11-context-lens.png) | `subject`, mid-step | the band at 296 and 200, the drawing a size up, a dump of seven, nine instructions, six slots; the minimaps at the subject's window sizes, the disassembly's and the stack's scrolled round their windows | | [12](mock/12-calls-subject.png) | `calls` as subject, mid-step: moments 752 to 753 of the fib scene, `fib(4)` calling `fib(2)` | `calls`: nodes current, waiting, done, the caller, results on the shoulder; the `backtrace` as its view, with arguments, newest at the bottom beside the tree; `call` spans with arguments; the stack's row with offsets and a role; a `projection` from the return address to the new node; operands of 27 characters whole | | [13](mock/13-sqlite-row.png) | the `backtrace` lens, at rest after a `continue`: stop 120 of the sqlite scene, at `sqlite3BtreeInsert+4` | the backtrace as the band's drawing, `#0` at the bottom over its source line; a `hexdump` by `fields` of a struct on the stack: twelve-digit addresses, pointer fields and `NULL`, `loose` padding and the bytes past the struct, `pad`, two fields framed as the caption names them, the reading as a list; wide line numbers in the source and the disassembly; frame names whole, shortening the chains beside them; `held` on every register the continue changed, none on the stack's window, which faded in | | [14](mock/14-sqlite-page.png) | `syscalls` as subject, at rest after the crossing: stop 169, `pwrite64` back in `unixWrite` | the calls so far in the band, strace's way, the newest whole and held; the call through a pointer by its target's name, `→ __pwrite64`; a page by `fields` as the kernel took it (`given`): big-endian numbers, bytes left to the eye, text, a `more` row of 253; the stack's window scrolled into the frame (`rsp+20 to rsp+48`), its span open above; flags and registers the crossing changed | | [15](mock/15-marks.png) | the marks sheet: `current`, `struck`, `held` as A (the first videos), B (the catalogue's) and C (a whiter reading), on rows of the list at the load and the store after it | the source's current line; the pc's row; rip; a struck and two held registers; a dump row struck on the one byte that changed and one held; a lens's cell held and struck; the same rows at 1.35 times | | [19](mock/19-map.png) | the map, mid-step with a loupe open: the same moment unfolded on 3840 by 2160 ([at 1080p](mock/19-map-1080.png)) | the file whole; 69 instructions; memory, the registers, the backtrace whole; the stack from 16 words above rsp, continued at the third column's foot and folded into `more` at the process's start; the loupe as a panel beside memory; `arc`s in memory, the loupe and the stack (the frame chain left to the spans); the key; the thread across the gutter; the working frame's windows outlined | -| [20](mock/20-dive.png) | `dive`, four instants on one sheet, each at the working frame's size | frame 0 the map; 24 the windows bright, the rest veiled; 60 halfway, the panels rising out of the map as it falls to the corner; 96 the working frame with its minimap | -| [21](mock/21-loupe.png) | the working frame mid-step with a `loupe` open | the loupe hanging from rdi over the registers under it, its node framed, the chain 1004090 → 1004070 → 1004050 as `arc`s in one lane (the view withholds them while the loupe is open); the minimap with the loupe at its place on the map, outlined bright | +| [20](mock/20-dive.png) | `dive`, four instants on one sheet, each at the working frame's size | frame 0 the map; 24 the windows bright, the rest veiled; 60 halfway, the panels rising out of the map, each column squeezing toward its pane's strip, the rest fading where it is; 96 the working frame, each pane with its minimap | +| [21](mock/21-loupe.png) | the working frame mid-step with a `loupe` open | the loupe hanging from rdi over the registers under it, its node framed, the chain 1004090 → 1004070 → 1004050 as `arc`s in one lane (the view withholds them while the loupe is open); no minimap for the loupe: the panes' strips stand as in 10 | +| [39](mock/39-minimap-1to1.png) | three panes' minimaps cut from 10 at 1:1, a pixel of 1080p a unit | what a strip lets a viewer read at 1080p: the column's shape and inks, the window, the pc gold, a read cyan; the stack's 48 of 103 rows round its window | | [16](mock/16-descent.png) | the syscalls scene's `open` followed down, four instants of the program column (`ztrace dbg` on `anim/tools/hello.c`, moments 1 to 6) | `descent`: main's window, its spare rows above its call and one row after it, the PLT stub's head directly under that row (its neighbour `_start` `outside`), libc's `open`, the kernel's window on vellum; `insn` `waiting` and `pass`; the call lane and the crossing lane; `line` `waiting` and the waiting thread; a PLT target named, an indirect jump's target, a `lea`'s result, a named place (the canary), a system call's number and its arguments hanging under it; libc's twelve-digit addresses moving their own window's columns; the descent closed again, the call `ran` with its result | | [17](mock/17-operands.png) | operands before and after, on real rows of list, hello and libc's `open`; then the row's detail | size words gone; `width` on an immediate store, a byte compare, a sign-extending load; padding faint; a compare's two values and the flags it leaves; conditionals reading them; `lea`'s sum; an indirect jump through `open@got` | | [18](mock/18-heap.png) | the heap scene, five instants of the band: `ztrace dbg` on `mock/heap.c`, glibc 2.44, after each malloc and free (2 a run's end, settled, unmarked) | `nodes` in two rows, a `bin` heading the second (`dummy tcache` before the first free); a free chunk drawn `freed`, its link in its first word; `bytes` read as `size` (`0x20 a m P`) and `protected` (`→ 405050 ^ 405`), notes (`key`, `the old link`); the free list and the program's list as `arc`s; struck bytes, one byte of a pointer struck alone | @@ -1712,9 +1795,10 @@ python3 -B gen.py # 1 to 8, then resvg the same way | [23](mock/23-graph-open.png) | libc's `open` at its `syscall` (mock 16's moment 4): 19 blocks, the run's 8, the 11 never reached folded into five boxes by what they are | folds of unreached blocks, named; blocks the run will reach but has not yet, plain; twelve-digit heads, offsets in the rows | | [24](mock/24-graph-strip.png) | reverse's loop, four instants | `leave`: the condition's chips, the edge lit, the mark halfway along it; `turn`: the back edge climbing with the mark on it, its count struck; the way out | | [25](mock/25-blocks-lens.png) | sort at moment 370 in the working frame with the `blocks` lens | the graph as shapes in the band, the pc's box gold, the trail; its view the disassembly round the pc, out of the program column, which holds the source alone; registers and stack of the moment | -| [26](mock/26-pair-rest.png) | the `pair` at the loop, i = 15: plain and ASan builds of `overflow.c` | the shared source with each run's mark on its side; two disassemblies aligned by line, ASan's `only here` rows; the line's registers; plain's stack with the red zone's `buf` and `i`, ASan's fake frame with its shadow on each word's row, `buf` facing `buf`, the saved rbp facing the redzone (`differs`) | -| [27](mock/27-pair-store.png) | one turn of the loop, row by row: plain's eight instructions each facing its counterpart among ASan's seventeen | `only here` bars; the page facing the check; the check's values (`0 : 0 ZF`, `taken`); the partial check and the report's call faint, off the path at 00 | -| [28](mock/28-pair-part.png) | i = 16, the step in which they part | plain's store struck into the saved rbp's low byte; ASan's shadow load framed reading `f3`, its compare and the branch not taken; `differs` on the facing rows | +| [26](mock/26-pair-rest.png) | the `pair` at the loop, i = 15: plain and ASan builds of `overflow.c` | the shared source with each run's mark on its side; two disassemblies aligned by line, ASan's `only here` rows; the line's registers; each frame as bytes (`hexdump` `eight`): plain's `i`, `buf` (`41`s and their `"AAAAAAA"`), the saved rbp and the return address under the span; ASan's fake frame, its header's fields and shadow beside each row, the real stack's way back under a rule; `buf` facing `buf`, the saved rbp facing the redzone (`differs`) | +| [27](mock/27-pair-store.png) | one turn of the loop, row by row: plain's eight instructions each facing its counterpart among ASan's seventeen | `only here` bars; the page facing the check; the check's values (`0 : 0 ZF`, `taken`); the partial check and the report's call faint, off the path at 00; under each, its `buf` as bytes, the turn's one byte struck and the reading a letter longer, ASan's shadow framed as read | +| [28](mock/28-pair-part.png) | i = 16, the step in which they part | plain's store struck on the saved rbp's first byte, `41` among its stack-ink bytes, its reading `→ 7fffffffed41`; ASan's shadow load framed reading `f3`, its compare and the branch not taken, its redzone still `00`; `differs` on the facing rows | +| [38](mock/38-pair-ret.png) | i = 27, plain alone: the return address half overwritten | the saved rbp all letters, reading `0x4141414141414141`; the return address `41 41 41 41 00 00 00 00`, held on three bytes and struck on the fourth, reading `0x41414141`, no arrow, no name; ASan stopped: its disassembly down to `call __asan_report_store1`, `never returned`; its stderr panel, the report's lines cut at the edge, four framed; its frame's last picture | | [29](mock/29-intro-bytes.png) | the introduction's first picture, the camera at x2: 128 bytes of the stack, nothing else | a raw hexdump, before any ink | | [30](mock/30-intro-words.png) | the `ink` beat: the words, eight bytes a row, where the stack will be; the address space in the program column | `regroup` landed, each word ranged right; `segments` at 108 wide, no pins; a dump's place, the `link` standing; `ink`'s echo: the return address and list's code band, with its row | | [31](mock/31-intro-stack.png) | the same words as the stack panel, the registers built over it, at x1.25 | the stack's conventions: rsp and rbp pins, offsets, roles, spans | @@ -1763,7 +1847,9 @@ the band. band's view); two in the working frame; a third closing the first. - The minimaps of 12 to 18: their recordings hold a stack of 64 words or less and no bytes round targets, so their maps would be mostly gaps. -- `surface`, `flash`, a window's outline gliding on the minimap. +- `surface`, `flash`, a window gliding on its minimap, a far jump seen on a + strip before the pane fades through; an `arc`'s end on a strip; a + `descent`'s and `aligned`'s strips. - `enlarge` and a dump's place in motion (charts only); treatments B and C of `segments` at their own sizes (the sheet has them as frames); `align` between `interleaved` and `columns`; `columns` with a pc in a long run, @@ -1849,8 +1935,9 @@ is not checked here. The tokens are under [Token changes](#token-changes). and the sprint over it. 8. **The pair** ([`pair`](#pair)): the split with a seam, the shared source with a mark per run, two columns of one run each, alignment by - line and by variable, `only here` and `differs`, the shadow on an ASan - run's stack rows, one clock with two moment counts, two minimaps at a + line and by variable, `only here` and `differs`, each run's frame as bytes + (`hexdump` `eight`, by the frame's fields, a byte stored past its field + keeping that field's ink), the shadow beside an ASan run's rows, one clock with two moment counts, each pane's minimap at a fortieth, the stopped side holding, a run's stderr as a panel; steps matched by source line or loop turn. 9. **The introduction's blocks** ([`segments`](#segments), [`aligned`](#aligned)): @@ -1874,6 +1961,16 @@ is not checked here. The tokens are under [Token changes](#token-changes). `time.first_step` 4 s (5 s when a scene opens on the map), `time.dive` and `time.flash`. +11. **Each pane's minimap** ([the minimap](#the-map-and-the-minimap)), + in place of the corner one: a strip inside each pane's frame drawn from + its column of the map, at the fixed scale, scrolled round the window; + its window, marks and arcs' ends; `flash` there; the pane's content 48 + narrower and the disassembly's annotation at 540; the window gliding + with `scroll` and a far jump shown on the strip before the pane fades + through; `dive` and `surface` squeezing each column into its strip and + back; the clock's count at 1856. The corner minimap and its `K = 1/20` + go. + **What the recordings must hold**, with the tracer's options: - For the map, as before: `--stack 1024`, `--disasm 69`, `--around 256`; @@ -1948,6 +2045,7 @@ loupe's and the arc's tokens, the lift's colours, the clock's count at | `time.spread` | none | rows 0.60 (`glide`, blocks 0.067 apart), then frames 0.20, then edges 0.20 each, 0.033 apart | | `time.ascend` | none | `close` 0.20 a row, 0.03 apart, from 0.80; the lane back 0.20; the caller's kept rows 0.30 (`glide`), then the given-back rows 0.20; the step 2.50 | | `metric.segments` | none | the whole 20 wide, the stage's height, its labels 12 left of it; a box 180 wide (108 in a column of 880), framed 2 out, 48 apart; bands 30% over the page, named from 6 tall, permissions inside from 28; the names 64 past the box, rows 24, a band's row indented 24, sizes ranged right 132 in, files at 252 on a bracket at 240; leaders 8 out, 20 short, 12 in; the magnification 2 `rule`; a dump's place: its link 3 in the stack's ink over y 56, standing at 60% toward the page | +| `metric.minimap` | the corner's: 192 by 108 at 1664, 912, a twentieth; the clock's count at 1648 | a pane's own: a strip 40 wide inside its frame at its right, 2 in, over its body, on `well`; the content 8 from it (832 of 880); a row 4 (a stroke 3), a row's 880 to 36; strokes 65% of their ink; the window 2 in primary; marks 4 by 4 at a row's left; three dots where a column goes on; no strip on the registers, a lens's drawing, a loupe. The disassembly's annotation at 540 in a pane with a strip. The clock's count at 1856 | | `time.enlarge` | none | the line framed 0.10; the ride 1.20 (`glide`); page lines 0.20; names 0.20 each, 0.033 apart, a leader 0.10 before its address; the next cluster as one lands | | `time.regroup` | none | rows making room 0.30, down 0.20, left 0.30; veil 0.30; offsets 0.20 each, 0.033 apart; a byte's flight 0.60, 0.10 apart; the gaps 0.20; the zeros 0.20; at a run a word 0.133, rows 0.10 apart | | `metric.aligned` | `interleaved` only | `columns`: the seam 48 after the longest line in the window; each column's place ranged right 132 into it, its text 24 after; a line's first row `raised` | diff --git a/design/mock/09-context-480.png b/design/mock/09-context-480.png index 52edc14..f047b56 100644 Binary files a/design/mock/09-context-480.png and b/design/mock/09-context-480.png differ diff --git a/design/mock/09-context.png b/design/mock/09-context.png index b262b5b..d00d8f2 100644 Binary files a/design/mock/09-context.png and b/design/mock/09-context.png differ diff --git a/design/mock/09-context.svg b/design/mock/09-context.svg index c867889..5fc1364 100644 --- a/design/mock/09-context.svg +++ b/design/mock/09-context.svg @@ -20,7 +20,7 @@ head ) { - + 21 struct @@ -95,7 +95,7 @@ 23 mov rax, rdi - + 10019 @@ -103,13 +103,13 @@ 21 mov rdi, [rdi + 8] -1004098 - - -1004070 - - -9 +1004098 + + +1004070 + + +9 10019 2a 22 @@ -139,11 +139,11 @@ 10019 37 ret - + 10019 38 endbr64 -_init +_init @@ -266,7 +266,7 @@ rbp rsp +0 -saved rbp +saved rbp 7fffffffe ce0 @@ -291,14 +291,14 @@ 7ffff7e20de8 +18 -saved rbx +saved rbx 7fffffffe cf8 0 +20 -saved rbp +saved rbp 7fffffffe d00 @@ -331,21 +331,20 @@ 7fffffffee38 -7fffffffefea - - -".… - - - -reverse - - - -main - - -libc+27781 + + + + + + +reverse + + + +main + + +libc+27781 @@ -533,1501 +532,1058 @@ 36 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -moment 2 of 4 +moment 2 of 4 Stopped in reverse, about to load head->next. rdi points at a node; the word after its value is the next node. diff --git a/design/mock/10-context-step-480.png b/design/mock/10-context-step-480.png index 2a9eaad..87a7f5e 100644 Binary files a/design/mock/10-context-step-480.png and b/design/mock/10-context-step-480.png differ diff --git a/design/mock/10-context-step.png b/design/mock/10-context-step.png index 7290e91..51910b8 100644 Binary files a/design/mock/10-context-step.png and b/design/mock/10-context-step.png differ diff --git a/design/mock/10-context-step.svg b/design/mock/10-context-step.svg index c788864..c693bf6 100644 --- a/design/mock/10-context-step.svg +++ b/design/mock/10-context-step.svg @@ -20,7 +20,7 @@ head ) { - + 21 struct @@ -95,7 +95,7 @@ 23 mov rax, rdi - + 10019 @@ -103,14 +103,14 @@ 21 mov rdi, [rdi + 8] - -1004098 - - -1004070 - - -9 + +1004098 + + +1004070 + + +9 10019 2a 22 @@ -140,11 +140,11 @@ 10019 37 ret - + 10019 38 endbr64 -_init +_init @@ -267,7 +267,7 @@ rbp rsp +0 -saved rbp +saved rbp 7fffffffe ce0 @@ -292,14 +292,14 @@ 7ffff7e20de8 +18 -saved rbx +saved rbx 7fffffffe cf8 0 +20 -saved rbp +saved rbp 7fffffffe d00 @@ -332,21 +332,20 @@ 7fffffffee38 -7fffffffefea - - -".… - - - -reverse - - - -main - - -libc+27781 + + + + + + +reverse + + + +main + + +libc+27781 @@ -545,1505 +544,1060 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -moment 3 of 4 +moment 3 of 4 The load read the word at 1004098: the address of the next node. rdi holds it now, and points at the node whose value is 9. diff --git a/design/mock/11-context-lens-480.png b/design/mock/11-context-lens-480.png index 6285b81..1cf154e 100644 Binary files a/design/mock/11-context-lens-480.png and b/design/mock/11-context-lens-480.png differ diff --git a/design/mock/11-context-lens.png b/design/mock/11-context-lens.png index 6e17b47..f6051fb 100644 Binary files a/design/mock/11-context-lens.png and b/design/mock/11-context-lens.png differ diff --git a/design/mock/11-context-lens.svg b/design/mock/11-context-lens.svg index b8188b3..74f3763 100644 --- a/design/mock/11-context-lens.svg +++ b/design/mock/11-context-lens.svg @@ -20,8 +20,8 @@ reverse ( struct -node -… +n +… 19 struct node @@ -36,7 +36,7 @@ head ) { - + 21 struct @@ -97,7 +97,7 @@ 23 mov rax, rdi - + 10019 @@ -105,14 +105,14 @@ 21 mov rdi, [rdi + 8] - -1004098 - - -1004070 - - -9 + +1004098 + + +1004070 + + +9 10019 2a 22 @@ -253,7 +253,7 @@ rbp rsp +0 -saved rbp +saved rbp 7fffffffe ce0 @@ -278,14 +278,14 @@ 7ffff7e20de8 +18 -saved rbx +saved rbx 7fffffffe cf8 0 +20 -saved rbp +saved rbp 7fffffffe d00 @@ -303,14 +303,14 @@ 7ffff7c27781 libc+27781 - - - -reverse - - - -main + + + +reverse + + + +main @@ -560,1505 +560,950 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -moment 3 of 4 +moment 3 of 4 The load read the word at 1004098: the address of the next node. rdi holds it now, and points at the node whose value is 9. diff --git a/design/mock/20-dive.png b/design/mock/20-dive.png index 5efba9c..3d2925f 100644 Binary files a/design/mock/20-dive.png and b/design/mock/20-dive.png differ diff --git a/design/mock/21-loupe-480.png b/design/mock/21-loupe-480.png index 383c7f2..76852b2 100644 Binary files a/design/mock/21-loupe-480.png and b/design/mock/21-loupe-480.png differ diff --git a/design/mock/21-loupe.png b/design/mock/21-loupe.png index ed97f20..a3ed604 100644 Binary files a/design/mock/21-loupe.png and b/design/mock/21-loupe.png differ diff --git a/design/mock/21-loupe.svg b/design/mock/21-loupe.svg index 5a3e837..a04e65b 100644 --- a/design/mock/21-loupe.svg +++ b/design/mock/21-loupe.svg @@ -20,7 +20,7 @@ head ) { - + 21 struct @@ -95,7 +95,7 @@ 23 mov rax, rdi - + 10019 @@ -103,14 +103,14 @@ 21 mov rdi, [rdi + 8] - -1004098 - - -1004070 - - -9 + +1004098 + + +1004070 + + +9 10019 2a 22 @@ -140,11 +140,11 @@ 10019 37 ret - + 10019 38 endbr64 -_init +_init @@ -267,7 +267,7 @@ rbp rsp +0 -saved rbp +saved rbp 7fffffffe ce0 @@ -292,14 +292,14 @@ 7ffff7e20de8 +18 -saved rbx +saved rbx 7fffffffe cf8 0 +20 -saved rbp +saved rbp 7fffffffe d00 @@ -332,21 +332,20 @@ 7fffffffee38 -7fffffffefea - - -".… - - - -reverse - - - -main - - -libc+27781 + + + + + + +reverse + + + +main + + +libc+27781 @@ -676,1648 +675,1060 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -moment 3 of 4 +moment 3 of 4 rdi holds 1004070; under it opens the heap round that node. -The minimap shows the same loupe at its place on the map. +Each pane's minimap shows where its rows are in the whole. diff --git a/design/mock/26-pair-rest-480.png b/design/mock/26-pair-rest-480.png index be057a5..6e2c5a1 100644 Binary files a/design/mock/26-pair-rest-480.png and b/design/mock/26-pair-rest-480.png differ diff --git a/design/mock/26-pair-rest.png b/design/mock/26-pair-rest.png index d5eca7f..a609773 100644 Binary files a/design/mock/26-pair-rest.png and b/design/mock/26-pair-rest.png differ diff --git a/design/mock/26-pair-rest.svg b/design/mock/26-pair-rest.svg index c6bbd84..45d73ac 100644 --- a/design/mock/26-pair-rest.svg +++ b/design/mock/26-pair-rest.svg @@ -154,75 +154,133 @@ plain · stack -red zone, buf, the frame · rsp at +0 · the frames they belong to --30 -7fffffffec -b0 - - -0 --28 -7fffffffec -b8 - - -0 --20 -7fffffffec -c0 - - -0 --18 -i, high half -7fffffffec -c8 - - -0xf00000000 --10 -buf[0..7] -7fffffffec -d0 - - -"AAAAAAAA" --8 -buf[8..15] -7fffffffec -d8 - - -"AAAAAAA" -rbp rsp - -+0 -saved rbp -7fffffffec -e0 - - -7fffffffed00 -+8 -return -7fffffffec -e8 - - -401134 -main+20 -+10 -7fffffffec -f0 - - -0 -+18 -7fffffffec -f8 - - -0 +fill's frame as bytes, eight a row +7fffffffec +b0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +b8 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +c0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +c8 + + +0f +00 +00 +00 +i +15 +00 +00 +00 +00 +7fffffffec +d0 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[0..7] +"AAAAAAAA" +7fffffffec +d8 + +41 +41 +41 +41 +41 +41 + +41 +00 +buf[8..15] +"AAAAAAA" +rbp rsp + +7fffffffec +e0 + +00 +ed +ff +ff +ff +7f +00 +00 +saved rbp + + +7fffffffed00 + +7fffffffec +e8 + +34 +11 +40 +00 +00 +00 +00 +00 +return + + +401134 +main+20 + +7fffffffec +f0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +f8 +00 +00 +00 +00 +00 +00 +00 +00 @@ -317,101 +375,172 @@ -asan · fake stack -the fake frame, its shadow · the real stack's way back · the frames they belong to -magic -7 -bfff58f0000 - - -0x41b58ab3 -descr -7 -bfff58f0008 - - -5387a7 - - -"1 32 16 5 buf:3" -pc -7 -bfff58f0010 - - -523c60 -fill -real stack -7 -bfff58f0018 - - -7fffffffec10 -buf[0..7] -7 -bfff58f0020 - - -"AAAAAAAA" -buf[8..15] -7 -bfff58f0028 - - -"AAAAAAA" -redzone -7 -bfff58f0030 - - -0 -redzone -7 -bfff58f0038 - - -7bfff58e8000 -rbp - -saved rbp -7 -fffffffecc0 - - -7fffffffece0 -return -7 -fffffffecc8 - - -523c54 -main+20 +asan · fake frame +its shadow at addr >> 3 + 7fff8000 · then the real stack's way back + +f1 +7bfff58f00 +00 + +b3 +8a +b5 +41 +00 +00 +00 +00 +magic + +f1 +7bfff58f00 +08 + +a7 +87 +53 +00 +00 +00 +00 +00 +descr + + +5387a7 +"1 32 16 5 b… + +f1 +7bfff58f00 +10 + +60 +3c +52 +00 +00 +00 +00 +00 +pc + + +523c60 +fill + +f1 +7bfff58f00 +18 + +10 +ec +ff +ff +ff +7f +00 +00 +real stack + + +7fffffffec10 +00 +7bfff58f00 +20 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[0..7] +"AAAAAAAA" +00 +7bfff58f00 +28 + +41 +41 +41 +41 +41 +41 +41 +00 +buf[8..15] +"AAAAAAA" + +f3 +7bfff58f00 +30 + +00 +00 +00 +00 +00 +00 +00 +00 +redzone + + +f3 +7bfff58f00 +38 + +00 +80 +8e +f5 +ff +7b +00 +00 +redzone + + +rbp + +7fffffffecc0 + +e0 +ec +ff +ff +ff +7f +00 +00 +saved rbp + + +7fffffffece0 +7fffffffecc8 + +54 +3c +52 +00 +00 +00 +00 +00 +return + + +523c54 +main+20 fill - -f1 - -f1 - -f1 - -f1 -00 -00 - -f3 - -f3 - - - - - i 15 · moments 156 / 753 -The same line, two builds: plain stores the byte; ASan first -reads the byte of shadow that stands for it: 00, so it may. +Each turn is one more byte: 41, the letter A. Fifteen in buf, +on both sides; ASan read 00 in the shadow before each one. diff --git a/design/mock/27-pair-store-480.png b/design/mock/27-pair-store-480.png index 6fb2409..ee4e250 100644 Binary files a/design/mock/27-pair-store-480.png and b/design/mock/27-pair-store-480.png differ diff --git a/design/mock/27-pair-store.png b/design/mock/27-pair-store.png index 2563ead..13071cb 100644 Binary files a/design/mock/27-pair-store.png and b/design/mock/27-pair-store.png differ diff --git a/design/mock/27-pair-store.svg b/design/mock/27-pair-store.svg index 637f851..2161574 100644 --- a/design/mock/27-pair-store.svg +++ b/design/mock/27-pair-store.svg @@ -213,6 +213,73 @@ jmp 40114b the check: plain has nothing here + + + +plain · buf +the turn's byte +7fffffffec +d0 + +41 +41 +41 + +41 +00 +00 +00 +00 +buf[0..7] +"AAAA" +7fffffffec +d8 + +00 +00 +00 +00 +00 +00 +00 +00 +buf[8..15] +"" + + + +asan · buf +its shadow, read before the store +00 + +7bfff58f00 +20 + +41 +41 +41 + +41 +00 +00 +00 +00 +buf[0..7] +"AAAA" +00 +7bfff58f00 +28 + +00 +00 +00 +00 +00 +00 +00 +00 +buf[8..15] +"" Plain: one store. ASan: the address, its shadow byte (addr >> 3 + 7fff8000), a compare with 0, a branch; the partial check and the report only if it is not 0. diff --git a/design/mock/28-pair-part-480.png b/design/mock/28-pair-part-480.png index adaeb20..c910052 100644 Binary files a/design/mock/28-pair-part-480.png and b/design/mock/28-pair-part-480.png differ diff --git a/design/mock/28-pair-part.png b/design/mock/28-pair-part.png index 8651eb6..cd2cc37 100644 Binary files a/design/mock/28-pair-part.png and b/design/mock/28-pair-part.png differ diff --git a/design/mock/28-pair-part.svg b/design/mock/28-pair-part.svg index e5cd106..04bc5e7 100644 --- a/design/mock/28-pair-part.svg +++ b/design/mock/28-pair-part.svg @@ -155,76 +155,134 @@ plain · stack -red zone, buf, the frame · rsp at +0 · the frames they belong to --30 -7fffffffec -b0 - - -0 --28 -7fffffffec -b8 - - -0 --20 -7fffffffec -c0 - - -0 --18 -i, high half -7fffffffec -c8 - - -0x1000000000 --10 -buf[0..7] -7fffffffec -d0 - - -"AAAAAAAA" --8 -buf[8..15] -7fffffffec -d8 - - -"AAAAAAAA" -rbp rsp - -+0 -saved rbp -7fffffffec -e0 - - - -7fffffffed41 -+8 -return -7fffffffec -e8 - - -401134 -main+20 -+10 -7fffffffec -f0 - - -0 -+18 -7fffffffec -f8 - - -0 +fill's frame as bytes, eight a row +7fffffffec +b0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +b8 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +c0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +c8 + + +10 +00 +00 +00 +i +16 +00 +00 +00 +00 +7fffffffec +d0 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[0..7] +"AAAAAAAA" +7fffffffec +d8 + +41 +41 +41 +41 +41 +41 +41 + +41 +buf[8..15] +"AAAAAAAA" +rbp rsp + +7fffffffec +e0 + + +41 +ed +ff +ff +ff +7f +00 +00 +saved rbp + + +7fffffffed41 + +7fffffffec +e8 + +34 +11 +40 +00 +00 +00 +00 +00 +return + + +401134 +main+20 + +7fffffffec +f0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +f8 +00 +00 +00 +00 +00 +00 +00 +00 @@ -327,102 +385,173 @@ -asan · fake stack -the fake frame, its shadow · the real stack's way back · the frames they belong to -magic -7 -bfff58f0000 - - -0x41b58ab3 -descr -7 -bfff58f0008 - - -5387a7 - - -"1 32 16 5 buf:3" -pc -7 -bfff58f0010 - - -523c60 -fill -real stack -7 -bfff58f0018 - - -7fffffffec10 -buf[0..7] -7 -bfff58f0020 - - -"AAAAAAAA" -buf[8..15] -7 -bfff58f0028 - - -"AAAAAAAA" -redzone -7 -bfff58f0030 - - -0 -redzone -7 -bfff58f0038 - - -7bfff58e8000 -rbp - -saved rbp -7 -fffffffecc0 - - -7fffffffece0 -return -7 -fffffffecc8 - - -523c54 -main+20 +asan · fake frame +its shadow at addr >> 3 + 7fff8000 · then the real stack's way back + +f1 +7bfff58f00 +00 + +b3 +8a +b5 +41 +00 +00 +00 +00 +magic + +f1 +7bfff58f00 +08 + +a7 +87 +53 +00 +00 +00 +00 +00 +descr + + +5387a7 +"1 32 16 5 b… + +f1 +7bfff58f00 +10 + +60 +3c +52 +00 +00 +00 +00 +00 +pc + + +523c60 +fill + +f1 +7bfff58f00 +18 + +10 +ec +ff +ff +ff +7f +00 +00 +real stack + + +7fffffffec10 +00 +7bfff58f00 +20 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[0..7] +"AAAAAAAA" +00 +7bfff58f00 +28 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[8..15] +"AAAAAAAA" + +f3 + +7bfff58f00 +30 + +00 +00 +00 +00 +00 +00 +00 +00 +redzone + + +f3 +7bfff58f00 +38 + +00 +80 +8e +f5 +ff +7b +00 +00 +redzone + + +rbp + +7fffffffecc0 + +e0 +ec +ff +ff +ff +7f +00 +00 +saved rbp + + +7fffffffece0 +7fffffffecc8 + +54 +3c +52 +00 +00 +00 +00 +00 +return + + +523c54 +main+20 fill - -f1 - -f1 - -f1 - -f1 -00 -00 - -f3 - - -f3 - - - - - i 16 · moments 164 / 770 -i = 16, one past buf: plain writes 'A' into the saved rbp. ASan reads -the shadow first: f3, a redzone. Its branch to the store is not taken. +i = 16, one past buf: plain writes 41, an 'A', into the saved rbp. +ASan reads the shadow first: f3, a redzone. It does not store. diff --git a/design/mock/38-pair-ret-480.png b/design/mock/38-pair-ret-480.png new file mode 100644 index 0000000..85f2b62 Binary files /dev/null and b/design/mock/38-pair-ret-480.png differ diff --git a/design/mock/38-pair-ret.png b/design/mock/38-pair-ret.png new file mode 100644 index 0000000..efd37c0 Binary files /dev/null and b/design/mock/38-pair-ret.png differ diff --git a/design/mock/38-pair-ret.svg b/design/mock/38-pair-ret.svg new file mode 100644 index 0000000..aec2130 --- /dev/null +++ b/design/mock/38-pair-ret.svg @@ -0,0 +1,509 @@ + + + + + + +overflow.c · both builds +lines 2 to 6 of 10 +2 +__attribute__ +( +( +noinline +) +) +static +void +fill +( +void +) +{ +3 +char +buf +[ +16 +] +; + + +4 +for +( +int +i += +0 +; +i +< +32 +; +i ++ ++ +) +buf +[ +i +] += +' +A +' +; +5 +} +6 + + +asan + + + + +disassembly +plain · fill +4011 +44 +4 +mov +[rbp - 0x14] + + + + +, 0 + +4011 +4b +cmp +[rbp - 0x14] + + + + +, 0x20 + +4011 +4f +jge +401165 + +4011 +51 +movsxd +rax, [rbp - 0x14] + + + + + + + + +4011 +55 +mov +[rbp + rax - 0x10] + +, 0x41 +7fffffffeceb + + +0x41 +65 +4011 +5a +mov +eax, [rbp - 0x14] +4011 +5d +add +eax, 1 +4011 +60 +mov +[rbp - 0x14], eax +4011 +63 +jmp +40114b + + + +plain · registers +the line's registers, and rip +rax +0x1b +27 +rbp +7fffffffece0 + + +0x4141414141414141 +rsp +7fffffffece0 + + +rip +401155 +fill+21 + + + +plain · stack +fill's frame as bytes, eight a row +7fffffffec +b0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +b8 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +c0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +c8 + + +1b +00 +00 +00 +i +27 +00 +00 +00 +00 +7fffffffec +d0 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[0..7] +"AAAAAAAA" +7fffffffec +d8 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[8..15] +"AAAAAAAA" +rbp rsp + +7fffffffec +e0 + +41 +41 +41 +41 +41 +41 +41 +41 +saved rbp +0x4141414141414141 + +7fffffffec +e8 + + +41 + +41 + +41 + +41 +00 +00 +00 +00 +return +0x41414141 + +7fffffffec +f0 +00 +00 +00 +00 +00 +00 +00 +00 +7fffffffec +f8 +00 +00 +00 +00 +00 +00 +00 +00 + + + +fill + + + +disassembly +asan · fill · stopped +523d +4b +4 +and +rax, 7 +523d +4f +cmp +al, cl + +523d +51 +jl +523d5b + +523d +53 +mov +rdi, [rbx] + +523d +56 +call +4e8450 +__asan_report_store1 +never returned + + + + + + + + +asan · stderr +its report, as written · exit 1 +==1438870==ERROR: AddressSanitizer: stack-buffer-overflow on address 0… + +WRITE of size 1 at 0x7bfff58f0030 thread T0 + +Address 0x7bfff58f0030 is located in stack of thread T0 at offset 48 i… + This frame has 1 object(s): + [32, 48) 'buf' (line 3) <== Memory access at offset 48 overflows t… + +=>0x7bfff58f0000: f1 f1 f1 f1 00 00[f3]f3 00 00 00 00 00 00 00 00 + + + + +asan · fake frame +its shadow at addr >> 3 + 7fff8000 · then the real stack's way back + +f1 +7bfff58f00 +00 + +b3 +8a +b5 +41 +00 +00 +00 +00 +magic + +f1 +7bfff58f00 +08 + +a7 +87 +53 +00 +00 +00 +00 +00 +descr + + +5387a7 +"1 32 16 5 b… + +f1 +7bfff58f00 +10 + +60 +3c +52 +00 +00 +00 +00 +00 +pc + + +523c60 +fill + +f1 +7bfff58f00 +18 + +10 +ec +ff +ff +ff +7f +00 +00 +real stack + + +7fffffffec10 +00 +7bfff58f00 +20 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[0..7] +"AAAAAAAA" +00 +7bfff58f00 +28 + +41 +41 +41 +41 +41 +41 +41 +41 +buf[8..15] +"AAAAAAAA" + +f3 +7bfff58f00 +30 + +00 +00 +00 +00 +00 +00 +00 +00 +redzone + + +f3 +7bfff58f00 +38 + +00 +80 +8e +f5 +ff +7b +00 +00 +redzone + + +rbp + +7fffffffecc0 + +e0 +ec +ff +ff +ff +7f +00 +00 +saved rbp + + +7fffffffece0 +7fffffffecc8 + +54 +3c +52 +00 +00 +00 +00 +00 +return + + +523c54 +main+20 + + + +fill + + +i 27 · moment 252 · asan exited +i = 27: the return address is half 41s, and reads +41414141, no longer an address. ASan stopped at i = 16. + diff --git a/design/mock/39-minimap-1to1.png b/design/mock/39-minimap-1to1.png new file mode 100644 index 0000000..25cf6e2 Binary files /dev/null and b/design/mock/39-minimap-1to1.png differ diff --git a/design/mock/context.py b/design/mock/context.py index d58683c..31a54f6 100644 --- a/design/mock/context.py +++ b/design/mock/context.py @@ -98,8 +98,13 @@ def held_cell(g, x, y, w, h, k=1): g.rect(x, y + h - 3 * k, w, 3 * k, mix(VERM, PAGE, 0.6)) +MINIMAP = 0 # a pane with its own minimap: the frame this much wider than its content + + def tag(g, x, y, w, h, title, focus=False, note=None): - """A panel's frame and its one-row tag. note: a string, or runs (text, ink, underlined) for a legend.""" + """A panel's frame and its one-row tag. note: a string, or runs (text, ink, underlined) for a legend. The frame + is MINIMAP wider than w: the pane's minimap strip is drawn in it, right of the content (map.py).""" + w += MINIMAP g.rect(x, y, w, TAG, RAISED) g.frame(x, y, w, h, DIM if focus else RULE, 2) if focus: diff --git a/design/mock/map.py b/design/mock/map.py index 1b4287b..65b6c88 100644 --- a/design/mock/map.py +++ b/design/mock/map.py @@ -18,8 +18,6 @@ import context as C from context import (PAGE, RAISED, RULE, VELLUM, BRIGHT, DIM, FAINT, GOLD, VERM, READ, HEAP, STACK, A, S, ROW, TAG, PAD, MONO, b, ph, tw, mix, Svg, H_) -MINI = (1664, 912, 192, 108) # the minimap's place in the working frame: x, y, w, h -K = 1 / 20 # map units to the minimap's RSP, UNDER = D.RSP, 16 # the map's stack starts 16 words above rsp ROLES = {0: "saved rbp", 3: "saved rbx", 4: "saved rbp", 26: "saved rbp", 38: "saved rbp", 42: "argc", 43: "argv[0]", 44: "argv end", 45: "envp end", 46: "auxv"} @@ -87,6 +85,9 @@ def pins(step): return {0x10040b0: ["rcx"], 0x1004090: ["rax"] + ([] if step else ["rdi"]), 0x1004070: ["rdi"] if step else []} +COLS = {} # a pane's column on the map: (its parts, its window's first row, rows) + + def draw_map(g, step, loupe, subject=False): """The map at one moment. Returns the outlines of the working frame's windows, in map units.""" stage(True) @@ -100,6 +101,7 @@ def draw_map(g, step, loupe, subject=False): win["drawing"] = (col[0], 96, D.CW, 296) ys = C.source(g, 404, 42, D.SRC, 1, 21, [], "list.c", 42) first = 18 if subject else 19 + COLS["source"] = ([(col[0], 404 + TAG + PAD, 42)], first - 1, sp["src"]) win["source"] = (col[0], 404 + TAG + PAD + (first - 1) * ROW, D.CW, sp["src"] * ROW) D.put(col[0]) C.backtrace(g, 1456, ph(5), D.BT, x=col[0], note="newest at the bottom") @@ -111,12 +113,14 @@ def draw_map(g, step, loupe, subject=False): D.thread_across(g, ys, [(at[0x1001926], at[0x1001926] + ROW)]) wn = [r[0] for r in D.window(sp["dis"], step)] win["disasm"] = (col[1], at[wn[0]], D.CW, sp["dis"] * ROW) + COLS["disasm"] = ([(col[1], 96 + TAG + PAD, 69)], [r[0] for r in rows].index(wn[0]), sp["dis"]) # C: memory, the registers, a loupe, the stack continued D.put(col[2]) mem = C.fields(g, 96, ph(14), "the heap, round what the step reads", 0x1004000, 512, D.heap_fields(0x1004000, 512, 0x1004098), D.MEM, HEAP, D.region, marks=(9,) if step else (), title="memory", touched={0x1004098} if step else ()) win["view"] = (col[2], mem[0x1004050 if subject else 0x1004070], D.CW, (7 if subject else 5) * ROW) + COLS["view"] = ([(col[2], 96 + TAG + PAD, 14)], (win["view"][1] - 96 - TAG - PAD) // ROW, 7 if subject else 5) C.registers(g, 476, D.regs(step), D.FLAGS, {"rax": {0: "tick"}, "rcx": {0: "tick"}, "rdi": {0: "strike" if step else "tick"}}) win["registers"] = (col[2], 476, D.CW, ph(17)) @@ -131,6 +135,7 @@ def draw_map(g, step, loupe, subject=False): D.put(col[3]) C.stack(g, 96, slot_rows(0, 69), frames_from(0, 69), note="from rsp-80", rsp=RSP, roles=roles_from(0, 69)) win["stack"] = (col[3], 96 + TAG + PAD + UNDER * ROW, D.CW, sp["words"] * ROW) + COLS["stack"] = ([(col[3], 96 + TAG + PAD, 69), (col[2], y + TAG + PAD, n_c)], UNDER, sp["words"]) D.put(col[2]) C.stack(g, y, slot_rows(69, n_c - 1), frames_from(69, n_c - 1), note="continued", rsp=RSP, roles=roles_from(69, n_c - 1)) @@ -159,39 +164,58 @@ def key(g, x, y, step): g.t(xx + 136, b(yy), name, 18, DIM, "sans") -# ---- the minimap ------------------------------------------------------------------------------------------- -INKED = {GOLD, C.SOFT, VERM, C.WASH, RAISED, D.LIFT, D.LIFT_TAG, READ} - - -def minimap(g, log, windows, x0, y0, k=K, focus="drawing"): - """The map at k: every run of text a stroke 1 high in its ink at 45% toward the page; tags, paper and the - lift as blocks; the marks over them; the working frame's windows outlined, the one in focus 2.""" - W, H = 3840 * k, 2160 * k - g.rect(x0, y0, W, H, PAGE) - marks = [] - for e in log: - if e[0] == "r": - _, x, y, w, h, fill, stroke = e - if fill in (GOLD, C.SOFT, VERM) or stroke in (READ, VERM, BRIGHT): - marks.append(e) - elif fill in INKED and w * k >= 1: - g.rect(x0 + x * k, y0 + y * k, max(w * k, 1), max(h * k, 1), mix(fill, PAGE, 0.7 if fill == RAISED else 0.6)) - elif stroke in (RULE, DIM) and w > 200: - g.frame(x0 + x * k, y0 + y * k, w * k, h * k, mix(RULE, PAGE, 0.8), 1) - elif e[2] < 2100 and e[5] not in (None, "none"): - _, x, y, w, size, fill = e - g.rect(x0 + x * k, y0 + (y - size * 0.62) * k, max(w * k, 0.8), max(size * 0.05, 0.9), mix(fill, PAGE, 0.55)) - for _, x, y, w, h, fill, stroke in marks: # the marks: gold, a strike, a read; at least a pixel and a half - ink = fill if fill in (GOLD, C.SOFT, VERM) else stroke - if ink == C.SOFT: - ink = VERM - if ink == BRIGHT: - continue - g.rect(x0 + x * k, y0 + y * k, max(w * k, 1.5), max(h * k, 1.5), ink) - for name, (x, y, w, h) in windows.items(): - g.frame(x0 + (x - 4) * k, y0 + (y - 4) * k, (w + 8) * k, (h + 8) * k, BRIGHT if name == focus else VELLUM, - 1.5 if name == focus else 1) - g.frame(x0, y0, W, H, RULE, 1) +# ---- a pane's minimap ------------------------------------------------------------------------------------ +MW, MGAP, MR = 40, 8, 4 # its strip: 40 wide, 8 from the content; 4 units a row +KX = (MW - 4) / D.CW # a row's 880 to the strip's 36: a character two thirds of a unit + + +def column(log, parts): + """A pane's column, from the map's log: for each row, its runs of text as (x from the panel's left, width, + ink), and its marks (current, struck, read).""" + rows, marks, n0 = {}, {}, 0 + for x0, y0, n in parts: + for e in log: + if e[0] == "t": + _, x, y, w, size, fill = e + r = int((y - 19.2 - y0 + 1) // ROW) + if x0 <= x < x0 + D.CW and 0 <= r < n and fill not in (None, "none", PAGE): + rows.setdefault(n0 + r, []).append((x - x0, w, fill)) + else: + _, x, y, w, h, fill, stroke = e + r = int((y + h / 2 - y0) // ROW) + if not (x0 <= x < x0 + D.CW and 0 <= r < n): + continue + kind = ("current" if fill in (GOLD, C.WASH) and w >= 20 and h >= 20 else + "struck" if fill in (C.SOFT, VERM) else "read" if stroke == READ else None) + if kind: + marks.setdefault(n0 + r, set()).add(kind) + n0 += n + return rows, marks, n0 + + +def pane_minimap(g, log, name, x, y, h): + """A pane's minimap: its whole column of the map, a row 4 units, in the strip at the pane's right (x, y, 40 by + h). Each run of text a stroke 3 high in its ink 65% of the way from the page; the marks at the row's left: the current + row gold, a strike vermilion, a read in read's colour; the pane's window framed 2 in `dim`. A column longer + than the strip shows the rows round the window, and three dots at the end where it goes on.""" + parts, w0, wn = COLS[name] + rows, marks, total = column(log, parts) + g.rect(x, y, MW, h, C.WELL) + cap = int((h - 6) // MR) + first = 0 if total <= cap else min(max(w0 + wn // 2 - cap // 2, 0), total - cap) + top = y + 3 + for r in range(first, min(first + cap, total)): + ry = top + (r - first) * MR + for rx, rw, ink in rows.get(r, []): + g.rect(x + 2 + rx * KX, ry, max(rw * KX, 1), 3, mix(ink, PAGE, 0.65)) + for k, kind in enumerate(sorted(marks.get(r, ()), key=["current", "struck", "read"].index)): + g.rect(x + 2 + 5 * k, ry - 0.5, 4, 4, {"current": GOLD, "struck": VERM, "read": READ}[kind]) + g.frame(x, top + (w0 - first) * MR - 3, MW, wn * MR + 5, VELLUM, 2) # the pane's window + for end, more in (("top", first > 0), ("foot", first + cap < total)): + if more: + yy = y + 1 if end == "top" else y + h - 3 + for d in range(3): + g.rect(x + MW / 2 - 7 + d * 6, yy, 2, 2, FAINT) def map_log(step, loupe, subject=False): @@ -209,7 +233,13 @@ SUBJECT_VIEW = [5, 6, 7, 8, 9, 10, 11] def clock(g, moment, total): g.rect(64, 899, 1792, 2, RULE) g.rect(64, 898, 1792 * moment / total, 4, GOLD) - g.t(MINI[0] - 16, 934, "moment %d of %d" % (moment, total), S, FAINT, MONO, "end") + g.t(1856, 934, "moment %d of %d" % (moment, total), S, FAINT, MONO, "end") + + +def strip(on): + """Panes with a minimap: their content 48 narrower, their frame whole (context.tag).""" + C.CW, C.MINIMAP = (D.CW - MW - MGAP, MW + MGAP) if on else (D.CW, 0) + C.DX_NOTE = 540 if on else 564 # the annotation starts 24 sooner, so its room loses only 24 def working_panels(g, step, subject, wrap=lambda name: ("", ""), withhold=None): @@ -225,6 +255,7 @@ def working_panels(g, step, subject, wrap=lambda name: ("", ""), withhold=None): y = 48 + sp["band"] + 12 c = open_("source") + strip(True) D.put(64) ys = C.source(g, y, sp["src"], D.SRC, 18 if subject else 19, 21, [], "list.c", 42) g.o.append(c) if c else None @@ -234,10 +265,12 @@ def working_panels(g, step, subject, wrap=lambda name: ("", ""), withhold=None): out["thread"] = (ys, at[0x1001926]) yr = 48 + sp["view"] + 12 c = open_("registers") + strip(False) D.put(976) out["regs"] = C.registers(g, yr, D.regs(step), D.FLAGS, {"rax": {0: "tick"}, "rcx": {0: "tick"}, "rdi": {0: "strike" if step else "tick"}}) g.o.append(c) if c else None + strip(True) c = open_("stack") n = sp["words"] C.stack(g, yr + ph(17) + 12, slot_rows(UNDER, n), frames_from(UNDER, n), rsp=RSP, roles=roles_from(UNDER, n)) @@ -248,7 +281,10 @@ def working_panels(g, step, subject, wrap=lambda name: ("", ""), withhold=None): marks=(9,) if step else (), rows_shown=SUBJECT_VIEW if subject else BESIDE_VIEW, more_rows=False, touched={0x1004098} if step else (), withhold=withhold) g.o.append(c) if c else None + strip(False) out["view"] = view + out["boxes"] = {"source": (64, y, ph(sp["src"])), "disasm": (64, y + ph(sp["src"]) + 12, ph(sp["dis"])), + "stack": (976, yr + ph(17) + 12, ph(n)), "view": (976, 48, sp["view"])} return out, sp @@ -272,12 +308,19 @@ def working(name, step, subject=False, loupe=False, caption=None): D.loupe(g, lx, ly, [("rdi", DIM), (" → ", FAINT), ("1004070", HEAP)], "heap · struct node, 16 bytes", 0x1004050, D.heap_fields(0x1004050, 80), [(0x1004070 - 0x1004050, 16)], 1, rows=5) g.rect(hop - 2, ry + ROW - 3, 7 * A + 4, 4, HEAP) # the stem, short: a bracket under the pointer's digits, on the tag - minimap(g, m.log, win, *MINI[:2], focus="loupe" if loupe else "drawing") + minimaps(g, m.log, out["boxes"]) clock(g, 3 if step else 2, 4) gen.caption(g, caption) g.save(name) +def minimaps(g, log, boxes, skip=()): + """Each pane's minimap, in the strip its frame keeps at its right, over its body.""" + for name, (x, y, h) in boxes.items(): + if name not in skip: + pane_minimap(g, log, name, x + D.CW - 2 - MW, y + TAG, h - TAG - 2) + + # ---- the dive: the map coming in to the working frame, four instants ------------------------------------- def glide(t): """The glide curve (0.45, 0, 0.55, 1), solved for t.""" @@ -294,15 +337,17 @@ FRAME_RECT = {"source": (64, 212, 880, ph(8)), "disasm": (64, 448, 880, ph(17)), def dive(name, e, veil, outline, fade_frame): - """One instant of `dive`: e, the move's progress (glide applied), veil on the map, the windows' outline, how - far the working frame's own tags and minimap have come in.""" + """One instant of `dive`: e, the move's progress (glide applied); veil, on the map; outline, the windows' bright + frames; fade_frame, how far the working frame's tags and minimaps have come in. Each window travels to its + pane's place, its scale from the map's half to whole on its logarithm; each pane's column, the rest of what + the map holds of it, squeezes into the pane's minimap strip on the same move; the rest of the map fades.""" m, win = map_log(False, False) - body = m.o[1:] # the map's drawing, its page and all, without its svg head + body = m.o[1:-1] if m.o[-1] == "" else m.o[1:] stage(False) g = Svg() - sm = 0.5 ** (1 - e) * K ** e # the map: from filling the frame to the minimap, on the log of its scale - tx, ty = MINI[0] * e, MINI[1] * e - g.o.append('' % (tx, ty, sm)) + clips = [] + # the map's parts no pane takes: faded in place as the move goes + g.o.append('' % (1 - e)) g.o += body if veil: g.o.append('' % (PAGE, veil)) @@ -311,7 +356,29 @@ def dive(name, e, veil, outline, fade_frame): g.o.append('' % (x - 4, y - 4, w + 8, h + 8, BRIGHT, 2 + outline * 2)) g.o.append("") - # each window: the working panel, from its place on the map to its own, its scale on a logarithm + out, sp = working_panels(Svg(), False, False) # where the panes and their strips will be + if 0 < e < 1: # each column squeezing into its strip: a row from 24 units to 3 + for nm, (bx, by, bh) in out["boxes"].items(): + parts, w0, wn = COLS[nm] + sx0, sy0 = bx + D.CW - 2 - MW + 2, by + TAG + 3 + cap = int((bh - TAG - 2 - 6) // MR) + total = sum(p[2] for p in parts) + first = 0 if total <= cap else min(max(w0 + wn // 2 - cap // 2, 0), total - cap) + n0 = 0 + for k, (mx, my, n) in enumerate(parts): + kx, ky = 0.5 ** (1 - e) * KX ** e, 0.5 ** (1 - e) * (MR / ROW) ** e # on their logarithms + tx = mx * 0.5 * (1 - e) + sx0 * e + ty = my * 0.5 * (1 - e) + (sy0 + (n0 - first) * MR) * e + cid = "c%s%d" % (nm, k) + clips.append('' + % (cid, mx, my, D.CW, n * ROW)) + g.o.append('' + % (0.5 + 0.5 * e, tx, ty, kx, ky, -mx, -my)) + g.o.append('' % cid) + g.o += body + g.o.append("") + n0 += n + g.o.insert(1, "" + "".join(clips) + "") map_rect = {"source": win["source"], "disasm": win["disasm"], "registers": win["registers"], "stack": win["stack"], "view": win["view"], "drawing": win["drawing"]} @@ -320,8 +387,6 @@ def dive(name, e, veil, outline, fade_frame): return "", "" fx, fy, fw, fh = FRAME_RECT[nm] mx, my, mw, mh = map_rect[nm] - # at e = 0 the panel's first row lies on its window's first row on the map, both at half size; at e = 1 - # the panel is at its own place and size. Scale on its logarithm, the offset with the move. row0 = fy if nm in ("registers", "drawing") else fy + TAG + PAD sw = 0.5 ** (1 - e) ox, oy = (mx - fx) * 0.5 * (1 - e), (my - row0) * 0.5 * (1 - e) @@ -338,7 +403,7 @@ def dive(name, e, veil, outline, fade_frame): g.o.append(c) if fade_frame > 0: g.o.append('' % fade_frame) - minimap(g, m.log, win, *MINI[:2]) + minimaps(g, m.log, out["boxes"]) clock(g, 2, 4) g.o.append("") gen.caption(g, [[("Stopped in ",), ("reverse", "mono"), (", about to load ",), ("head->next", "mono"), (".",)], @@ -363,6 +428,28 @@ def sheet(names, out, labels): s.save(out) +def crop_sheet(src, out): + """Mock 39: three panes' right ends from a working frame, at 1:1 (a 1080p pixel a unit), with what each minimap + lets a viewer read named under it.""" + im = Image.open(src).convert("RGB") + crops = [((800, 448, 944, 888), (24, 64), "the disassembly", ["69 rows: the function whole", "and its neighbours; the pc", + "gold, a read cyan; the", "window of 17 rows framed"]), + ((1640, 40, 1860, 200), (380, 64), "its bytes", ["the heap's 14 rows on the map;", "the 5 shown framed; the read row"]), + ((1640, 660, 1860, 888), (380, 360), "the stack", ["48 of its 103 rows, round the", "window; three dots: it goes on"])] + s = Image.new("RGB", (720, 700), "#0a1030") + d = ImageDraw.Draw(s) + head = ImageFont.truetype("/usr/share/fonts/go/Go-Medium.ttf", 22) + body = ImageFont.truetype("/usr/share/fonts/go/Go-Regular.ttf", 18) + d.text((24, 18), "each pane's minimap at 1:1, a pixel of 1080p a unit", font=head, fill="#eee6d2") + for box, (x, y), name, lines in crops: + c = im.crop(box) + s.paste(c, (x, y)) + d.text((x, y + c.height + 10), name, font=head, fill="#eee6d2") + for k, t in enumerate(lines): + d.text((x, y + c.height + 40 + 24 * k), t, font=body, fill="#9aa6d9") + s.save(out) + + if __name__ == "__main__": import os stage(True) @@ -381,7 +468,8 @@ if __name__ == "__main__": working("11-context-lens", True, subject=True, caption=cap10) working("21-loupe", True, loupe=True, caption=[[("rdi", "mono"), (" holds ",), ("1004070", "mono"), ("; under it opens the heap round that node.",)], - [("The minimap shows the same loupe at its place on the map.",)]]) + [("Each pane's minimap shows where its rows are in the whole.",)]]) + crop_sheet("10-context-step.png", "39-minimap-1to1.png") names = ["20a", "20b", "20c", "20d"] dive("20a", 0, 0, 0, 0) dive("20b", 0, 0.5, 1, 0) diff --git a/design/mock/pair.py b/design/mock/pair.py index 1311b95..3adb60d 100644 --- a/design/mock/pair.py +++ b/design/mock/pair.py @@ -102,12 +102,188 @@ def source_pair(g, cur_l, cur_r, waiting_r=False): return ys -def frame(name, part): - """The pair at the loop. part=False: i = 15, both builds at the line's store (plain) and its check (asan). - part=True: i = 16, the step in which they part: plain's store struck into the saved rbp; asan's check read f3.""" +# ---- the frame as bytes: `hexdump` `eight`, by the frame's own fields -------------------------------------------- +PX, AX, BX8, RD = 12, 118, 274, 522 # a row: the pin lane, the address, eight bytes 30 apart, the reading +SHX = 62 # in a run with ASan, the row's shadow byte, in the pin lane's end + + +def plain_region(v): + """Where a word of the plain build points, by its mappings; None: nowhere (a number).""" + if 0x7ffffffde000 <= v < 0x7ffffffff000: + return S_ + if 0x401000 <= v < 0x402000: + return C_ + if 0x404000 <= v < 0x405000: + return D_ + return None + + +def asan_region(v): + if 0x7ffffffde000 <= v < 0x7ffffffff000: + return S_ + if 0x7bfff58e7000 <= v < 0x7bfff6400000: + return D_ + if 0x42c000 <= v < 0x524000: + return C_ + if 0x524000 <= v < 0x55f000: + return VELLUM + return None + + +CODE_NAMES = {0x401120: "main", 0x401140: "fill", 0x523c40: "main", 0x523c60: "fill"} + + +def code_name(v): + f = max((a for a in CODE_NAMES if a <= v and v - a < 0x100), default=None) + return None if f is None else (CODE_NAMES[f] + ("+%d" % (v - f) if v > f else "")) + + +def plain_mem(stored, i): + """The plain build's stack from 7fffffffecb0 to 7fffffffed00 after `stored` of the loop's stores, i in its slot.""" + m = {a: 0 for a in range(0x7fffffffecb0, 0x7fffffffed00)} + for k, v in enumerate([0x00, 0xed, 0xff, 0xff, 0xff, 0x7f, 0, 0, 0x34, 0x11, 0x40, 0, 0, 0, 0, 0]): + m[0x7fffffffece0 + k] = v + for k in range(4): + m[0x7fffffffeccc + k] = i >> (8 * k) & 0xff + for k in range(stored): + m[0x7fffffffecd0 + k] = 0x41 + return m + + +def asan_mem(stored): + """ASan's fake frame (the header as its prologue wrote it, buf, the redzone) and the real stack's way back.""" + m = {} + for off, v in [(0, 0x41b58ab3), (8, 0x5387a7), (0x10, 0x523c60), (0x18, 0x7fffffffec10), (0x38, 0x7bfff58e8000)]: + for k in range(8): + m[FAKE + off + k] = v >> (8 * k) & 0xff + for k in range(0x20, 0x38): + m[FAKE + k] = 0x41 if 0x20 <= k < 0x20 + stored else 0 + for a, v in [(0x7fffffffecc0, 0x7fffffffece0), (0x7fffffffecc8, 0x523c54)]: + for k in range(8): + m[a + k] = v >> (8 * k) & 0xff + return m + + +DESCR = {0x5387a7: "1 32 16 5 buf:3"} + + +def frame_dump(g, x, y, title, note, rows, mem, region, pins=None, shadow=None, struck=None, held=(), letters=(), + read_shadow=None, span=None, rule_after=None, differs=(), seam=None): + """`hexdump` `eight` by the frame's fields: a row a word of the stack (eight bytes), its pins and address, the + bytes on their field's paper, the reading: the field's name (Go 18, dim) and what its type makes of its bytes. + rows: (address, [(offset, length, reads, name)]); reads in text | pointer | number | bytes; what no field + covers is loose. letters: bytes stored past the field the store aimed at, which keep its ink (text) wherever + they land. shadow: {row: byte}. span: (name, first row, last row). Returns the rows' y.""" + pins = pins or {} + y0 = C.panel(g, x, y, C.CW, len(rows) + (0 if rule_after is None else 0), title, note=note) + lead = C.shared([a for a, _ in rows if region(a) == region(rows[0][0])]) + ys = [] + for r, (a0, flist) in enumerate(rows): + yy = y0 + r * ROW + ys.append(yy) + if rule_after is not None and r == rule_after + 1: # another region (the real stack): a rule before it + g.rect(x + 2, yy - 1, C.CW - 4, 2, RULE) + if r in pins: + C.pin(g, x + PX, yy, pins[r], S_) + if shadow and r in shadow: + shadow_cell(g, x + SHX, yy, shadow[r], read=read_shadow == r) + ink_a = region(a0) or VELLUM + C.addr(g, x + AX, yy, a0, ink_a, lead=lead if region(a0) == region(rows[0][0]) else 0) + bx = lambda k: x + BX8 + 30 * k + covered = {} + for f in flist: + for k in range(f[0], f[0] + f[1]): + covered[k] = f + rx = x + RD + for f in flist: + off, n, reads, name = f + vals = [mem[a0 + off + k] for k in range(n)] + word = sum(v << (8 * k) for k, v in enumerate(vals)) + g.rect(bx(off) - 4, yy + 1, 30 * n - 2, ROW - 2, RAISED) + ink = {"text": LIT, "number": VELLUM, "bytes": VELLUM, "pointer": region(word) or VELLUM}[reads] + nz = [k for k, v in enumerate(vals) if v] + for k, v in enumerate(vals): + a = a0 + off + k + xx = bx(off + k) + if a == struck: + g.t(xx, b(yy), "%02x" % v, S, C.struck(g, xx - 5, yy, 34), BOLD) + continue + if a in held: + C.held(g, xx, yy, 24) + padded = reads in ("number", "pointer") and nz and k > nz[-1] + kink = LIT if a in letters else ink + g.t(xx, b(yy), "%02x" % v, S, mix(kink, PAGE, 0.45) if padded else kink, MONO) + # the reading: the field's name, then its value + g.t(rx, b(yy) - 1, name, 18, DIM, "sans") + vx = rx + gen.tw(name, 18, "sans") + 10 + if reads == "text": + s_ = '"' + bytes(v for v in vals).split(b"\0")[0].decode("latin1") + '"' + g.t(vx, b(yy), s_, S, LIT, MONO) + elif reads == "number": # a count: in decimal, as the source writes it + g.t(vx, b(yy), str(word), S, VELLUM, MONO) + elif reads == "pointer": + ink_w = region(word) + if ink_w: + vx = C.addr(g, C.link_arrow(g, vx, yy), yy, word, ink_w) + nm = code_name(word) if ink_w == C_ else None + if nm: + g.t(vx + 10, b(yy), nm, S, VELLUM, MONO) + elif word in DESCR: + room = int((x + C.CW - 24 - vx - 10) // A) + t_ = '"%s"' % DESCR[word] + g.t(vx + 10, b(yy), t_ if len(t_) <= room else t_[:room - 1] + "…", S, LIT, MONO) + else: # no longer an address: a number, no arrow, no name + g.t(vx, b(yy), "0x%x" % word, S, VELLUM, MONO) + rx = vx + 200 + for k in range(8): # what no field covers: loose + if k not in covered: + v = mem.get(a0 + k) + g.t(bx(k), b(yy), "%02x" % v, S, mix(DIM, PAGE, 0.6), MONO) + if r in differs: + bar(g, seam, yy, BRIGHT) + if span: # the frame's span, as the stack's: a bracket 14 in, its name left of it + name, r0, r1 = span + bx_, ya, yb = x + C.CW - 14, ys[r0] + 3, ys[r1] + ROW - 3 + g.rect(bx_ - 1, ya, 2, yb - ya, GOLD) + g.rect(bx_ - 7, ya, 8, 2, GOLD) + g.rect(bx_ - 7, yb - 2, 8, 2, GOLD) + g.t(bx_ - 14, (ya + yb) / 2 + 6, name, 18, BRIGHT, "sansm", "end") + return ys + + +PLAIN_ROWS = [(0x7fffffffecb0, []), (0x7fffffffecb8, []), (0x7fffffffecc0, []), + (0x7fffffffecc8, [(4, 4, "number", "i")]), (0x7fffffffecd0, [(0, 8, "text", "buf[0..7]")]), + (0x7fffffffecd8, [(0, 8, "text", "buf[8..15]")]), (0x7fffffffece0, [(0, 8, "pointer", "saved rbp")]), + (0x7fffffffece8, [(0, 8, "pointer", "return")]), (0x7fffffffecf0, []), (0x7fffffffecf8, [])] +ASAN_ROWS = [(FAKE, [(0, 8, "bytes", "magic")]), (FAKE + 8, [(0, 8, "pointer", "descr")]), + (FAKE + 0x10, [(0, 8, "pointer", "pc")]), (FAKE + 0x18, [(0, 8, "pointer", "real stack")]), + (FAKE + 0x20, [(0, 8, "text", "buf[0..7]")]), (FAKE + 0x28, [(0, 8, "text", "buf[8..15]")]), + (FAKE + 0x30, [(0, 8, "bytes", "redzone")]), (FAKE + 0x38, [(0, 8, "bytes", "redzone")]), + (0x7fffffffecc0, [(0, 8, "pointer", "saved rbp")]), (0x7fffffffecc8, [(0, 8, "pointer", "return")])] +SHADOW = {0: 0xf1, 1: 0xf1, 2: 0xf1, 3: 0xf1, 4: 0, 5: 0, 6: 0xf3, 7: 0xf3} + + +def plain_dump(g, i, stored, struck=None, held=(), note="fill's frame as bytes, eight a row"): + letters = {0x7fffffffecd0 + k for k in range(16, stored)} + return frame_dump(g, LEFT, 612, "plain · stack", note, PLAIN_ROWS, plain_mem(stored, i), plain_region, + pins={6: ["rbp", "rsp"]}, struck=struck, held=held, letters=letters, span=("fill", 3, 7), + differs=(6, 7), seam=LEFT + 880 - 6) + + +def asan_dump(g, stored, read=False): + return frame_dump(g, RIGHT, 612, "asan · fake frame", "its shadow at addr >> 3 + 7fff8000 · then the real " + "stack's way back", ASAN_ROWS, asan_mem(stored), asan_region, pins={8: ["rbp"]}, shadow=SHADOW, + read_shadow=6 if read else None, span=("fill", 0, 9), rule_after=7, differs=(6, 7), + seam=RIGHT + 2) + + +def frame(name, i): + """The pair at the loop, the frame as bytes in each column. i = 15: both builds at the line's store (plain) + and its check (asan). i = 16: the step in which they part: plain's store struck into the saved rbp; asan's + check read f3.""" gen.W, gen.H = 1920, 1080 g = Svg() - i = 16 if part else 15 + part = i == 16 source_pair(g, 4, 4) # ---- the left column: plain ---- at_side(LEFT) @@ -119,16 +295,8 @@ def frame(name, part): [("rax", [], ("int", i)), ("rbp", [(0x7fffffffece0, S_), (0x7fffffffed41 if part else 0x7fffffffed00, S_)], None), ("rsp", [(0x7fffffffece0, S_)], None), ("rip", [(0x401155, C_, "fill+21")], None)], {"rax": {0: "tick"}}) - sv = 0x7fffffffed41 if part else 0x7fffffffed00 - prow = [(0x7fffffffecb0, [], [], ("int", 0)), (0x7fffffffecb8, [], [], ("int", 0)), - (0x7fffffffecc0, [], [], ("int", 0)), (0x7fffffffecc8, [], [], ("int", i << 32)), - (0x7fffffffecd0, [], [], ("str", "AAAAAAAA")), (0x7fffffffecd8, [], [], ("str", "AAAAAAA" if not part else "AAAAAAAA")), - (0x7fffffffece0, ["rbp", "rsp"], [(sv, S_)], None) + (({1: "strike"},) if part else ()), - (0x7fffffffece8, [], [(0x401134, C_, "main+20")], None), - (0x7fffffffecf0, [], [], ("int", 0)), (0x7fffffffecf8, [], [], ("int", 0))] - py = C.stack(g, 612, prow, [("fill", 3, 7)], note="red zone, buf, the frame · rsp at +0", rsp=0x7fffffffece0, - roles={3: ("i, high half", VELLUM), 4: ("buf[0..7]", VELLUM), 5: ("buf[8..15]", VELLUM), - 6: ("saved rbp", DIM), 7: ("return", DIM)}, title="plain · stack") + plain_dump(g, i, i + 1 if part else i, struck=0x7fffffffece0 if part else None, + held={0x7fffffffecdf, 0x7fffffffeccc} if part else {0x7fffffffecde, 0x7fffffffeccc}) # ---- the right column: asan ---- at_side(RIGHT) an = {0x523d38: ("chain", [(0xf807eb16006 if part else 0xf807eb16005, D_)], ("int", 0xf3 if part else 0), @@ -138,53 +306,89 @@ def frame(name, part): if part: an[0x523d41] = ("runs", [("f3", VELLUM), (" : ", FAINT), ("0", VELLUM), (" ", FAINT), ("zf", DIM)]) an[0x523d43] = ("runs", [("not taken", DIM)]) - ar = rows_of(ASAN, 0x523d26, 9, ast, an) - at = C.disasm(g, 212, ar, "asan · fill", 4) + at = C.disasm(g, 212, rows_of(ASAN, 0x523d26, 9, ast, an), "asan · fill", 4) for a, yy in at.items(): if a in ONLY: bar(g, RIGHT + 2, yy, DIM) # its seam is on its left regs(g, RIGHT, 472, "asan · registers", [("rax", [], ("int", (FAKE + 0x20 + i) >> 3)), ("rbx", [(0x7fffffffec20, S_), (FAKE + 0x20 + i, D_)], None), ("rcx", [], ("int", i)), ("rip", [(0x523d38, C_, "fill+216")], None)], {"rax": {0: "tick"}}) - arow = [(FAKE + 0x00, [], [], ("int", 0x41b58ab3)), (FAKE + 0x08, [], [(0x5387a7, VELLUM)], ("str", "1 32 16 5 buf:3")), - (FAKE + 0x10, [], [(0x523c60, C_, "fill")], None), (FAKE + 0x18, [], [(0x7fffffffec10, S_)], None), - (FAKE + 0x20, [], [], ("str", "AAAAAAAA")), (FAKE + 0x28, [], [], ("str", "AAAAAAA" if not part else "AAAAAAAA")), - (FAKE + 0x30, [], [], ("int", 0)), (FAKE + 0x38, [], [(0x7bfff58e8000, D_)], None)] - ay = C.stack(g, 612, arow + [(0x7fffffffecc0, ["rbp"], [(0x7fffffffece0, S_)], None), - (0x7fffffffecc8, [], [(0x523c54, C_, "main+20")], None)], - [("fill", 0, 9)], note="the fake frame, its shadow · the real stack's way back", rsp=None, - roles={0: ("magic", DIM), 1: ("descr", DIM), 2: ("pc", DIM), 3: ("real stack", DIM), - 4: ("buf[0..7]", VELLUM), 5: ("buf[8..15]", VELLUM), 6: ("redzone", DIM), 7: ("redzone", DIM), - 8: ("saved rbp", DIM), 9: ("return", DIM)}, title="asan · fake stack", - ink_of=lambda a: S_ if a >= 0x7ffffffde000 else D_) - sh = [0xf1, 0xf1, 0xf1, 0xf1, 0, 0, 0xf3, 0xf3] - ys = sorted(ay.values()) if isinstance(ay, dict) else ay - base_y = 612 + TAG + PAD - for k, v in enumerate(sh): - shadow_cell(g, RIGHT + 88, base_y + k * ROW, v, read=part and k == 6) - # the real stack is another region: a rule before its two rows - g.rect(RIGHT + 2, base_y + 8 * ROW, C.CW - 4, 2, RULE) - # `differs`: the rows that face each other across the seam and hold different things (buf's end: saved rbp vs redzone) - for k in (6, 7): - bar(g, LEFT + 880 - 6, base_y + k * ROW, BRIGHT if part or k == 6 else BRIGHT) - bar(g, RIGHT + 2, base_y + k * ROW, BRIGHT) - # the clock: one rule, each run's moment - g.rect(64, 899, 1792, 2, RULE) - g.rect(64, 898, 1792 * (17 if part else 16) / 33, 4, GOLD) - g.t(1648, 934, "i %d · moments %d / %d" % (i, 164 if part else 156, 770 if part else 753), S, FAINT, MONO, "end") + asan_dump(g, 16 if part else 15, read=part) + clock(g, 17 if part else 16, "i %d · moments %d / %d" % (i, 164 if part else 156, 770 if part else 753)) if part: - gen.caption(g, [[("i = 16, one past ",), ("buf", "mono"), (": plain writes ",), ("'A'", "mono"), - (" into the saved rbp. ASan reads",)], - [("the shadow first: ",), ("f3", "mono"), (", a redzone. Its branch to the store is not taken.",)]]) + gen.caption(g, [[("i = 16, one past ",), ("buf", "mono"), (": plain writes ",), ("41", "mono"), + (", an ",), ("'A'", "mono"), (", into the saved rbp.",)], + [("ASan reads the shadow first: ",), ("f3", "mono"), (", a redzone. It does not store.",)]]) else: - gen.caption(g, [[("The same line, two builds: plain stores the byte; ASan first",)], - [("reads the byte of shadow that stands for it: ",), ("00", "mono"), (", so it may.",)]]) + gen.caption(g, [[("Each turn is one more byte: ",), ("41", "mono"), (", the letter ",), ("A", "mono"), + (". Fifteen in ",), ("buf", "mono"), (",",)], + [("on both sides; ASan read ",), ("00", "mono"), (" in the shadow before each one.",)]]) + g.save(name) + + +def clock(g, steps, text): + g.rect(64, 899, 1792, 2, RULE) + g.rect(64, 898, 1792 * steps / 33, 4, GOLD) + g.t(1648, 934, text, S, FAINT, MONO, "end") + + +REPORT = [("==1438870==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7bfff58f0030 at pc 0x000000523d5b", + "stack-buffer-overflow"), + ("WRITE of size 1 at 0x7bfff58f0030 thread T0", "WRITE of size 1"), + ("Address 0x7bfff58f0030 is located in stack of thread T0 at offset 48 in frame", None), + (" This frame has 1 object(s):", None), + (" [32, 48) 'buf' (line 3) <== Memory access at offset 48 overflows this variable", "[32, 48) 'buf'"), + ("=>0x7bfff58f0000: f1 f1 f1 f1 00 00[f3]f3 00 00 00 00 00 00 00 00", "[f3]")] + + +def report(g, x, y, lines): + """A run's stderr, as written: a panel of its lines, the ones the narration names framed; cut at its edge.""" + y0 = C.panel(g, x, y, C.CW, len(lines), "asan · stderr", note="its report, as written · exit 1") + room = (C.CW - 24) // A + for k, (t, mark) in enumerate(lines): + yy = y0 + k * ROW + s_ = t if len(t) <= room else t[:room - 1] + "…" + g.t(x + 12, b(yy), s_, S, VELLUM, MONO) + if mark and mark in s_: + c = s_.index(mark) + g.frame(x + 12 + c * A, yy, len(mark) * A, ROW, BRIGHT, 2) + + +def frame_ret(name): + """Mock 38: i = 27, plain alone: its store struck into the return address's fourth byte, which now reads + 0x41414141, no longer an address; ASan stopped at i = 16, its report in place of its registers.""" + gen.W, gen.H = 1920, 1080 + g = Svg() + source_pair(g, 4, 4) + at_side(LEFT) + pn = {0x401155: ("chain", [(0x7fffffffeceb, S_)], ("int", 0x41), {"end": "strike"})} + ps = {0x401155: "cur", 0x401151: "trail0", 0x40114f: "trail1", 0x40114b: "trail2"} + C.disasm(g, 212, rows_of(PLAIN, 0x401144, 9, ps, pn), "plain · fill", 4) + regs(g, LEFT, 472, "plain · registers", + [("rax", [], ("int", 27)), ("rbp", [(0x7fffffffece0, S_)], ("int", 0x4141414141414141)), + ("rsp", [(0x7fffffffece0, S_)], None), ("rip", [(0x401155, C_, "fill+21")], None)], + {"rax": {0: "tick"}}) + plain_dump(g, 27, 28, struck=0x7fffffffeceb, held={0x7fffffffece8, 0x7fffffffece9, 0x7fffffffecea, 0x7fffffffeccc}) + # ---- asan: stopped at i = 16. Its disassembly's upper rows, down to the call; its report in place of the rest + at_side(RIGHT) + ar = rows_of(ASAN, 0x523d4b, 5, {0x523d56: "trail0", 0x523d53: "trail1", 0x523d51: "trail2"}, + {0x523d56: ("text", "never returned", DIM)}) + at = C.disasm(g, 212, ar, "asan · fill · stopped", 4) + for a, yy in at.items(): + if a in ONLY: + bar(g, RIGHT + 2, yy, DIM) + report(g, RIGHT, 376, REPORT) + asan_dump(g, 16) + clock(g, 28, "i 27 · moment 252 · asan exited") + gen.caption(g, [[("i = 27: the return address is half ",), ("41", "mono"), ("s, and reads",)], + [("41414141", "mono"), (", no longer an address. ASan stopped at i = 16.",)]]) g.save(name) def sheet_store(name): """Mock 27: one turn of the loop, row by row, the plain build's rows facing their counterparts in the ASan - build's; the rows only ASan has barred on the seam side, the plain side's page facing them. i = 3.""" + build's; the rows only ASan has barred on the seam side, the plain side's page facing them. i = 3. Under + each, its buf as bytes: the turn's one byte struck, the letter it is.""" gen.W, gen.H = 1920, 1080 g = Svg() face = {0x40114b: 0x523d1e, 0x40114f: 0x523d22, 0x401151: 0x523d2a, 0x401155: 0x523d5e, 0x40115a: 0x523d61, @@ -217,8 +421,12 @@ def sheet_store(name): continue parts = [(ops, C_)] if isinstance(ops, int) else [(ops, P)] C.insn_rows(g, at[face[a]], [(a, ln if a == 0x40114b else None, mn, parts, None, pnotes.get(a))], 4, lead=4) - gaps = [a for a in order if a in ONLY and a not in skipped] g.t(LEFT + 400, at[0x523d34] + 18, "the check: plain has nothing here", 18, FAINT, "sans") + # the turn's one byte, in each build's buf: the store struck, the reading one letter longer + frame_dump(g, LEFT, 740, "plain · buf", "the turn's byte", PLAIN_ROWS[4:6], plain_mem(4, 3), plain_region, + struck=0x7fffffffecd3) + frame_dump(g, RIGHT, 740, "asan · buf", "its shadow, read before the store", ASAN_ROWS[4:6], asan_mem(4), + asan_region, shadow={0: 0, 1: 0}, read_shadow=0, struck=FAKE + 0x23) gen.caption(g, [[("Plain: one store. ASan: the address, its shadow byte (",), ("addr >> 3", "mono"), (" + ",), ("7fff8000", "mono"), ("),", )], [("a compare with 0, a branch; the partial check and the report only if it is not 0.",)]]) @@ -226,6 +434,7 @@ def sheet_store(name): if __name__ == "__main__": - frame("26-pair-rest", False) + frame("26-pair-rest", 15) sheet_store("27-pair-store") - frame("28-pair-part", True) + frame("28-pair-part", 16) + frame_ret("38-pair-ret") diff --git a/design/motion.md b/design/motion.md index a747e9d..9cfaa53 100644 --- a/design/motion.md +++ b/design/motion.md @@ -49,7 +49,8 @@ differently now: - The camera rests at x1.5 as well, and that is its usual scale: a frame of 1195 by 560. At x2 the frame is 896 by 420. It always returns. - Above the working frame there is the map, the same moment with every - panel whole, and in the working frame's corner the minimap. A scene goes + panel whole, and in each pane of the working frame its column of the map, + small, as its minimap. A scene goes between them by `dive` and `surface` (below, "The map and the working frame"). - Down is deeper: a call the narration follows opens its callee's window @@ -817,14 +818,17 @@ the middle third. If they move out of it the frame glides a whole row ### The map and the working frame -The working frame's panels are windows onto the map's columns; the -minimap in its corner is the map at a twentieth, with the windows drawn on -it. Going between the two is the most cinematic move there is, and the -rule for it is the camera's: the viewer never loses where they are. So it -is one continuous move, in which nothing appears and nothing jumps: the -windows rise out of the map and become the panels while the map falls -away into the corner and becomes the minimap, the windows' outlines riding -on it. It is not a camera move on one world (the working frame is not a +The working frame's panels are windows onto the map's columns, and each +pane's minimap is its column, small, with its window drawn on it. Going +between the two is the most cinematic move there is, and the rule for it +is the camera's: the viewer never loses where they are. So it is one +continuous move, in which nothing appears and nothing jumps: the windows +rise out of the map and become the panels, and the column each was a +window on squeezes after it into the pane's strip, the window's outline +riding on it; what no pane takes fades where it is. Each column ends +where its window ends: the eye that followed the window finds its column +beside it. (The corner minimap it replaces made the whole map fall into +one corner, where the eye had to go looking for it.) It is not a camera move on one world (the working frame is not a crop of the map: there the source is over the disassembly, here beside it) and not a `relayout` (that keeps the text's size): every panel has its own path and its own scale. @@ -836,16 +840,18 @@ own path and its own scale. | before | the map is still and the caption that says where we are going has been up 60 f | | 0 to 6 | the windows' outlines go bright | | 6 to 24 | the rest of the map takes the veil, 50% | -| 24 to 96 | each window travels to its panel's place, its scale from a half to whole on its logarithm, `glide`; the panels set off 6 f apart in the frame's reading order (drawing, view, source, registers, disassembly, stack), each drawn over the ones before, so that two crossing are seen to cross. The map, veiled, travels the same 72 f to the minimap's rect (1664, 912, 192 by 108), its scale from a half to a twentieth on its logarithm: continuously, never dropped or hidden on the way | -| 90 to 96 | as it lands, the falling map crossfades into the minimap's own drawing | +| 24 to 96 | each window travels to its panel's place, its scale from a half to whole on its logarithm, `glide`; the panels set off 6 f apart in the frame's reading order (drawing, view, source, registers, disassembly, stack), each drawn over the ones before, so that two crossing are seen to cross. With each, the same 72 f and the same stagger, the rest of its column (the map's panel it is a window on: the file, the 69 instructions, the stack from 16 words above rsp, the region's dump) squeezes into the pane's strip: from its place at half size to the strip's rect, its width and its height each on its logarithm (to 36 of 880; to 4 of 24 a row), its window's outline riding on it. The registers' and the drawing's windows are their panels whole and bring no column | +| 24 to 72 | the map's parts no pane takes (the backtrace, the key, the memory round the pointers, a loupe's panel) fade where they are, veiled | | 72 to 96 | the drawing crossfades from the map's size to the frame's within its box | -| 84 to 102 | the working frame's tags, rules and lanes fade in; the veil on the map lifts as it lands; the clock's count fades in | +| 84 to 102 | each squeezed column crossfades into its strip's strokes (12 f); the working frame's tags, rules and lanes fade in; the clock's count fades in (mock 20) | | 102 to 138 | still | `surface` is the same backwards and a little quicker (the eye already -knows the map): the tags fade (12 f), the panels shrink into their windows -as the minimap grows to fill the frame (72 f, `glide`, the same stagger in -the reverse order), the veil lifts (12 f), 36 f still. +knows the map): the tags fade (12 f) and each strip's strokes become its +column's text, the panels shrink into their windows as each strip unfolds +into the column round its window and the map's other parts fade in where +they are (72 f, `glide`, the same stagger in the reverse order), the veil +lifts (12 f), 36 f still. What is played on the map, and why: @@ -861,10 +867,14 @@ What is played on the map, and why: - **A long run** may stay in the working frame; it surfaces only if it leaves the windows. -In the working frame the minimap is secondary action: its windows glide -with their scrolls (24 f), a mark no window shows `flash`es on it once -(12 f) as it is struck, and every change on it starts 6 f after the -primary onset it follows, never on that frame. A scene that opens on the map establishes it (0 to 48), its +In the working frame each pane's minimap is secondary action: its window +glides with the pane's scroll (24 f); a mark the window does not show +`flash`es on its row in the strip once (12 f) as it is struck; a jump to a +row of the same column farther than the window's height shows there +first, the gold lighting on its new row and the window gliding to it (24 +f) before the pane fades through (12 out, 12 in), so the eye knows where +the pane went before it changes; and every change on a strip starts 6 f +after the primary onset it follows, never on that frame. A scene that opens on the map establishes it (0 to 48), its first caption at 60, dives at 150, and has its first step by 300 (5.0 s). ### Captions, opening, closing @@ -1060,9 +1070,10 @@ whole, from its start to the top's header (rows round what was touched, fieldless ones folded), the tcache as its own panel under it, and the arena (`main_arena`, in libc's data, far from the heap) as a dump by fields: `top`, `last_remainder`, `system_mem`, `flags`, and the bins' -heads. On the minimap those three are where they sit; a strike on one no -window shows (the top's header moving down when the tcache is cut from -it) flashes there. +heads. The view's minimap is the heap's column; a strike on a row its +window does not show (the top's header moving down when the tcache is +cut from it) flashes there, and the tcache's and the arena's panels, which +no pane shows, are the map's alone. **The beats.** Each `free` and the `malloc` that takes the head back are walked; pushes 2 and 3 are a run, which draws no strikes and no arcs and @@ -1114,7 +1125,7 @@ The first free, frame by frame, from its fire: | 18 to 30 | the registers `free` left changed, struck in a wave 2 f apart (`rax`, `rcx` 405, `rdx`, `rsi`, `r8`, `r10`): it was stepped over, so as a `continue` | | 54 to 66, 66 | memory: the chunk's first word armed and struck on its two bytes that changed (`05 04`), 1 f apart, the held corner to come on the first | | 72 to 80 | its second word, the key, its 8 bytes 1 f apart | -| 90 to 102 | the next chunk's header struck on its three bytes that changed (`01 03 00`): the tcache's chunk, cut from the top at this first free; the top's own header has left the window and flashes on the minimap (6 f after) | +| 90 to 102 | the next chunk's header struck on its three bytes that changed (`01 03 00`): the tcache's chunk, cut from the top at this first free; the top's own header has left the window and flashes on the view's minimap (6 f after) | | 102 to 138 | `open`: the loupe on the tcache, over the stack, its stem down the gutter from that row; its two fields framed | | 144, 150 | in the loupe: `num_slots[0]` struck on its one byte (16 to 15), then `entries[0]` on its three (`50 50 40`) | | 162 to 174 | the idea: the `bin`'s box crossfades from dashed to raised, `dummy tcache` to `tcache 0x20`, and the top's box crossfades to its new place and size, `0x20ca0` struck | @@ -1196,7 +1207,7 @@ default, and with it the plain build dies in `__stack_chk_fail` instead of at `ret`), each recorded by instruction from `fill`. The program is [`mock/overflow.c`](mock/overflow.c): `char buf[16]; for (int i = 0; i < 32; i++) buf[i] = 'A';` in a function of its own. Every figure here is -those two recordings' (mocks 26 to 28). +those two recordings' (mocks 26 to 28 and 38). **The program and its frame.** The tracer's tested `targets/overflow.c` (a bound `n`, gcc's layout) keeps `i` and `n` above the buffer at -O0: the @@ -1218,9 +1229,13 @@ second scene. 64 bytes): a header (magic `41b58ab3`, a descriptor `"1 32 16 5 buf:3"`, the pc, the real stack), `buf` at +0x20, a redzone at +0x30; the real stack holds only spills, the saved rbp and the return address, far away. - The two stack panels are scrolled so that `buf` faces `buf`: then plain's - saved rbp faces ASan's redzone, and its return address the redzone's - second word. That facing is the scene. + Each column shows its frame as bytes, eight a row, read by the frame's + own fields ([`hexdump`](README.md#hexdump) `eight`), not as the stack + panel's words: a store here is one byte, and a word going `41`, `4141`, + `414141` would hide both the letter and the field it lands in. The two + are scrolled so that `buf` faces `buf`: then plain's saved rbp faces + ASan's redzone, and its return address the redzone's second word. That + facing is the scene. - *The code.* Line 4's store is one instruction plain (`mov [rbp + rax - 0x10]▮, 0x41`), eight a turn; ASan's turn is seventeen: the address, `shr rax, 3`, the shadow's load at `rax + @@ -1231,8 +1246,17 @@ second scene. `f1 f1 f1 f1 f8 f8 f3 f3`; line 3, which plain has no instruction for, turns `f8 f8` to `00 00` (buf's scope begins). - *The shadow.* One byte for each word of the fake frame, on the word's own - row of the stack panel ([`slot`](README.md#slot)): `f1` four times (the + row of the frame's bytes, before its address: `f1` four times (the header), `00 00` (buf), `f3 f3` (the redzone). +- *The letters.* Each turn stores one byte, `41`, and `buf`'s reading + grows a letter, `"AAAA"`; the `41` beside `A` says what it is. Past + `buf` the letters keep the string's ink in plain's saved rbp and then + its return address, while those fields read what the CPU will: the + saved rbp `→ 7fffffffed41` (i = 16) to `0x4141414141414141` (i = 23); + the return address `→ 401134 main+20`, then `→ 401141 fill+1` (i = 24, + still code), `→ 404141` (25, plain's data page), `0x414141` (26) and + `0x41414141` (27, mock 38), no longer addresses, to `0x4141414141414141` + (31): the crash foretold. - *When they part.* At i = 16: plain's store writes `41` into the saved rbp's low byte (7fffffffed00 becomes 7fffffffed41); ASan's check loads `f3`, `je` is not taken, the partial check (`0 : f3`, signed 0 against @@ -1262,13 +1286,16 @@ loop; inside it each side walks its own rows (README, `pair`). | 1273 | 1651 | Before each store ASan reads buf[i]'s byte of shadow, at (addr >> 3) + 7fff8000. | i = 0, the check, 1333 | ASan's address and check rows walked, 36 f a row, the shadow cell framed as read when its load runs; plain's plaque waits on the row facing them | | 1669 | 2076 | It is 00: the store may go. Both write 'A'; plain in one instruction, ASan in seventeen. | i = 0, the stores, 1729 | both stores strike together (6 f apart, plain first), each side's `i++` | | 2094 | 2736 | Fourteen more turns, at a run: buf fills on both sides. | i = 1 to 14, a run, 2154 | a run: no strikes, no corners; buf's bytes change in place; settled at the end | -| 2754 | 3118 | i = 15, the last byte of buf. Still 00 on ASan's side; still buf on plain's. | i = 15, walked, 2814 | both walked; the last 00 read | -| 3136 | 3528 | i = 16, one past buf. Plain writes 'A' into the saved rbp; ASan reads f3, a redzone. | i = 16, they part, 3196 | the chart below | +| 2754 | 3118 | i = 15, the last byte of buf. Still 00 on ASan's side; still buf on plain's. | i = 15, walked, 2814 | both walked; the last 00 read; each `buf` reads `"AAAAAAAAAAAAAAAA"` across its two rows (mock 26 is the instant before the store) | +| 3136 | 3528 | i = 16, one past buf. Plain writes 41, an 'A', into the saved rbp; ASan reads f3, a redzone. | i = 16, they part, 3196 | the chart below (mock 28) | | 3546 | 3967 | ASan's branch to the store is not taken: it calls the report, which names buf and the write. | the report, 3606 | ASan's partial check and its call walked; its run stops: its registers give way to its stderr, the report's lines, the three the caption names framed | -| 3985 | 4495 | Plain goes on alone: the saved rbp, then the return address, become AAAAAAAA. | i = 17 to 31, a run, 4045 | plain alone at a run; ASan's side holds its last picture; at the run's end the saved rbp and return address settled at `4141414141414141`, `differs` on their rows | -| 4513 | 4903 | The loop ends; pop rbp, then ret to 4141414141414141: the CPU faults. SIGSEGV. | the loop's exit, `pop`, `ret`, 4573 | walked: rbp struck; `ret` faults: the `fault` mark on its row, hazard bands round an ink plaque, `SIGSEGV`; rip stays | +| 3985 | 4320 | Plain goes on alone, a byte a turn: the A's fill the saved rbp. | i = 17 to 23, a run, 4045 | plain alone at a run, 18 f a turn: each turn's byte changes in place (8 f), a letter crossing the saved rbp's bytes one by one, its reading changing with them; settled at `0x4141414141414141`, `differs` on the row; ASan's side holds its last picture | +| 4338 | 4706 | i = 24: the first A reaches the return address. It reads fill+1: still code. | i = 24, walked, 4398 | the store struck on the return address's first byte, `34` to `41`; its reading crossfades from `→ 401134 main+20` to `→ 401141 fill+1` (12 f), still code's ink | +| 4724 | 5060 | Three turns on it is half A's: 41414141, no longer an address. | i = 25 to 27, walked, 72 f a turn, 4784 | each store struck; the reading `→ 404141`, then `0x414141`, then `0x41414141`: the arrow and the ink gone when it stops being an address (mock 38) | +| 5078 | 5366 | The rest at a run: it ends as 4141414141414141. | i = 28 to 31, a run, 5138 | the last four bytes change in place; settled at `0x4141414141414141` | +| 5384 | 5774 | The loop ends; pop rbp, then ret to 4141414141414141: the CPU faults. SIGSEGV. | the loop's exit, `pop`, `ret`, 5444 | walked: rbp struck; `ret` faults: the `fault` mark on its row, hazard bands round an ink plaque, `SIGSEGV`; rip stays | -The cut at 5023, 83.7 s, after 2 s on the two last pictures: a fault on +The cut at 5894, 98.2 s, after 2 s on the two last pictures: a fault on the left, a report on the right. **The step in which they part** (i = 16), from its fire: @@ -1278,8 +1305,8 @@ the left, a report on the right. | 0 to 12 | fire on line 4, both sides' plaques on the turn's first row | | 18 to 66 | plain walks to its store, its rows spread over the time ASan takes to reach its check: ASan's address rows, 12 f each | | 72 to 78 | the two first different rows framed `attention`, one each side: plain's store, ASan's shadow load | -| 84 to 96, 96 | plain: arm, strike the saved rbp's low byte, `00` to `41`; the row's value turns to 7fffffffed41 (`extend`) and its `differs` bar comes in (12 f) | -| 102 to 108 | ASan: the shadow load's cell, `f3`, framed as read, and the load's annotation reads it | +| 84 to 96, 96 | plain: arm, strike the saved rbp's first byte, `00` to `41`, the letter in a string's ink among the pointer's; the field's reading crossfades from `→ 7fffffffed00` to `→ 7fffffffed41` (12 f) and its `differs` bar comes in (12 f) | +| 102 to 108 | ASan: the shadow load's cell, `f3`, framed as read, and the load's annotation reads it; the redzone's bytes beside it stay `00` | | 114 to 126 | ASan: `cmp al, 0`, its values `f3 : 0` and `zf` | | 132 to 150 | ASan: `je` not taken, its row's annotation `not taken`; plain's plaque goes on to `i++` | | 186 to 222 | hold | @@ -1292,7 +1319,10 @@ frame the window shows, each with the 8 application bytes it stands for; which words are a fake frame (ASan's fake stack mapping, the frame's base and size class) and its header decoded (magic, the descriptor's variables with their offsets, sizes and lines, the pc); the red zone under rsp (the -plain build's `buf` and `i` live there); names for ASan's runtime +plain build's `buf` and `i` live there); the frame's fields for its +dump by bytes, by name, offset and size (the debug info's locals; the +saved registers and the return address from the call frame information); +names for ASan's runtime (`__asan_report_store1`, `__asan_stack_malloc_0`); the run's stderr as written, by stop (the report's lines arrive by `write(2, …)`, 18 of them, 1.5 M to 4.7 M instructions after the call: a `continue` to the exit); a @@ -1351,7 +1381,7 @@ that emptiness; nothing else does. A panel's tag and rule come last | 78 | 378 | Code is bytes too. 48 8b 7f 08 is one instruction. | 198 | the code's bytes as a dump row in code's ink; one instruction's bytes framed | | 396 | 796 | Decoded: mov rdi, [rdi + 8]. It came from line 21: each line sits level with its code. | 456 | `decode`, the instruction walked and its neighbours at a run; the source's lines arrive level with their runs: `aligned`, `interleaved` (mock 32) | | 814 | 1160 | rdi pointed at a list node on the heap. Its bytes, and drawn, the node. | 874 | `stack`: the aligned columns become the program column; the heap's dump arrives in the band's right half, then the nodes drawn from it (`establish`) | -| 1178 | 1491 | This is the whole frame. Every view in it is these same bytes. | 1238 | the camera out to x1; the minimap draws itself last: the working frame of mock 9, assembled | +| 1178 | 1491 | This is the whole frame. Every view in it is these same bytes. | 1238 | the camera out to x1; each pane's minimap draws itself last, top down: the working frame of mock 9, assembled | | 1509 | 1809 | And all of it at once: the map. | 1569 | `surface` | Every caption is up its reading time and at most 450 f, leads its step @@ -1435,7 +1465,7 @@ python3 motion.py track VIDEO f139 f158 --color e8c46a # a colour's b scene's layout (a table at the top of the script, keyed by the video's name; add a scene there). Any other name gets the working frame's: the program column, the state column, the caption's text alone (64 to 1464, -906 to 1032, clear of the clock's count), the clock and the minimap. A pixel *moved* if a channel changed by more than +906 to 1032, clear of the clock's count), the clock and the minimap (the corner one, which the videos still have; the per-pane strips want regions of their own here, by split). A pixel *moved* if a channel changed by more than 24 of 255 and is *fading* if by more than 6. The picture is one bar a frame and one strip a region: solid for moving, outlined for fading, holds shaded with their length. The text lists every event with the first and -- cgit v1.3