aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorWalter Erquinigo <waltermelon@fb.com>2020-03-27 19:31:14 -0700
committerWalter Erquinigo <waltermelon@fb.com>2020-04-08 09:52:59 -0700
commite796c77b26acab0b530ac6516f1dda21b8494733 (patch)
tree83fc10bc2a99c37e81fb6732c732b53e4d1c4e23 /llvm/lib/CodeGen/MachineFunction.cpp
parentae8ebeca519d49c94c97e67a0314747362e25b8c (diff)
downloadllvm-e796c77b26acab0b530ac6516f1dda21b8494733.zip
llvm-e796c77b26acab0b530ac6516f1dda21b8494733.tar.gz
llvm-e796c77b26acab0b530ac6516f1dda21b8494733.tar.bz2
[lldb-vscode] Correctly return source mapped breakpoints for setBreakpoints request
Summary: When using source maps for a breakpoint, in order to find the actual source that breakpoint has resolved, we need to use a query similar to what CommandObjectSource::DumpLinesInSymbolContexts does, which is the logic used by the CLI to display the source line at a given breakpoint. That's necessary because from a breakpoint location you only have an address, which points to the original source location, not the source mapped one. in the setBreakpoints request handler, we haven't been doing such query and we were returning the original source location, which was breaking the UX of VSCode, as many breakpoints were being set but not displayed in the source file next to each line. Besides, clicking the source path of a breakpoint in the breakpoints view in the debug tab was not working for this case, as VSCode was trying to open a non-existent file, thus showing an error to the user. Ideally, we should do the query mentioned above to find the actual source location to respond to the IDE, however, that query is expensive and users can have an arbitrary number of breakpoints set. As a simpler fix, the request sent by VSCode already contains the full source path, which exists because the user set it from the IDE itself, so we can simply reuse it instead of querying from the SB API. I wrote a test for this, and found out that I had to move SetSourceMapFromArguments after RunInitCommands in lldb-vscode.cpp, because an init command used in all tests is `settings clear -all`, which would clear the source map unless specified after initCommands. And in any case, I think it makes sense to have initCommands run before anything the debugger would do. Reviewers: clayborg, kusmour, labath, aadsm Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D76968
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions