feat(debugger): name the frames of test and group bodies #289
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/44-debugger-test-frame-names"
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?
Task
#44: a test or group body's stack frame showed
closure. Name it after the test or group that runs it.What and why
StackFrame.startsLoop(vm/debug.trb): set on the bottom frame of eachexecuteloop. Above the outermost loop, that frame is a call back, i.e. the body of atestorgroup. The frame after it is the caller, at the statement that makes the call.debugger/frames.trb:frameNameOfmoves here aschunkNameOf.FrameNames.namesOfnames every frame of a stop.test/groupcall was given. That call is thekernelinstruction carryingkernelNativeBase+ the index oftorb_test_case/torb_test_groupin the caller's statement. Its first operand is the name register in the caller's frame.test "doubles",group "Math". A body run as many tests (atest "side {side}"in a loop) is named after the test running it at each stop.?and naming never panics.stackTracereads the names by index.stackTracerow is updated. Skills regenerated.Test
tests/debug/tests.expected: the existing session's frames now readtest "doubles"andgroup "Math", also after the step out.tests/debug/test-names: one body run as two tests from a loop inside two nested groups. It stops once intest "side 1"and once intest "side 2", withgroup "Squares"andgroup "Shapes"below. The computed-name proof lives here because atestinsidecompiler/testswould nest into the suite's own test runner.compiler/tests/debugger.test.trb: an ordinary closure's frame staysclosure. The same frame, marked as the start of a loop, also keepsclosure, both with no frame below and with a caller that calls neithertestnorgroup.torb format --check,torb lintandtorb checkon the touched files,docs skill --checkanddocs index --check(nightly). There is no C compiler here, so the suite and the sessions run in CI.Closes #44
b49669ffd108e2eac6b1CI red on
b49669f:ci / tier B (linux-x64)failed after 9m55s (ci / gatesfollows from it); every other job that ran is green. The job log is not readable with the review token (API 404), so I cannot name the cause. The likeliest candidates are the newtests/debug/test-namessession (.expectedbyte-for-byte) and the changedtests/debug/tests.expected; please check the log and push a fix or re-run if it is a flake. My review request stays pending and runs again on the next CI result.Approved. Checklist (head
08e2eac):tests/debug/tests.expectedupdated, new sessiontests/debug/test-namescovers a computed name run as two tests inside two nested groups, anddebugger.test.trbcovers the fallback toclosure(alone, with a loop-start mark, with a non-test caller).startsLoopmarks the bottom frame of eachexecuteloop inframesOf(depth 0 = the frame itself, otherwise the last caller record); naming is resolved once per stop over the unfiltered frame list before statement-less frames are dropped, andstackTracereads by frame index. Every unreadable path falls back to the chunk's name, no?, no panic.frameNameOfmove intodebugger/frames.trbis needed for it.Non-blocking: none.