summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2015-11-17 03:39:13 +0000
committerJim Ingham <jingham@apple.com>2015-11-17 03:39:13 +0000
commit055a08a4887d8e7108c3893e71bc1d8ad56c9585 (patch)
treec5ec6ce74d6e97371d8ad5baeb62651b7362c114 /lldb/source/API
parent10568d8c1c81a513b50db5990b8cd770db60ed61 (diff)
downloadbcm5719-llvm-055a08a4887d8e7108c3893e71bc1d8ad56c9585.tar.gz
bcm5719-llvm-055a08a4887d8e7108c3893e71bc1d8ad56c9585.zip
Add the ability (through the SB API & command line) to specify an address
breakpoint as "file address" so that the address breakpoint will track that module even if it gets loaded in a different place. Also fixed the Address breakpoint resolver so that it handles this tracking correctly. llvm-svn: 253308
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBTarget.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 8a63ea304bb..c7595c3c39f 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -1053,6 +1053,41 @@ SBTarget::BreakpointCreateByAddress (addr_t address)
return sb_bp;
}
+SBBreakpoint
+SBTarget::BreakpointCreateBySBAddress (SBAddress &sb_address)
+{
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ SBBreakpoint sb_bp;
+ TargetSP target_sp(GetSP());
+ if (!sb_address.IsValid())
+ {
+ if (log)
+ log->Printf ("SBTarget(%p)::BreakpointCreateBySBAddress called with invalid address",
+ static_cast<void*>(target_sp.get()));
+ return sb_bp;
+ }
+
+ if (target_sp)
+ {
+ Mutex::Locker api_locker (target_sp->GetAPIMutex());
+ const bool hardware = false;
+ *sb_bp = target_sp->CreateBreakpoint (sb_address.ref(), false, hardware);
+ }
+
+ if (log)
+ {
+ SBStream s;
+ sb_address.GetDescription(s);
+ log->Printf ("SBTarget(%p)::BreakpointCreateBySBAddress (address=%s) => SBBreakpoint(%p)",
+ static_cast<void*>(target_sp.get()),
+ s.GetData(),
+ static_cast<void*>(sb_bp.get()));
+ }
+
+ return sb_bp;
+}
+
lldb::SBBreakpoint
SBTarget::BreakpointCreateBySourceRegex (const char *source_regex,
const lldb::SBFileSpec &source_file,
OpenPOWER on IntegriCloud