[Lldb-commits] [lldb] r170800 - in /lldb/trunk: include/lldb/lldb-enumerations.h source/API/SBThread.cpp source/Plugins/Process/POSIX/POSIXStopInfo.cpp source/Target/Thread.cpp source/Target/ThreadPlanBase.cpp source/Target/ThreadPlanStepInRange.cpp source/Target/ThreadPlanStepOut.cpp source/Target/ThreadPlanStepOverRange.cpp source/Target/ThreadPlanStepUntil.cpp tools/driver/Driver.cpp

Andrew Kaylor andrew.kaylor at intel.com
Thu Dec 20 15:08:03 PST 2012


Author: akaylor
Date: Thu Dec 20 17:08:03 2012
New Revision: 170800

URL: http://llvm.org/viewvc/llvm-project?rev=170800&view=rev
Log:
Adding eStopReasonThreadExiting and fixing the handling of this state on Linux.

Modified:
    lldb/trunk/include/lldb/lldb-enumerations.h
    lldb/trunk/source/API/SBThread.cpp
    lldb/trunk/source/Plugins/Process/POSIX/POSIXStopInfo.cpp
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/source/Target/ThreadPlanBase.cpp
    lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepOut.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
    lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Thu Dec 20 17:08:03 2012
@@ -177,7 +177,8 @@
         eStopReasonSignal,
         eStopReasonException,
         eStopReasonExec,        // Program was re-exec'ed
-        eStopReasonPlanComplete
+        eStopReasonPlanComplete,
+        eStopReasonThreadExiting
     } StopReason;
 
     //----------------------------------------------------------------------

Modified: lldb/trunk/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Thu Dec 20 17:08:03 2012
@@ -151,6 +151,7 @@
                 case eStopReasonTrace:
                 case eStopReasonExec:
                 case eStopReasonPlanComplete:
+                case eStopReasonThreadExiting:
                     // There is no data for these stop reasons.
                     return 0;
 
@@ -209,6 +210,7 @@
                 case eStopReasonTrace:
                 case eStopReasonExec:
                 case eStopReasonPlanComplete:
+                case eStopReasonThreadExiting:
                     // There is no data for these stop reasons.
                     return 0;
 
@@ -348,6 +350,13 @@
                         }
                         break;
 
+                    case eStopReasonThreadExiting:
+                        {
+                            char limbo_desc[] = "thread exiting";
+                            stop_desc = limbo_desc;
+                            stop_desc_len = sizeof(limbo_desc);
+                        }
+                        break;
                     default:
                         break;
                     }

Modified: lldb/trunk/source/Plugins/Process/POSIX/POSIXStopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/POSIXStopInfo.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/POSIXStopInfo.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/POSIXStopInfo.cpp Thu Dec 20 17:08:03 2012
@@ -21,7 +21,7 @@
 lldb::StopReason
 POSIXLimboStopInfo::GetStopReason() const
 {
-    return lldb::eStopReasonTrace;
+    return lldb::eStopReasonThreadExiting;
 }
 
 const char *
@@ -33,13 +33,13 @@
 bool
 POSIXLimboStopInfo::ShouldStop(Event *event_ptr)
 {
-    return true;
+    return false;
 }
 
 bool
 POSIXLimboStopInfo::ShouldNotify(Event *event_ptr)
 {
-    return true;
+    return false;
 }
 
 //===----------------------------------------------------------------------===//

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Thu Dec 20 17:08:03 2012
@@ -1582,15 +1582,16 @@
 {
     switch (reason)
     {
-    case eStopReasonInvalid:      return "invalid";
-    case eStopReasonNone:         return "none";
-    case eStopReasonTrace:        return "trace";
-    case eStopReasonBreakpoint:   return "breakpoint";
-    case eStopReasonWatchpoint:   return "watchpoint";
-    case eStopReasonSignal:       return "signal";
-    case eStopReasonException:    return "exception";
-    case eStopReasonExec:         return "exec";
-    case eStopReasonPlanComplete: return "plan complete";
+    case eStopReasonInvalid:       return "invalid";
+    case eStopReasonNone:          return "none";
+    case eStopReasonTrace:         return "trace";
+    case eStopReasonBreakpoint:    return "breakpoint";
+    case eStopReasonWatchpoint:    return "watchpoint";
+    case eStopReasonSignal:        return "signal";
+    case eStopReasonException:     return "exception";
+    case eStopReasonExec:          return "exec";
+    case eStopReasonPlanComplete:  return "plan complete";
+    case eStopReasonThreadExiting: return "thread exiting";
     }
 
 

Modified: lldb/trunk/source/Target/ThreadPlanBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanBase.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanBase.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanBase.cpp Thu Dec 20 17:08:03 2012
@@ -146,7 +146,8 @@
                 log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64 " (exec.)", m_thread.GetID());
             m_thread.DiscardThreadPlans(false);
             return true;
-            
+
+        case eStopReasonThreadExiting:
         case eStopReasonSignal:
             if (stop_info_sp->ShouldStop(event_ptr))
             {

Modified: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInRange.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp Thu Dec 20 17:08:03 2012
@@ -384,6 +384,7 @@
         case eStopReasonSignal:
         case eStopReasonException:
         case eStopReasonExec:
+        case eStopReasonThreadExiting:
             {
                 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
                 if (log)

Modified: lldb/trunk/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOut.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOut.cpp Thu Dec 20 17:08:03 2012
@@ -252,6 +252,7 @@
         case eStopReasonSignal:
         case eStopReasonException:
         case eStopReasonExec:
+        case eStopReasonThreadExiting:
             return false;
 
         default:

Modified: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Thu Dec 20 17:08:03 2012
@@ -320,6 +320,7 @@
         case eStopReasonSignal:
         case eStopReasonException:
         case eStopReasonExec:
+        case eStopReasonThreadExiting:
         default:
             if (log)
                 log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step.");

Modified: lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepUntil.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepUntil.cpp Thu Dec 20 17:08:03 2012
@@ -292,6 +292,7 @@
             case eStopReasonSignal:
             case eStopReasonException:
             case eStopReasonExec:
+            case eStopReasonThreadExiting:
                 m_explains_stop = false;
                 break;
             default:

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=170800&r1=170799&r2=170800&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Thu Dec 20 17:08:03 2012
@@ -807,6 +807,7 @@
                 case eStopReasonSignal:
                 case eStopReasonException:
                 case eStopReasonExec:
+                case eStopReasonThreadExiting:
                     if (!other_thread.IsValid())
                         other_thread = thread;
                     break;





More information about the lldb-commits mailing list