[Lldb-commits] [lldb] r121638 - in /lldb/trunk: include/lldb/API/SBAddress.h include/lldb/API/SBBreakpoint.h include/lldb/API/SBTarget.h source/API/SBBreakpoint.cpp source/API/SBTarget.cpp
Greg Clayton
gclayton at apple.com
Sun Dec 12 11:25:26 PST 2010
Author: gclayton
Date: Sun Dec 12 13:25:26 2010
New Revision: 121638
URL: http://llvm.org/viewvc/llvm-project?rev=121638&view=rev
Log:
Added the ability for SBTarget to resolve load addresses (convert lldb::addr_t values into resolved SBAddress objects). These SBAddress objects can then be used to resolve a symbol context using "lldb::SBSymbolContext ResolveSymbolContextForAddress (const lldb::SBAddress& addr, uint32_t resolve_scope);".
Modified:
lldb/trunk/include/lldb/API/SBAddress.h
lldb/trunk/include/lldb/API/SBBreakpoint.h
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/source/API/SBBreakpoint.cpp
lldb/trunk/source/API/SBTarget.cpp
Modified: lldb/trunk/include/lldb/API/SBAddress.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBAddress.h?rev=121638&r1=121637&r2=121638&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBAddress.h (original)
+++ lldb/trunk/include/lldb/API/SBAddress.h Sun Dec 12 13:25:26 2010
@@ -54,6 +54,7 @@
friend class SBInstruction;
friend class SBModule;
friend class SBSymbolContext;
+ friend class SBTarget;
friend class SBThread;
#ifndef SWIG
Modified: lldb/trunk/include/lldb/API/SBBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpoint.h?rev=121638&r1=121637&r2=121638&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBBreakpoint.h (original)
+++ lldb/trunk/include/lldb/API/SBBreakpoint.h Sun Dec 12 13:25:26 2010
@@ -33,6 +33,12 @@
#ifndef SWIG
const lldb::SBBreakpoint &
operator = (const lldb::SBBreakpoint& rhs);
+
+ // Tests to see if the opaque breakpoint object in this object matches the
+ // opaque breakpoint object in "rhs".
+ bool
+ operator == (const lldb::SBBreakpoint& rhs);
+
#endif
break_id_t
Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=121638&r1=121637&r2=121638&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Sun Dec 12 13:25:26 2010
@@ -103,6 +103,10 @@
bool
DeleteTargetFromList (lldb_private::TargetList *list);
+
+ bool
+ ResolveLoadAddress (lldb::addr_t vm_addr,
+ lldb::SBAddress& addr);
lldb::SBBreakpoint
BreakpointCreateByLocation (const char *file, uint32_t line);
Modified: lldb/trunk/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpoint.cpp?rev=121638&r1=121637&r2=121638&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpoint.cpp (original)
+++ lldb/trunk/source/API/SBBreakpoint.cpp Sun Dec 12 13:25:26 2010
@@ -92,6 +92,14 @@
return *this;
}
+bool
+SBBreakpoint::operator == (const lldb::SBBreakpoint& rhs)
+{
+ if (m_opaque_sp && rhs.m_opaque_sp)
+ return m_opaque_sp.get() == rhs.m_opaque_sp.get();
+ return false;
+}
+
break_id_t
SBBreakpoint::GetID () const
{
Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=121638&r1=121637&r2=121638&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Sun Dec 12 13:25:26 2010
@@ -383,6 +383,17 @@
m_opaque_sp = target_sp;
}
+bool
+SBTarget::ResolveLoadAddress (lldb::addr_t vm_addr,
+ lldb::SBAddress& addr)
+{
+ if (m_opaque_sp)
+ return m_opaque_sp->GetSectionLoadList().ResolveLoadAddress (vm_addr, *addr);
+
+ addr->Clear();
+ return false;
+}
+
SBBreakpoint
SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line)
{
More information about the lldb-commits
mailing list