feat(debugger): lldb formatters for the layout table #601
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/600-lldb-formatters"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #600
Step 3 of #42: the lldb side of the native value display, over the unchanged layout table of step 2.
tools/lldb/torb_formatters.py(loaded bycommand script import, never from the binary): summaries and synthetic children fortorb_text,torb_list,torb_map,torb_setand the table's records and cases (same text, cut-offs of 1000 characters and ten items,<none>for a null storage pointer), plustorb-print,torb-locals,torb-layoutslike the gdb script.tools/debug-values.shruns the sametests/debug-values/fixture underlldb --batchagainst the sameexpected.txt; skips with a message wherelldbor its Python is missing or off Linux.docs/tooling/torb-build.mdand itsskills/copy.No syntax, native, driver flag or std name changes; no seed refresh. Layout table format and emitter untouched.
Test. The tier B gate
tools/debug-values.shin forge CI, withlldbinstalled andDEBUG_VALUES_REQUIRE: lldb.Measured (head
ab5838bd, run 2452, jobtier B (linux-x64): success).tools/debug-values.shran withlldbinstalled andDEBUG_VALUES_REQUIRE: lldb, so a skip would have failed the job; the gate compares the lldb output totests/debug-values/expected.txtwithcmp, so all 8 of 8 bindings matched exactly (origin,points,count,ready,title,shape,tags,ages). The CI log prints the gate's name and duration (3s) only, not the per-binding line, because the script's output is shown on failure.History: head
5ea3a2a0matched 6 of 8 (trait-typedpointsandagesnot unwrapped); head43fbc42eunwrapped them; head1daffa9aread members from the plain struct buttext_offailed withUnboundLocalError(a localrawshadowed the module functionraw()), which broketitleand the text keys ofages. Headab5838bdrenames that local (andunsignedintype_of) and addstools/lldb/check_shadowing.py, an AST check thattools/debug-values.shruns first: it flags a function that assigns a name it also calls as a module function (it flags the oldtext_of).0f042b477ccb5fa19510Review of
0f042b47. CI is green for this head, but green does not prove the new code ran.lldbon the CI runner image) goes into the PR body". The body still says "not known at PR time ... will be updated here after CI". CI has finished and the body was not updated. Please quote the tier B line for this head: eitherdebug-values.sh: lldb shows the 8 bindings as the source writes them, or the skip message.tools/lldb/torb_formatters.pywas not executed on the author's machine (PR body). The gate exits 0 whenlldbor its Python is missing (tools/debug-values.sh, the three skip branches), so "tier B success" is compatible with the formatters never having run. Meanwhile this PR sets DEBUGGER.md slice 9 to "Done", rewrites the status line to "the gdb and lldb formatters", and writes "gdb's ownprintand lldb'sframe variableshowPoint... both debuggers cut and show alike" (section 11). Those claims are unverified. Fix with one of:expected.txt. If the runner has no lldb, add it to the tier B job or its image. Then the gate verifies the claim.Checked and ok: scope matches #600 (no emitter, table format, syntax or seed changes); no secrets or new ports; docs and the
skills/copy are in sync; pdisc green; no stale "lldb has no formatters yet" left in DEBUGGER.md.No question for Torben.
Review of
de1874e9(round 2; earlier review was on0f042b47). CI is final and red for this head, and the head is a debugging checkpoint, not a finished change.Earlier findings: #1 (measured result in the PR body) is still open: the body still says "not known at PR time ... will be updated here". #2 (the claim that lldb works is unverified) is half addressed: tier B now installs lldb and sets
DEBUG_VALUES_REQUIRE: lldb(good, this also covers my suggestion #3), but the gate is now failing, so the claim is still unverified.ci / tier B (linux-x64)fails after 42m54s, so lldb ran (or was required) and did not showexpected.txt;ci / gatesfails with it. The job logs are not readable with my token, so I cannot name the diff. The PR must reach a green tier B on a real lldb run before the "Done" status for slice 9 and the section 11 wording ("both debuggers cut and show alike") can stand.ci / commit messagesfails: the head carrieswip: more diagnostics(de1874e9) andwip: break on every entry of the line(aa8fc505). Reword or squash them into conventional commits.tools/debug-values.sh(lldb branch, theset -- --batch ...line): theframe variable s1_points s7_count s8_ready s10_titlecommand is repeated six times interleaved withcontinue, and the failure path dumpsls "$scratch"and 400 lines of the fixture's C. That is a session to find out why lldb disagrees, not the gate. Once the cause is found, the gate should run onlytorb-break-line,process launchand thetorb-printlines fromexpected.txt, and the failure output should be the diff plus the lldb session. Same fortorb-break-lineintools/lldb/torb_formatters.py: if it is needed (breakpoint on every line-table entry), document it in DEBUGGER.md section 4/18 and torb-build.md next totorb-print; if it was only a probe, remove it.mainmoved (66bd7d7f); the branch is based on5ba7fdae. Rebase ontomain(merge style for this repo is rebase, linear history); the rebase's CI run is the one that has to be green.debug-values.sh: lldb shows the 8 bindings as the source writes them), as #600 requires.Checked and ok: scope still matches #600 (no emitter, table format, syntax or seed changes); no secrets, ports or new external services; the
lldbpackage andDEBUG_VALUES_REQUIREingates.ymlare pinned to this one job; pdisc green; docs and theskills/copy in sync.No question for Torben.
de1874e98991ad30394aCI red on
91ad303:ci / tier B (linux-x64)fails after 26m22s (ci / gatesfails with it). The job log is not readable with my token, so I cannot name the diff; withDEBUG_VALUES_REQUIRE: lldbset, the failing step is most likelytools/debug-values.sh(lldb output differs fromexpected.txt, or lldb/its Python is missing). The run: actions/runs/2346/jobs/6.Otherwise the rebase looks right: the
wip:commits and the debug scaffolding in the gate are gone,commit messagesis green, and the PR is mergeable. When tier B is green, please also replace "Measured lldb-on-CI-runner result: not known at PR time" in the body with the tier B line (debug-values.sh: lldb shows the 8 bindings as the source writes them), as #600 requires. No review yet; the next CI run on a new head brings me back.A value lldb hands out prefers its synthetic children, so the formatters' own GetChildMemberWithName("f_items") / ("storage") on an unwrapped ArrayList or torb_map met LayoutChildren / MapChildren instead of the struct: every field came back invalid (`ArrayList(items: <>, ...)`) and a map read a null storage (`[:]`). All member reads now go through the non-synthetic value, and the values the formatters create do not prefer synthetic children. An ArrayList record is shown as the list of its window (items[start:start+count]) like the VM does, and its lldb summary is List(n). New torb-diagnose NAME lists the types, children and sizes the formatters see of a binding; debug-values.sh runs it for every binding that differs. Refs #600Review of
ab5838bd(round 4; earlier reviews on0f042b47andde1874e9, comment on91ad303). All earlier blockers are resolved.ci / tier B (linux-x64)(27m11s) withlldbinstalled andDEBUG_VALUES_REQUIRE: lldb, so a missing or broken lldb fails the gate instead of skipping (my earlier suggestion). The gate compares the lldb output totests/debug-values/expected.txtwith the samecmpas gdb.check_shadowing.pycovers theUnboundLocalErrorclass of bug without lldb. okskip/statuslogic intools/debug-values.shis consistent (gdb and lldb branches, finalexit "$status");gates.shhandsDEBUG_VALUES_REQUIREonly to this gate and unsets it for the rest, with the reason commented. oktests/debug-values/src/main.trbdoes not change the fixture. oklldbpackage pinned to the one job. okdocs/tooling/torb-build.mdwith itsskills/copy in sync;torb-break-lineis documented; pdisc green. okcommit messagesgreen, mergeable. okNon-blocking:
torb-diagnose(formatters, line 825) is only mentioned in the file header; add a line next totorb-break-linein DEBUGGER.md section 4 / torb-build.md, or drop it if it was only a probe.tools/debug-values.shstill dumps a second lldb session, the layout table and diagnose output. It only runs on failure, so it is harmless; trim it to the diff plus the session once the formatters have settled.No question for Torben.