Repository navigation
Keep shared read and format helpers out of source line tables - #804
Merged
Merged
Conversation
Indexed reads that can miss lower through shared helpers (`%arr.idxOr`, `%bytes.idxOr`), and printing a value that can be undefined goes through a shared formatter (`%util.fmtv`). Each helper took the location of the read or print that first created it, so its body carried that line's debug locations. A breakpoint on such a line then resolved to every helper as well, and the debugger stopped inside helper code where the user's variables are not in scope. The helpers are compiler code, so they now get a location without a source position (helperLoc). They emit no debug info, while each call still carries the user's location, so a breakpoint on the line stops only at the read or print itself.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the macOS
debug-variables.test.tsfailure on main, where LLDB stopped at a breakpoint location in compiler helper code and then could not find the loop variablei.Indexed reads that can miss lower through shared helpers (
%arr.idxOr,%bytes.idxOr), and printing a value that can beundefinedgoes through a shared formatter (%util.fmtv). Each helper took the location of the read or print that first created it, so its body carried that line's debug locations. A breakpoint on that line then also resolved inside the helpers (three locations forconsole.log("loop", i, bytes[i])), where the user's variables are not in scope.helperLoc(loc)inir/build.ts: a location without a source position, so the helper emits no debug info at all. Call sites keep the user's location, so a breakpoint on the line stops only at the read or print itself.array-values.tsand the union formatter inlower-inspect.ts.Validation: in the dev-mode LLVM for the debug-variables corpus program, line 22 now has a single debug location (it had three), and the helpers have no
!dbgsubprogram. 816 focused typed-array, union, inspect and debug programs pass in both differential lanes, sanitized. Lowering, IR and debug-info unit tests pass (519), and lint and format are clean. The LLDB test itself runs only on macOS CI.