[Lldb-commits] [lldb] r198990 - Sometimes the trampoline refers directly to the indirect symbol. Handle that too.

Jim Ingham jingham at apple.com
Fri Jan 10 17:21:51 PST 2014


Author: jingham
Date: Fri Jan 10 19:21:50 2014
New Revision: 198990

URL: http://llvm.org/viewvc/llvm-project?rev=198990&view=rev
Log:
Sometimes the trampoline refers directly to the indirect symbol.  Handle that too.

Modified:
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=198990&r1=198989&r2=198990&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Fri Jan 10 19:21:50 2014
@@ -1672,6 +1672,29 @@ DynamicLoaderMacOSXDYLD::GetStepThroughT
                         }
                     }
                 }
+                
+                SymbolContextList indirect_symbols;
+                images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeResolver, indirect_symbols);
+                size_t num_indirect_symbols = indirect_symbols.GetSize();
+                if (num_indirect_symbols > 0)
+                {
+                    for (uint32_t i = 0; i < num_indirect_symbols; i++)
+                    {
+                        SymbolContext context;
+                        AddressRange addr_range;
+                        if (indirect_symbols.GetContextAtIndex(i, context))
+                        {
+                            context.GetAddressRange (eSymbolContextEverything, 0, false, addr_range);
+                            addresses.push_back(addr_range.GetBaseAddress());
+                            if (log)
+                            {
+                                addr_t load_addr = addr_range.GetBaseAddress().GetLoadAddress(target_sp.get());
+
+                                log->Printf ("Found an indirect target symbol at 0x%" PRIx64 ".", load_addr);
+                            }
+                        }
+                    }
+                }
             }
         }
         else if (current_symbol->GetType() == eSymbolTypeReExported)





More information about the lldb-commits mailing list