[Lldb-commits] [PATCH] D73665: Stop emitting a breakpoint for each location in a breakpoint when responding to breakpoint commands.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 12 14:05:51 PST 2020


clayborg updated this revision to Diff 244275.
clayborg added a comment.

Added a test to cover breakpoint events. The test has an executable and a shared library and we set breakpoints in the main executable and in the shared library. When we run, we stop at the entry point to the program and then the breakpoints are asked to be set. The breakpoint in the main executable should be resolved, and the one in the shared library should not be resolved since the shared library hasn't been loaded yet. We also set a breakpoint via the "preRunCommands" in the "launch" packet. This ensures we set a breakpoint using a LLDB command for which we expect to not get any breakpoint events for since the breakpoint wasn't set via VS Code DAP packets. After we stop, at the entry point we verify no breakpoint events have been received, and then we run to one of the breakpoints that was set via the VS Code DAP packets and check that we received only one event for the breakpoint set via DAP packets and not for the LLDB command created breakpoint.

Fixed lldbvscode_testcase.py set_source_breakpoints and set_function_breakpoints to return breakpoint IDs and not breakpoint ID + location ID. Also fixed verify_breakpoint_hit so that it actally checks that breakpoints were being set by now using an assertTrue call. Prior to this, this function would return true or false, but no one was looking at the result. Looking around the code it seems this should assert and cause the test to fail.

Modified vscode.py to store any breakpoint events in the object so tests can access these events in the test python code for verification.

Modified the "description" field of "stopped" events when we stop at breakpoints to contain "breakpoint %u" where %u is the breakpoint ID. This allows lldbvscode_testcase.verify_breakpoint_hit() to actually work.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73665/new/

https://reviews.llvm.org/D73665

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/test/API/tools/lldb-vscode/breakpoint-events/Makefile
  lldb/test/API/tools/lldb-vscode/breakpoint-events/TestVSCode_breakpointEvents.py
  lldb/test/API/tools/lldb-vscode/breakpoint-events/foo.cpp
  lldb/test/API/tools/lldb-vscode/breakpoint-events/foo.h
  lldb/test/API/tools/lldb-vscode/breakpoint-events/main.cpp
  lldb/tools/lldb-vscode/BreakpointBase.cpp
  lldb/tools/lldb-vscode/BreakpointBase.h
  lldb/tools/lldb-vscode/ExceptionBreakpoint.cpp
  lldb/tools/lldb-vscode/FunctionBreakpoint.cpp
  lldb/tools/lldb-vscode/JSONUtils.cpp
  lldb/tools/lldb-vscode/JSONUtils.h
  lldb/tools/lldb-vscode/LLDBUtils.cpp
  lldb/tools/lldb-vscode/LLDBUtils.h
  lldb/tools/lldb-vscode/SourceBreakpoint.cpp
  lldb/tools/lldb-vscode/lldb-vscode.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73665.244275.patch
Type: text/x-patch
Size: 27389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200212/73480cd5/attachment-0001.bin>


More information about the lldb-commits mailing list