[lldb/API] Expose Target::CreateBreakpoint(..., move_to_nearest_code) overload
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 Differential Revision: https://reviews.llvm.org/D93266 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
@@ -787,6 +787,38 @@ SBBreakpoint SBTarget::BreakpointCreateByLocation(
|
||||
return LLDB_RECORD_RESULT(sb_bp);
|
||||
}
|
||||
|
||||
SBBreakpoint SBTarget::BreakpointCreateByLocation(
|
||||
const SBFileSpec &sb_file_spec, uint32_t line, uint32_t column,
|
||||
lldb::addr_t offset, SBFileSpecList &sb_module_list,
|
||||
bool move_to_nearest_code) {
|
||||
LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByLocation,
|
||||
(const lldb::SBFileSpec &, uint32_t, uint32_t,
|
||||
lldb::addr_t, lldb::SBFileSpecList &, bool),
|
||||
sb_file_spec, line, column, offset, sb_module_list,
|
||||
move_to_nearest_code);
|
||||
|
||||
SBBreakpoint sb_bp;
|
||||
TargetSP target_sp(GetSP());
|
||||
if (target_sp && line != 0) {
|
||||
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
|
||||
|
||||
const LazyBool check_inlines = eLazyBoolCalculate;
|
||||
const LazyBool skip_prologue = eLazyBoolCalculate;
|
||||
const bool internal = false;
|
||||
const bool hardware = false;
|
||||
const FileSpecList *module_list = nullptr;
|
||||
if (sb_module_list.GetSize() > 0) {
|
||||
module_list = sb_module_list.get();
|
||||
}
|
||||
sb_bp = target_sp->CreateBreakpoint(
|
||||
module_list, *sb_file_spec, line, column, offset, check_inlines,
|
||||
skip_prologue, internal, hardware,
|
||||
move_to_nearest_code ? eLazyBoolYes : eLazyBoolNo);
|
||||
}
|
||||
|
||||
return LLDB_RECORD_RESULT(sb_bp);
|
||||
}
|
||||
|
||||
SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
|
||||
const char *module_name) {
|
||||
LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByName,
|
||||
@@ -2489,6 +2521,9 @@ void RegisterMethods<SBTarget>(Registry &R) {
|
||||
BreakpointCreateByLocation,
|
||||
(const lldb::SBFileSpec &, uint32_t, uint32_t,
|
||||
lldb::addr_t, lldb::SBFileSpecList &));
|
||||
LLDB_REGISTER_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByLocation,
|
||||
(const lldb::SBFileSpec &, uint32_t, uint32_t,
|
||||
lldb::addr_t, lldb::SBFileSpecList &, bool));
|
||||
LLDB_REGISTER_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByName,
|
||||
(const char *, const char *));
|
||||
LLDB_REGISTER_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByName,
|
||||
|
||||
Reference in New Issue
Block a user