Page MenuHomePhabricator

[lldb/API] Expose Target::CreateBreakpoint(..., move_to_nearest_code) overload
ClosedPublic

Authored by mib on Dec 14 2020, 6:50 PM.

Details

Summary

This patch exposes the Target::CreateBreakpoint overload with the
boolean argument to move to the neareast code to the SBAPI.

This is useful when creating column breakpoints to restrict lldb's
resolution to the pointed source location, preventing it to go to the next
line.

rdar://72196842

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail

Event Timeline

mib requested review of this revision.Dec 14 2020, 6:50 PM
mib created this revision.
JDevlieghere added inline comments.Dec 14 2020, 6:58 PM
lldb/include/lldb/API/SBTarget.h
566

It's unfortunate that we have so many overloads, if we had to do it again I would've argued for something like SBBreakpointLocationOptions or something, but I'm not sure if that adds a lot, and dealing with defaults (such as the move_to_nearest_code) is hard because we have no SB counterpart for it. So I guess this is fine.

lldb/source/API/SBTarget.cpp
827–839

There's a lot of code duplication with the method just before it. Can we extract the common code into a private method that both call into? The reproducer instrumentation would remain in the public method.

mib updated this revision to Diff 311771.Dec 14 2020, 7:20 PM
mib marked 2 inline comments as done.

Address @JDevlieghere comments.

This revision is now accepted and ready to land.Dec 14 2020, 7:22 PM
This revision was landed with ongoing or failed builds.Dec 14 2020, 7:25 PM
This revision was automatically updated to reflect the committed changes.