mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 01:29:52 +00:00
e796c77b26
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 |
||
---|---|---|
.. | ||
argdumper | ||
compact-unwind | ||
darwin-debug | ||
darwin-threads | ||
debugserver | ||
driver | ||
intel-features | ||
lldb-instr | ||
lldb-perf/darwin/sketch | ||
lldb-server | ||
lldb-test | ||
lldb-vscode | ||
CMakeLists.txt |