From fa5d150ac6977264f0704e9af664f8150bd25127 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 22:50:34 -0300 Subject: design: arc, a pointer to a row of its own panel is drawn From the user, on the loupe's mock: a pointer in memory named a row two above it and nothing showed it. In a dump, a loupe and the stack a pointer whose target is a row of the same panel is an arc in a lane at the panel's edge, as a jump is in the disassembly: quiet while it stands, full ink in the step that writes or reads it, a stub when the target is just off the window. A chain shares a lane. A loupe carries the arcs among its own rows; the stack's frame chain gets one only when touched. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- design/mock/09-context-480.png | Bin 36225 -> 36400 bytes design/mock/09-context.png | Bin 234918 -> 235217 bytes design/mock/09-context.svg | 112 ++++++++-------- design/mock/10-context-step-480.png | Bin 37263 -> 37253 bytes design/mock/10-context-step.png | Bin 239058 -> 239232 bytes design/mock/10-context-step.svg | 112 ++++++++-------- design/mock/11-context-lens-480.png | Bin 36483 -> 36630 bytes design/mock/11-context-lens.png | Bin 227267 -> 227838 bytes design/mock/11-context-lens.svg | 134 ++++++++++--------- design/mock/12-calls-subject-480.png | Bin 32985 -> 33189 bytes design/mock/12-calls-subject.png | Bin 201791 -> 201794 bytes design/mock/12-calls-subject.svg | 8 +- design/mock/13-sqlite-row-480.png | Bin 32655 -> 32488 bytes design/mock/13-sqlite-row.png | Bin 227685 -> 227680 bytes design/mock/13-sqlite-row.svg | 166 +++++++++++------------ design/mock/14-sqlite-page-480.png | Bin 37579 -> 37621 bytes design/mock/14-sqlite-page.png | Bin 236736 -> 236738 bytes design/mock/14-sqlite-page.svg | 44 +++--- design/mock/15-marks-480.png | Bin 18542 -> 18436 bytes design/mock/15-marks.png | Bin 264805 -> 265080 bytes design/mock/15-marks.svg | 126 +++++++++--------- design/mock/19-map-1080.png | Bin 1018023 -> 1021707 bytes design/mock/19-map-480.png | Bin 45132 -> 45442 bytes design/mock/19-map.png | Bin 905335 -> 908493 bytes design/mock/19-map.svg | 252 +++++++++++++++++++---------------- design/mock/21-loupe-480.png | Bin 38289 -> 38432 bytes design/mock/21-loupe.png | Bin 245970 -> 246423 bytes design/mock/21-loupe.svg | 200 +++++++++++++-------------- design/mock/context.py | 76 +++++++++-- design/mock/dense.py | 2 +- design/mock/map.py | 9 +- 31 files changed, 667 insertions(+), 574 deletions(-) (limited to 'design/mock') diff --git a/design/mock/09-context-480.png b/design/mock/09-context-480.png index 2a2f016..3e5996b 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 f18173a..41cd918 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 3e0a7c5..4000a2d 100644 --- a/design/mock/09-context.svg +++ b/design/mock/09-context.svg @@ -263,8 +263,8 @@ stack eight words from rsp · the frames they belong to -rbp rsp - +rbp rsp + +0 saved rbp 7fffffffe @@ -351,11 +351,11 @@ its bytes the heap, 1004070 to 10040bf - - - -10040 -70 + + + +10040 +70 09 00 @@ -378,11 +378,11 @@ 1004050 - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -400,11 +400,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -427,11 +427,11 @@ 1004070 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -449,11 +449,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -474,6 +474,8 @@ 00 00 NULL + + @@ -1185,8 +1187,8 @@ - - + + @@ -1204,8 +1206,8 @@ - - + + @@ -1226,8 +1228,8 @@ - - + + @@ -1245,8 +1247,8 @@ - - + + @@ -1267,8 +1269,8 @@ - - + + @@ -1286,8 +1288,8 @@ - - + + @@ -1308,8 +1310,8 @@ - - + + @@ -1327,8 +1329,8 @@ - - + + @@ -1349,8 +1351,8 @@ - - + + @@ -1368,8 +1370,8 @@ - - + + @@ -1390,8 +1392,8 @@ - - + + @@ -1409,8 +1411,8 @@ - - + + @@ -1431,8 +1433,8 @@ - - + + @@ -1450,7 +1452,7 @@ - + @@ -1577,7 +1579,7 @@ - + diff --git a/design/mock/10-context-step-480.png b/design/mock/10-context-step-480.png index c3eb3b9..57090bb 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 41ecdc4..fee3594 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 1b9db57..de52e22 100644 --- a/design/mock/10-context-step.svg +++ b/design/mock/10-context-step.svg @@ -264,8 +264,8 @@ stack eight words from rsp · the frames they belong to -rbp rsp - +rbp rsp + +0 saved rbp 7fffffffe @@ -352,11 +352,11 @@ its bytes the heap, 1004070 to 10040bf - - - -10040 -70 + + + +10040 +70 09 00 @@ -379,11 +379,11 @@ 1004050 - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -401,11 +401,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -429,11 +429,11 @@ 1004070 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -451,11 +451,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -476,6 +476,8 @@ 00 00 NULL + + @@ -1197,8 +1199,8 @@ - - + + @@ -1216,8 +1218,8 @@ - - + + @@ -1238,8 +1240,8 @@ - - + + @@ -1257,8 +1259,8 @@ - - + + @@ -1279,8 +1281,8 @@ - - + + @@ -1298,8 +1300,8 @@ - - + + @@ -1320,8 +1322,8 @@ - - + + @@ -1339,8 +1341,8 @@ - - + + @@ -1361,8 +1363,8 @@ - - + + @@ -1380,8 +1382,8 @@ - - + + @@ -1402,8 +1404,8 @@ - - + + @@ -1421,8 +1423,8 @@ - - + + @@ -1443,8 +1445,8 @@ - - + + @@ -1462,7 +1464,7 @@ - + @@ -1589,7 +1591,7 @@ - + diff --git a/design/mock/11-context-lens-480.png b/design/mock/11-context-lens-480.png index 4c4a0f5..d4746ff 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 e0b9122..631e45c 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 d0d3bf3..eae34f3 100644 --- a/design/mock/11-context-lens.svg +++ b/design/mock/11-context-lens.svg @@ -250,8 +250,8 @@ stack six words from rsp · the frames they belong to -rbp rsp - +rbp rsp + +0 saved rbp 7fffffffe @@ -316,11 +316,11 @@ its bytes the heap, 1004050 to 10040bf - - - -10040 -50 + + + +10040 +50 10 00 @@ -343,11 +343,11 @@ 1004030 - - - -10040 -60 + + + +10040 +60 00 00 00 @@ -365,11 +365,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -70 + + + +10040 +70 09 00 @@ -392,11 +392,11 @@ 1004050 - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -414,11 +414,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -442,11 +442,11 @@ 1004070 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -464,11 +464,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -489,6 +489,10 @@ 00 00 NULL + + + + @@ -1210,8 +1214,8 @@ - - + + @@ -1229,8 +1233,8 @@ - - + + @@ -1251,8 +1255,8 @@ - - + + @@ -1270,8 +1274,8 @@ - - + + @@ -1292,8 +1296,8 @@ - - + + @@ -1311,8 +1315,8 @@ - - + + @@ -1333,8 +1337,8 @@ - - + + @@ -1352,8 +1356,8 @@ - - + + @@ -1374,8 +1378,8 @@ - - + + @@ -1393,8 +1397,8 @@ - - + + @@ -1415,8 +1419,8 @@ - - + + @@ -1434,8 +1438,8 @@ - - + + @@ -1456,8 +1460,8 @@ - - + + @@ -1475,7 +1479,7 @@ - + @@ -1602,7 +1606,7 @@ - + diff --git a/design/mock/12-calls-subject-480.png b/design/mock/12-calls-subject-480.png index 935056a..2501db2 100644 Binary files a/design/mock/12-calls-subject-480.png and b/design/mock/12-calls-subject-480.png differ diff --git a/design/mock/12-calls-subject.png b/design/mock/12-calls-subject.png index 9583bf8..61f349d 100644 Binary files a/design/mock/12-calls-subject.png and b/design/mock/12-calls-subject.png differ diff --git a/design/mock/12-calls-subject.svg b/design/mock/12-calls-subject.svg index 32d6452..3fbf152 100644 --- a/design/mock/12-calls-subject.svg +++ b/design/mock/12-calls-subject.svg @@ -242,8 +242,8 @@ stack six words from rsp · the frames they belong to -rsp - +rsp + +0 7fffffffed 78 @@ -278,8 +278,8 @@ 7ffff7ffd000 vdso+0 -rbp - +rbp + +28 saved rbp 7fffffffed diff --git a/design/mock/13-sqlite-row-480.png b/design/mock/13-sqlite-row-480.png index 3674630..aacd128 100644 Binary files a/design/mock/13-sqlite-row-480.png and b/design/mock/13-sqlite-row-480.png differ diff --git a/design/mock/13-sqlite-row.png b/design/mock/13-sqlite-row.png index fe4dc79..3330d15 100644 Binary files a/design/mock/13-sqlite-row.png and b/design/mock/13-sqlite-row.png differ diff --git a/design/mock/13-sqlite-row.svg b/design/mock/13-sqlite-row.svg index 585a686..101dd32 100644 --- a/design/mock/13-sqlite-row.svg +++ b/design/mock/13-sqlite-row.svg @@ -233,8 +233,8 @@ stack six words from rsp · the frames they belong to -rbp rsp - +rbp rsp + +0 saved rbp 7fffffffe9 @@ -337,87 +337,87 @@ its bytes pX, the row: a BtreePayload, at rsi - - - -7fffffffea -60 - -00 -00 -00 -00 -00 -00 -00 -00 -NULL - - -01 -00 -00 -00 -00 -00 -00 -00 -1 - - - -7fffffffea -70 - -88 -4d -52 -00 -00 -00 -00 -00 - - -524d88 - -00 -00 -00 -00 -00 -00 -00 -00 -NULL - - - -7fffffffea -80 - -00 -00 -0 -00 -00 - - -07 -00 -00 -00 -7 - -00 -00 -00 -00 -0 -01 -00 -00 -00 + + + +7fffffffea +60 + +00 +00 +00 +00 +00 +00 +00 +00 +NULL + + +01 +00 +00 +00 +00 +00 +00 +00 +1 + + + +7fffffffea +70 + +88 +4d +52 +00 +00 +00 +00 +00 + + +524d88 + +00 +00 +00 +00 +00 +00 +00 +00 +NULL + + + +7fffffffea +80 + +00 +00 +0 +00 +00 + + +07 +00 +00 +00 +7 + +00 +00 +00 +00 +0 +01 +00 +00 +00 moment 9 of 58 diff --git a/design/mock/14-sqlite-page-480.png b/design/mock/14-sqlite-page-480.png index 6d2f4f6..aed0f9e 100644 Binary files a/design/mock/14-sqlite-page-480.png and b/design/mock/14-sqlite-page-480.png differ diff --git a/design/mock/14-sqlite-page.png b/design/mock/14-sqlite-page.png index fb70150..40739fd 100644 Binary files a/design/mock/14-sqlite-page.png and b/design/mock/14-sqlite-page.png differ diff --git a/design/mock/14-sqlite-page.svg b/design/mock/14-sqlite-page.svg index 6c81055..c22705b 100644 --- a/design/mock/14-sqlite-page.svg +++ b/design/mock/14-sqlite-page.svg @@ -299,8 +299,8 @@ 2 -rbp - +rbp + +40 saved rbp 7fffffffe7 @@ -445,11 +445,11 @@ its bytes pBuf: page 2 of t.db, at rsi - - - -53 -8b28 + + + +53 +8b28 0d @@ -487,17 +487,17 @@ 4070 00 00 - - - - + + -253 rows - - - -53 -9b08 + + +253 rows + + + +53 +9b08 00 00 00 @@ -521,11 +521,11 @@ "gamma" 06 - - - -53 -9b18 + + + +53 +9b18 02 2 diff --git a/design/mock/15-marks-480.png b/design/mock/15-marks-480.png index ad7f92c..3dca0af 100644 Binary files a/design/mock/15-marks-480.png and b/design/mock/15-marks-480.png differ diff --git a/design/mock/15-marks.png b/design/mock/15-marks.png index a295ec1..5a68341 100644 Binary files a/design/mock/15-marks.png and b/design/mock/15-marks.png differ diff --git a/design/mock/15-marks.svg b/design/mock/15-marks.svg index 32d55db..2c44a39 100644 --- a/design/mock/15-marks.svg +++ b/design/mock/15-marks.svg @@ -167,11 +167,11 @@ its bytes moment 4: the store, struck; 10040b8, held - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -189,11 +189,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -216,11 +216,11 @@ 10040b0 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -238,11 +238,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -263,6 +263,8 @@ 00 00 NULL + + b0 @@ -506,11 +508,11 @@ its bytes moment 4: the store, struck; 10040b8, held - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -528,11 +530,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -555,11 +557,11 @@ 10040b0 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -577,11 +579,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -602,6 +604,8 @@ 00 00 NULL + + b0 @@ -846,11 +850,11 @@ its bytes moment 4: the store, struck; 10040b8, held - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -868,11 +872,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -895,11 +899,11 @@ 10040b0 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -917,11 +921,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -942,6 +946,8 @@ 00 00 NULL + + b0 diff --git a/design/mock/19-map-1080.png b/design/mock/19-map-1080.png index e6e6d0e..3f8ed45 100644 Binary files a/design/mock/19-map-1080.png and b/design/mock/19-map-1080.png differ diff --git a/design/mock/19-map-480.png b/design/mock/19-map-480.png index 7ba1436..5c08c28 100644 Binary files a/design/mock/19-map-480.png and b/design/mock/19-map-480.png differ diff --git a/design/mock/19-map.png b/design/mock/19-map.png index f4c5dc3..b9313a6 100644 Binary files a/design/mock/19-map.png and b/design/mock/19-map.png differ diff --git a/design/mock/19-map.svg b/design/mock/19-map.svg index 81216ee..cd2def6 100644 --- a/design/mock/19-map.svg +++ b/design/mock/19-map.svg @@ -719,11 +719,11 @@ memory the heap, round what the step reads - - - -10040 -00 + + + +10040 +00 00 00 00 @@ -741,11 +741,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -10 + + + +10040 +10 24 00 @@ -766,11 +766,11 @@ 00 00 NULL - - - -10040 -20 + + + +10040 +20 00 00 00 @@ -788,11 +788,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -30 + + + +10040 +30 19 00 @@ -815,11 +815,11 @@ 1004010 - - - -10040 -40 + + + +10040 +40 00 00 00 @@ -837,11 +837,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -50 + + + +10040 +50 10 00 @@ -864,11 +864,11 @@ 1004030 - - - -10040 -60 + + + +10040 +60 00 00 00 @@ -886,11 +886,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -70 + + + +10040 +70 09 00 @@ -913,11 +913,11 @@ 1004050 - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -935,11 +935,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -963,11 +963,11 @@ 1004070 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -985,11 +985,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -1010,11 +1010,11 @@ 00 00 NULL - - - -10040 -c0 + + + +10040 +c0 00 00 00 @@ -1032,12 +1032,20 @@ 00 00 malloc's: the top chunk - - - - + + -19 rows + + +19 rows + + + + + + + + @@ -1159,11 +1167,11 @@ → 1004070 heap · struct node, 16 bytes - - - -10040 -30 + + + +10040 +30 19 00 @@ -1186,11 +1194,11 @@ 1004010 - - - -10040 -40 + + + +10040 +40 00 00 00 @@ -1208,11 +1216,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -50 + + + +10040 +50 10 00 @@ -1235,11 +1243,11 @@ 1004030 - - - -10040 -60 + + + +10040 +60 00 00 00 @@ -1257,11 +1265,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -70 + + + +10040 +70 09 @@ -1286,11 +1294,11 @@ 1004050 - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -1308,11 +1316,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -1335,11 +1343,11 @@ 1004070 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -1357,11 +1365,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -1382,6 +1390,12 @@ 00 00 NULL + + + + + + @@ -1435,8 +1449,8 @@ -8 7fffffffecd8 7ffff7ffd000 -rbp rsp - +rbp rsp + +0 saved rbp 7fffffffe @@ -1834,6 +1848,10 @@ 6 + + + + diff --git a/design/mock/21-loupe-480.png b/design/mock/21-loupe-480.png index 7c109c3..4f9f28e 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 d22fe69..56c85d7 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 9e5f457..8108808 100644 --- a/design/mock/21-loupe.svg +++ b/design/mock/21-loupe.svg @@ -264,8 +264,8 @@ stack eight words from rsp · the frames they belong to -rbp rsp - +rbp rsp + +0 saved rbp 7fffffffe @@ -352,11 +352,11 @@ its bytes the heap, 1004070 to 10040bf - - - -10040 -70 + + + +10040 +70 09 00 @@ -379,11 +379,11 @@ 1004050 - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -401,11 +401,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -429,11 +429,11 @@ 1004070 - - - -10040 -a0 + + + +10040 +a0 00 00 00 @@ -451,11 +451,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -b0 + + + +10040 +b0 01 00 @@ -544,11 +544,11 @@ → 1004070 heap · struct node, 16 bytes - - - -10040 -50 + + + +10040 +50 10 00 @@ -571,11 +571,11 @@ 1004030 - - - -10040 -60 + + + +10040 +60 00 00 00 @@ -593,11 +593,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -70 + + + +10040 +70 09 @@ -622,11 +622,11 @@ 1004050 - - - -10040 -80 + + + +10040 +80 00 00 00 @@ -644,11 +644,11 @@ 00 00 malloc's: a chunk of 32 - - - -10040 -90 + + + +10040 +90 04 00 @@ -671,6 +671,10 @@ 1004070 + + + + @@ -1326,8 +1330,8 @@ - - + + @@ -1345,8 +1349,8 @@ - - + + @@ -1367,8 +1371,8 @@ - - + + @@ -1386,8 +1390,8 @@ - - + + @@ -1408,8 +1412,8 @@ - - + + @@ -1427,8 +1431,8 @@ - - + + @@ -1449,8 +1453,8 @@ - - + + @@ -1468,8 +1472,8 @@ - - + + @@ -1490,8 +1494,8 @@ - - + + @@ -1509,8 +1513,8 @@ - - + + @@ -1531,8 +1535,8 @@ - - + + @@ -1550,8 +1554,8 @@ - - + + @@ -1572,8 +1576,8 @@ - - + + @@ -1591,7 +1595,7 @@ - + @@ -1673,8 +1677,8 @@ - - + + @@ -1695,8 +1699,8 @@ - - + + @@ -1714,8 +1718,8 @@ - - + + @@ -1736,8 +1740,8 @@ - - + + @@ -1755,8 +1759,8 @@ - - + + @@ -1777,8 +1781,8 @@ - - + + @@ -1796,8 +1800,8 @@ - - + + @@ -1818,8 +1822,8 @@ - - + + @@ -1837,8 +1841,8 @@ - - + + @@ -1911,7 +1915,7 @@ - + diff --git a/design/mock/context.py b/design/mock/context.py index 069e894..8c99956 100644 --- a/design/mock/context.py +++ b/design/mock/context.py @@ -253,6 +253,41 @@ def pin_up(g, cx, y, names, ink, size, link=None, sw=3): g.t(cx + 9, by, " ".join(names[1:]), size, VELLUM, face) +def arcs(g, x, found, rows_y, lanes, touched=(), align=16): + """`arc`: for each (source row, field address, target address, ink), a pointer whose target row is in this + panel: from the source row's left, along a lane at x + lanes[k], to the target row's address, head first. Going + up it leaves its row at 9 and arrives at 15 (going down, 15 and 9), so a chain shares a lane; nested spans + take inner lanes, the longest outermost. Standing ones quiet (60% toward the page); those the step touches + full. A target out of the window, touched: a stub to the panel's rule. Returns how many were not drawn.""" + items = [] + for src, field, tgt, ink, edge in found: + ys = rows_y[src] + yt = rows_y.get(tgt - tgt % align) + if yt is None: + if field in touched and edge is not None: # out of the window: a stub, only for the step's pointer + up = edge < ys + items.append((abs(ys - edge), ys + (9 if up else 15), edge, ink, True, True)) + continue + up = yt < ys + items.append((abs(ys - yt), ys + (9 if up else 15), yt + (15 if up else 9), ink, field in touched, False)) + items.sort(key=lambda it: -it[0]) + taken, dropped = [[] for _ in lanes], 0 + for span, y0, y1, ink, hot, stub in items: + lo, hi = min(y0, y1), max(y0, y1) + k = next((k for k in range(len(lanes)) if all(hi < a or lo > z for a, z in taken[k])), None) + if k is None: + dropped += 1 + continue + taken[k].append((lo, hi)) + lx = x + lanes[k] + col = ink if hot else mix(ink, PAGE, 0.4) + if stub: + gen.arrow(g, [(x + 21, y0), (lx, y0), (lx, y1)], col, 2, r=4, hl=7, hw=8) + else: # from the row's left, to the row's left: the brackets and addresses untouched + gen.arrow(g, [(x + 21, y0), (lx, y0), (lx, y1), (x + 22, y1)], col, 2, r=4, hl=7, hw=8) + return dropped + + def bracket(g, x, y0, y1, ink, sw=2, serif=5, side=1): """A span of rows, marked at its edge: the end of a projection, or a thing that is a view of another.""" g.rect(x - sw / 2, y0, sw, y1 - y0, ink) @@ -297,7 +332,7 @@ def registers(g, y, regs, flags, marks): return where -def stack(g, y, rows, frames, note=None, rsp=None, roles=None): +def stack(g, y, rows, frames, note=None, rsp=None, roles=None, touched=(), chain_too=False): """rows: (slot, pins, links, end[, marks]). frames: (name, first row, last row), newest first: the backtrace, drawn on the words that are each frame; a first row under 0 runs above the window. The window is the newest frame's. A frame's name is never cut for a chain: the chains on the rows it sits on end 12 @@ -328,7 +363,7 @@ def stack(g, y, rows, frames, note=None, rsp=None, roles=None): yy = y0 + i * ROW ys.append(yy) if pins: - pin(g, RX + 10, yy, pins, STACK) + pin(g, RX + 16, yy, pins, STACK) if rsp is not None: # the offset from rsp, pwndbg's way: +18 off = slot - rsp g.t(RX + 172, b(yy), ("+%x" % off) if off >= 0 else ("-%x" % -off), S, FAINT, MONO, "end") @@ -342,6 +377,20 @@ def stack(g, y, rows, frames, note=None, rsp=None, roles=None): g.t(end_x, b(yy), text, S, ink, MONO, "end") end_x -= len(text) * A + 12 chain(g, first, yy, [(slot, STACK)] + links, end, marks[0] if marks else None, room=end_x, lead=lead) + # the arcs: a word holding the address of a slot in the window. The frame chain (a saved rbp) is the spans' + # already, and is drawn only when the step touches it. + slots = {r[0]: ys[i] for i, r in enumerate(rows)} + found = [] + for i, (slot, pins, links, end, *marks) in enumerate(rows): + if marks and marks[0].get("free") or not links: + continue + v = links[0][0] + is_chain = roles.get(i, ("",))[0] == "saved rbp" + if links[0][1] == STACK and (not is_chain or slot in touched or chain_too): + edge = y + TAG + 1 if v < rows[0][0] else ys[-1] + ROW + PAD - 1 + found.append((slot, slot, v, STACK, edge)) + arcs(g, RX, [(s0, f, t, ink, e) for s0, f, t, ink, e in found if t in slots or f in touched], slots, (4, 10), touched, + align=8) for i, name, x, ya, yb, ny, open_top, open_ in spans: ink = GOLD if i == 0 else RULE g.rect(x - 1, ya, 2, yb - ya, ink) @@ -468,7 +517,7 @@ def thread(g, ys, spans): # ---- the lens: a list, and beside it the bytes it is drawn from ------------------------- def fields(g, y, h, about, base, length, flist, mem, region, region_of, marks=(), title="its bytes", x=None, - framed=(), bare=False, rows_shown=None, more_rows=True): + framed=(), bare=False, rows_shown=None, more_rows=True, touched=(), withhold=None, hot=False): """`hexdump` by `fields`: the region a scene names, read by the fields it gives it, in the band's view. flist: (at, len, reads, big, mark) with reads in number | pointer | text | bytes. mem: {address: byte} of what the stop shown saw (or the kernel took); a byte not in it is unread. marks: the field marks framed as read. @@ -485,20 +534,21 @@ def fields(g, y, h, about, base, length, flist, mem, region, region_of, marks=() shown = rows_shown if rows_shown is not None else [r for r in range(total) if holds(r)] ys = {} digits = max(len("%x" % (base + 16 * r)) for r in shown) - shift = max(18 + digits * A + 12 - 132, 0) + shift = max(34 + digits * A + 12 - 132, 0) + found = [] bx = lambda i: X + 132 + shift + i * 30 + (12 if i >= 8 else 0) lead = shared([base + 16 * r for r in shown]) if len(shown) > 1 else 0 yy, last = y + TAG + PAD, None for r in shown: if last is not None and r > last + 1: # the rows left out: one row, and how many - more(g, X + 18 - 6, yy) - g.t(X + 18 + 30 + 36, b(yy), "%d rows" % (r - last - 1), S, FAINT, MONO) + more(g, X + 34 - 6, yy) + g.t(X + 34 + 30 + 36, b(yy), "%d rows" % (r - last - 1), S, FAINT, MONO) yy += ROW last = r a0 = base + 16 * r ys[a0] = yy - bracket(g, X + 7, yy + 3, yy + ROW - 3, mix(region, PAGE, 0.6)) - addr(g, X + 18, yy, a0, region, lead=lead) + bracket(g, X + 24, yy + 3, yy + ROW - 3, mix(region, PAGE, 0.6)) + addr(g, X + 34, yy, a0, region, lead=lead) runs, i = [], 0 while i < 16 and a0 + i < base + length: f = next((f for f in flist if base + f[0] <= a0 + i < base + f[0] + f[1]), None) @@ -544,6 +594,8 @@ def fields(g, y, h, about, base, length, flist, mem, region, region_of, marks=() g.t(x, b(yy) - 1, note, 18, FAINT, "sans") x += tw(note, 18, "sans") + A continue + if reads == "pointer" and word and base <= word < base + length: # a row of this panel: an arc too + found.append((a0, a0 + i0, word, region_of(word) or VELLUM, None)) if reads == "pointer": if word == 0: s_, sink = "NULL", DIM @@ -560,8 +612,12 @@ def fields(g, y, h, about, base, length, flist, mem, region, region_of, marks=() x += (len(s_) + 1) * A yy += ROW if more_rows and shown and shown[-1] < total - 1: # the rows after the last field: one row, and how many - more(g, X + 18 - 6, yy) - g.t(X + 18 + 30 + 36, b(yy), "%d rows" % (total - 1 - shown[-1]), S, FAINT, MONO) + more(g, X + 34 - 6, yy) + g.t(X + 34 + 30 + 36, b(yy), "%d rows" % (total - 1 - shown[-1]), S, FAINT, MONO) + top, foot = y + TAG + 1, yy + (ROW if more_rows and shown and shown[-1] < total - 1 else 0) + PAD - 1 + found = [(s0, f, t, ink, top if t < base + 16 * shown[0] else foot) for s0, f, t, ink, _ in found + if not (withhold and withhold[0] <= s0 < withhold[1] and withhold[0] <= t < withhold[1])] # a loupe has them + arcs(g, X, found, ys, (4, 10, 16), {f for _, f, _, _, _ in found} if hot else touched) # a loupe: all at full ink return ys diff --git a/design/mock/dense.py b/design/mock/dense.py index 4017d69..ce65d95 100644 --- a/design/mock/dense.py +++ b/design/mock/dense.py @@ -271,7 +271,7 @@ def loupe(g, x, y, title, note, base, flist, framed, depth, rows=9): xx += len(s_) * A g.t(x + CW - 10, y + 18, note, 18, DIM, "sans", "end") return C.fields(g, y, h, "", base, 16 * rows, flist, MEM, HEAP, region, framed=framed, bare=True, x=x, - more_rows=False) + more_rows=False, hot=True) def stem(g, pts): diff --git a/design/mock/map.py b/design/mock/map.py index 84e42fa..8e91ffa 100644 --- a/design/mock/map.py +++ b/design/mock/map.py @@ -115,7 +115,7 @@ def draw_map(g, step, loupe, subject=False): 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") + 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) C.registers(g, 476, D.regs(step), D.FLAGS, {"rax": {0: "tick"}, "rcx": {0: "tick"}, "rdi": {0: "strike" if step else "tick"}}) @@ -212,7 +212,7 @@ def clock(g, moment, total): g.t(MINI[0] - 16, 934, "moment %d of %d" % (moment, total), S, FAINT, MONO, "end") -def working_panels(g, step, subject, wrap=lambda name: ("", "")): +def working_panels(g, step, subject, wrap=lambda name: ("", ""), withhold=None): """The working frame's panels, each between the strings wrap(name) gives (a transform, for the dive).""" stage(False) sp = C.SUBJECT if subject else C.BESIDE @@ -245,7 +245,8 @@ def working_panels(g, step, subject, wrap=lambda name: ("", "")): c = open_("view") view = C.fields(g, 48, sp["view"], "the heap, %x to %x" % (0x1004000 + 16 * (SUBJECT_VIEW if subject else BESIDE_VIEW)[0], 0x10040bf), 0x1004000, 512, D.heap_fields(0x1004000, 512, 0x1004098), D.MEM, HEAP, D.region, - marks=(9,) if step else (), rows_shown=SUBJECT_VIEW if subject else BESIDE_VIEW, more_rows=False) + 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 out["view"] = view return out, sp @@ -256,7 +257,7 @@ def working(name, step, subject=False, loupe=False, caption=None): m, win = map_log(step, loupe, subject) stage(False) g = Svg() - out, sp = working_panels(g, step, subject) + out, sp = working_panels(g, step, subject, withhold=(0x1004050, 0x10040a0) if loupe else None) D.put(64) C.thread(g, out["thread"][0], [(out["thread"][1], out["thread"][1] + ROW)]) D.put(64) -- cgit v1.3