From 6fb92d5384ba944b2d6a9c5066a08b41a8ef555f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 15:17:21 -0300 Subject: design: a language of named blocks; the lens as a band over the whole context The README is now the catalogue: atoms, rows, panels, ties, the frame and the verbs, each block specified once under the name the code uses, with rules of composition and what is forbidden. From the user's notes on the context mocks: a lens is a band across the top, its drawing on the left and the bytes it is drawn from on the right, a hexdump with each field's bytes marked and read at the row's end; the disassembly is seventeen rows in address order with a source-line column and an annotation for what each row read, set or jumped to; a register is pinned to the node it points at by name; hex is unbroken; and four kinds of tie say which pane is a view of which (thread, link, projection, echo). --- design/mock/11-context-lens.svg | 1159 ++++++++++++++++++++++----------------- 1 file changed, 644 insertions(+), 515 deletions(-) (limited to 'design/mock/11-context-lens.svg') diff --git a/design/mock/11-context-lens.svg b/design/mock/11-context-lens.svg index f9b93d8..0a8fc9d 100644 --- a/design/mock/11-context-lens.svg +++ b/design/mock/11-context-lens.svg @@ -1,524 +1,653 @@ - - + + + +list.c +lines 18 to 27 of 42 +18 +__attribute__ +( +( +noinline +) +) +static +struct +node +* +reverse +( +struct +node +… +19 +struct +node +* +prev += +NULL +; + +20 +while +( +head +) +{ + + +21 +struct +node +* +next += +head +- +> +next +; + +22 +head +- +> +next += +prev +; +23 +prev += +head +; +24 +head += +next +; +25 +} +26 +return +prev +; +27 +} + + + +disassembly +reverse +10019 +16 +20 +mov +rbp, rsp +10019 +19 +xor +eax, eax +10019 +1b +nop +dword ptr [rax + rax] + +10019 +20 +mov +rcx, rax +rcx +28b410b0 + + +1 + +10019 +23 +mov +rax, rdi +rax +28b41090 + + +4 + + + +10019 +26 +21 +mov +rdi, qword ptr [rdi + 8] + +28b41098 + + +28b41070 + + +9 +10019 +2a +22 +mov +qword ptr [rax + 8], rcx +10019 +2e +20 +test +rdi, rdi + +10019 +31 +jne +1001920 +taken +10019 +33 +pop +rbp +10019 +34 +26 +ret + + + + + + + + + + + + +registers +stack +heap +code +data +rwx + +read-only +rax + +28b41090 + + +4 +rbx +0 +rcx + +28b410b0 + + +1 +rdx +0 +rsi +28b410c0 + + +0 +rdi + +28b41070 + + +9 +rbp +7ffe970f17b0 + + +7ffe970f17d0 + + +7ffe970f1880 + + +7ffe970f18e0 + + +0 +rsp +7ffe970f17b0 + + +7ffe970f17d0 + + +7ffe970f1880 + + +7ffe970f18e0 + + +0 +r8 +7f2ba3019ac0 + + +0 +r9 +0x20 +32 +r10 +0x10 +16 +r11 +7f2ba3019ac8 + + +28b410c0 + + +0 +r12 +7ffe970f1908 + + +7ffe970f2fce + + +"zig-out/targets/list" +r13 +1 +r14 +7f2ba32ac000 + + +7f2ba32ad3c0 + + +0 +r15 +10029c0 + + +1 + + +rip +1001926 +reverse+22 +cf + +PF +af + +zf +sf + +IF +df +of + + + +stack +four words from rsp · the frames they belong to +rsp rbp + +7ffe970f17 +b0 + + +7ffe970f17d0 + + +7ffe970f1880 + + + + + +7ffe970f17 +b8 + + +10018b0 +main+80 +7ffe970f17 +c0 + + +7f2ba3020de8 + + +7ffe970f1918 + + + + + +7ffe970f17 +c8 + + +0 + + + +reverse + + +main + + the list -each node, and under it the heap words that are that node - -1 - - - -28b4 -10b0 - - -rcx - -4 - - - - - -28b4 -1090 - - -rax - -9 - - - - - -28b4 -1070 - - -rdi - -16 - - - - -28b4 -1050 - -25 - - - - -28b4 -1030 - -36 - - -28b4 -1010 -address -value -next -28b4 -1010 -0x24 -36 -0 -NULL -28b4 -1030 -0x19 -25 -28b4 -1010 -28b4 -1050 -0x10 -16 -28b4 -1030 - - -rdi - -28b4 -1070 -9 -28b4 -1050 - - -rax -28b4 -1090 -4 - -28b4 -1070 - - -rcx -28b4 -10b0 -1 - -0 -NULL - - - -list.c -lines 17 to 24 of 42 -17 -18 -__attribute__ -( -( -noinline -) -) -static -struct -node -* -reverse -( -struct -node -… -19 -struct -node -* -prev -= -NULL -; - -20 -while -( -head -) -{ - - -21 -struct -node -* -next -= -head -- -> -next -; - -22 -head -- -> -next -= -prev -; -23 -prev -= -head -; -24 -head -= -next -; - - - -disassembly -reverse - -100 -1923 -+19 -mov -rax, rdi - - - -100 -1926 -+22 -mov -rdi, qword ptr [rdi + 8] - -rdi + 8 = - -28b4 -1098 - - -28b4 -1070 - - -9 -100 -192a -+26 -mov -qword ptr [rax + 8], rcx -100 -192e -+30 -test -rdi, rdi - - - -registers -stack -heap -code -data -rwx - -read-only -rax - -28b4 -1090 - - -4 -rbx -0 -rcx - -28b4 -10b0 - - -1 -rdx -0 -rsi -28b4 -10c0 - - -0 -rdi - -28b4 -1070 - - -9 -rbp -7ffe -970f -17b0 - - -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -rsp -7ffe -970f -17b0 - - -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -r8 -7f2b -a301 -9ac0 - - -0 -r9 -0x20 -32 -r10 -0x10 -16 -r11 -7f2b -a301 -9ac8 - - -28b4 -10c0 - - -0 -r12 -7ffe -970f -1908 - - -7ffe -970f -2fce - - -"zig-out/targets/list" -r13 -1 -r14 -7f2b -a32a -c000 - - -7f2b -a32a -d3c0 - - -0 -r15 -100 -29c0 - - -1 - - -rip -100 -1926 -reverse+22 -flags -0x206 -cf - -PF -af - -zf -sf - -IF -df -of - - - -stack -eight words from rsp · low addresses on top - - -rsp - - -rbp -7ffe -970f -17b0 - - -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -7ffe -970f -17b8 - - -100 -18b0 -main+80 -return address -7ffe -970f -17c0 - - -7f2b -a302 -0de8 - - -7ffe -970f -1918 - - - - - -7ffe -970f -17c8 - - -0 -7ffe -970f -17d0 - - -7ffe -970f -1880 - - -7ffe -970f -18e0 - - -0 -main's saved rbp -7ffe -970f -17d8 - - -7f2b -a2e2 -7781 -libc+27781 -return address -7ffe -970f -17e0 - - -7f2b -a328 -fc60 -ld.so+22c60 -7ffe -970f -17e8 - - -7ffe -970f -1908 - - -7ffe -970f -2fce - - -"zig-out/targets… - - - -backtrace -newest on top - - -#0 -reverse+22 -list.c:21 -#1 -main+80 -list.c:39 -#2 -libc+27781 -libc.so.6 - - +value +next +malloc's +never read +its bytes +the heap, 28b41030 to 28b410bf +28b410 +30 + +19 +00 +00 +00 +00 +00 +00 +00 + +10 +10 +b4 +28 +00 +00 +00 +00 +25 + + +28b41010 + + + +28b410 +40 + + + + + + + + + + + + + + + + +21 +00 +00 +00 +00 +00 +00 +00 +malloc's: a chunk of 32 +28b410 +50 + +10 +00 +00 +00 +00 +00 +00 +00 + +30 +10 +b4 +28 +00 +00 +00 +00 +16 + + +28b41030 + + + +28b410 +60 + + + + + + + + + + + + + + + + +21 +00 +00 +00 +00 +00 +00 +00 +malloc's: a chunk of 32 +28b410 +70 + +09 +00 +00 +00 +00 +00 +00 +00 + +50 +10 +b4 +28 +00 +00 +00 +00 +9 + + +28b41050 + + + +28b410 +80 + + + + + + + + + + + + + + + + +21 +00 +00 +00 +00 +00 +00 +00 +malloc's: a chunk of 32 +28b410 +90 + +04 +00 +00 +00 +00 +00 +00 +00 + + +70 +10 +b4 +28 +00 +00 +00 +00 +4 + + +28b41070 +28b410 +a0 + + + + + + + + + + + + + + + + +21 +00 +00 +00 +00 +00 +00 +00 +malloc's: a chunk of 32 +28b410 +b0 + +01 +00 +00 +00 +00 +00 +00 +00 + + +00 +00 +00 +00 +00 +00 +00 +00 +1 +NULL + + + +28b410b0 + +1 + + + + + +rcx +28b41090 + +4 + + + + + + + +rax +28b41070 + +9 + + + + + + +rdi +28b41050 + +16 + + + + +28b41030 + +25 + + + + +28b41010 + +36 + + + + + + + + + moment 72 of 95 -The load read the word at 28b4 1098: the address of the next node. -rdi holds it now, and follows it to the node whose value is 9. +The load read the word at 28b41098: the address of the next node. +rdi holds it now, and points at the node whose value is 9. -- cgit v1.3