[Lldb-commits] [PATCH] D76968: [lldb-vscode] Correctly return source mapped breakpoints for setBreakpoints request

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 30 02:07:51 PDT 2020

labath added inline comments.

Comment at: lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py:25-43
+        source_basename = 'main.cpp'
+        source_path = os.path.join(os.getcwd(), source_basename)
+        new_source_folder = os.path.join(os.path.dirname(os.getcwd()), 'moved_location')
+        new_source_path = os.path.join(new_source_folder, source_basename)
+        def cleanup():
Please make sure none of these commands modify the source tree. You can look at `test/API/source-manager/Makefile` for an example of how to build a binary to reference files in the build tree.

Comment at: lldb/tools/lldb-vscode/JSONUtils.cpp:324
+llvm::json::Value CreateSourceBreakpoint(lldb::SBBreakpoint &bp,
+                                         const llvm::StringRef &sourcePath,
+                                         int line) {
StringRefs are normally passed by value.

Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:1974
       // Add this breakpoint info to the response
       AppendBreakpoint(pair.second.bp, response_breakpoints);
What about breakpoints in dynamically loaded shared libraries? Should you be remembering the original path somewhere so that one you can set it here too?

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list