[Lldb-commits] [lldb] r181653 - A couple of small fixes to make core file debugging less noisy.

Jason Molenda jmolenda at apple.com
Fri May 10 17:52:25 PDT 2013


Author: jmolenda
Date: Fri May 10 19:52:25 2013
New Revision: 181653

URL: http://llvm.org/viewvc/llvm-project?rev=181653&view=rev
Log:
A couple of small fixes to make core file debugging less noisy.
Don't want about being unable to find a needed objective-c runtime
function when we're core file debugging and can't jit anything
anyway.  Don't warn when quitting a debug session on a core file,
the program state can be reconstructed by re-running lldb on the
same core file again.


Modified:
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/source/Commands/CommandObjectQuit.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
    lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=181653&r1=181652&r2=181653&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Fri May 10 19:52:25 2013
@@ -2631,6 +2631,20 @@ public:
     IsAlive () = 0;
 
     //------------------------------------------------------------------
+    /// Before lldb detaches from a process, it warns the user that they are about to lose their debug session.
+    /// In some cases, this warning doesn't need to be emitted -- for instance, with core file debugging where 
+    /// the user can reconstruct the "state" by simply re-running the debugger on the core file.  
+    ///
+    /// @return
+    //      true if the user should be warned about detaching from this process.
+    //------------------------------------------------------------------
+    virtual bool
+    WarnBeforeDetach () const
+    {
+        return true;
+    }
+
+    //------------------------------------------------------------------
     /// Actually do the reading of memory from a process.
     ///
     /// Subclasses must override this function and can return fewer 

Modified: lldb/trunk/source/Commands/CommandObjectQuit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectQuit.cpp?rev=181653&r1=181652&r2=181653&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectQuit.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectQuit.cpp Fri May 10 19:52:25 2013
@@ -60,9 +60,10 @@ CommandObjectQuit::ShouldAskForConfirmat
             if (!target_sp)
                 continue;
             ProcessSP process_sp(target_sp->GetProcessSP());
-            if (process_sp &&
-                process_sp->IsValid() &&
-                process_sp->IsAlive())
+            if (process_sp
+                && process_sp->IsValid()
+                && process_sp->IsAlive()
+                && process_sp->WarnBeforeDetach())
             {
                 should_prompt = true;
                 if (process_sp->GetShouldDetach() == false)

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=181653&r1=181652&r2=181653&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Fri May 10 19:52:25 2013
@@ -661,9 +661,12 @@ AppleObjCTrampolineHandler::AppleObjCTra
     {
         // If we can't even find the ordinary get method implementation function, then we aren't going to be able to
         // step through any method dispatches.  Warn to that effect and get out of here.
-        process_sp->GetTarget().GetDebugger().GetErrorStream().Printf("Could not find implementation lookup function \"%s\""
-                                                                      " step in through ObjC method dispatch will not work.\n",
-                                                                      get_impl_name.AsCString());
+        if (process_sp->CanJIT())
+        {
+            process_sp->GetTarget().GetDebugger().GetErrorStream().Printf("Could not find implementation lookup function \"%s\""
+                                                                          " step in through ObjC method dispatch will not work.\n",
+                                                                          get_impl_name.AsCString());
+        }
         return;
     }
     else if (m_impl_stret_fn_addr == LLDB_INVALID_ADDRESS)

Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=181653&r1=181652&r2=181653&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Fri May 10 19:52:25 2013
@@ -366,6 +366,12 @@ ProcessMachCore::IsAlive ()
     return true;
 }
 
+bool
+ProcessMachCore::WarnBeforeDetach () const
+{
+    return false;
+}
+
 //------------------------------------------------------------------
 // Process Memory
 //------------------------------------------------------------------

Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h?rev=181653&r1=181652&r2=181653&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h Fri May 10 19:52:25 2013
@@ -94,7 +94,10 @@ public:
     //------------------------------------------------------------------
     virtual bool
     IsAlive ();
-    
+
+    virtual bool
+    WarnBeforeDetach () const;
+
     //------------------------------------------------------------------
     // Process Memory
     //------------------------------------------------------------------





More information about the lldb-commits mailing list