[Lldb-commits] [lldb] r198717 - Fixed an issue when attaching to a process without specifying a file where we wouldn't set the dyld gdb image notifier breakpoint correctly.

Greg Clayton gclayton at apple.com
Tue Jan 7 15:15:02 PST 2014


Author: gclayton
Date: Tue Jan  7 17:15:02 2014
New Revision: 198717

URL: http://llvm.org/viewvc/llvm-project?rev=198717&view=rev
Log:
Fixed an issue when attaching to a process without specifying a file where we wouldn't set the dyld gdb image notifier breakpoint correctly.

<rdar://problem/15720040>


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=198717&r1=198716&r2=198717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Jan  7 17:15:02 2014
@@ -1534,8 +1534,18 @@ DynamicLoaderMacOSXDYLD::SetNotification
             // callback function that will get called each time the
             // breakpoint gets hit. We will use this to track when shared
             // libraries get loaded/unloaded.
+            bool resolved = m_process->GetTarget().ResolveLoadAddress(m_dyld_all_image_infos.notification, so_addr);
+            if (!resolved)
+            {
+                ModuleSP dyld_module_sp = m_dyld_module_wp.lock();
+                if (dyld_module_sp)
+                {
+                    UpdateImageLoadAddress (dyld_module_sp.get(), m_dyld);
+                    resolved = m_process->GetTarget().ResolveLoadAddress(m_dyld_all_image_infos.notification, so_addr);
+                }
+            }
 
-            if (m_process->GetTarget().ResolveLoadAddress(m_dyld_all_image_infos.notification, so_addr))
+            if (resolved)
             {
                 Breakpoint *dyld_break = m_process->GetTarget().CreateBreakpoint (so_addr, true, false).get();
                 dyld_break->SetCallback (DynamicLoaderMacOSXDYLD::NotifyBreakpointHit, this, true);





More information about the lldb-commits mailing list