feat(debugger): translate the emitted names in variables of a native session #732
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!732
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/731-native-variable-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?
Closes #731
Step 4b of #42 (DEBUGGER.md section 4): the relay shows source names in the
variablesof a native session.Two commits:
feat(debugger):sourceNameOf(s12_counttocount, same rule as the printers'SLOT_NAME),variableNamesShown(on a clash the first listed, innermost, gets the source name, the others keep their C names),translatedVariables(rewrites onlynameinvariablesresponses;value,type,variablesReference,evaluateName, order and every other message untouched) wired intoreadNative; unit tests incompiler/tests/debugger-native.test.trb(next to the othernative.trbtests).test(debugger): the session oftests/debug-native/reads scopes and variables of the top frame and printsbase,firstand the count ofs<digits>_names left; fixture gainsbase;session.expected; DEBUGGER.md sections 4, 18 (row 11) and 20.Test: gates run in forge CI (tier B
tools/debug-native.sh, lldb required, gdb where installed). Nothing was run locally (no toolchain in the worker); the session text is unmeasured until CI reports.9764e55f3162383f9c0aChecklist for
62383f9(task: #731, step 4b of #42):sourceNameOf,variableNamesShownandtranslatedVariables(prefix rule and non-matching names, collisions, order, idempotence, untouched messages,evaluateName/value/type/variablesReference). The tier B session now reads scopes and variables and pinsbase,firstand 0 leftovers<digits>_names. CI is green on this head, incl. tier A, tier B (linux-x64), pdisc, commit messages.variableNamesShownreserves already-source names first, so a C name never takes their place; the first (innermost) colliding binding gets the source name and the outer ones keep their C names (R3).translatedVariablesonly rewritesnameofvariablesresponses and returns every other message unchanged;evaluateNamestays the C expression (R2).evaluate/setVariable/outputstay untranslated as stated.Non-blocking:
compiler/tests/debugger.test.trbfor the unit tests; they live indebugger-native.test.trbnext to the othernative.trbtests, which is a sensible placement and explained in the PR body.translatedVariableswrites"variables": []into avariablesresponse whose body lacks that member. Harmless for DAP debuggers, which always send it; an early return would make it strictly pass-through.