[Lldb-commits] [lldb] r193114 - Fixed breakpoints to be able to be set on eSymbolTypeReExported symbols and resolve to the correct function. This allows setting a breakpoint on "memset" for iOS simulator binaries and the correct breakpoint will be set on "__platform_memset".

Greg Clayton gclayton at apple.com
Mon Oct 21 13:04:47 PDT 2013


Author: gclayton
Date: Mon Oct 21 15:04:47 2013
New Revision: 193114

URL: http://llvm.org/viewvc/llvm-project?rev=193114&view=rev
Log:
Fixed breakpoints to be able to be set on eSymbolTypeReExported symbols and resolve to the correct function. This allows setting a breakpoint on "memset" for iOS simulator binaries and the correct breakpoint will be set on "__platform_memset".


Modified:
    lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp

Modified: lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp?rev=193114&r1=193113&r2=193114&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp Mon Oct 21 15:04:47 2013
@@ -289,7 +289,17 @@ BreakpointResolverName::SearchCallback
                 }
                 else if (sc.symbol)
                 {
-                    break_addr = sc.symbol->GetAddress();
+                    if (sc.symbol->GetType() == eSymbolTypeReExported)
+                    {
+                        const Symbol *actual_symbol = sc.symbol->ResolveReExportedSymbol(m_breakpoint->GetTarget());
+                        if (actual_symbol)
+                            break_addr = actual_symbol->GetAddress();
+                    }
+                    else
+                    {
+                        break_addr = sc.symbol->GetAddress();
+                    }
+                    
                     if (m_skip_prologue && break_addr.IsValid())
                     {
                         const uint32_t prologue_byte_size = sc.symbol->GetPrologueByteSize();





More information about the lldb-commits mailing list