Author: jingham
Date: Wed Apr  2 20:26:14 2014
New Revision: 205497

URL: http://llvm.org/viewvc/llvm-project?rev=205497&view=rev
Log:
Make the fail messages

Modified:
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/source/API/SBThread.cpp
    lldb/trunk/source/Commands/CommandObjectProcess.cpp
    lldb/trunk/source/Commands/CommandObjectThread.cpp
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py
    lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=205497&r1=205496&r2=205497&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Wed Apr  2 20:26:14 2014
@@ -209,10 +209,22 @@ public:
     {
         return m_resume_state;
     }
-
+    
+    // This sets the "external resume state" of the thread.  If the thread is 
suspended here, it should never
+    // get scheduled.  Note that just because a thread is marked as "running" 
does not mean we will let it run in
+    // a given bit of process control.  For instance "step" tries to stay on 
the selected thread it was issued on,
+    // which may involve suspending other threads temporarily.  This temporary 
suspension is NOT reflected in the
+    // state set here and reported in GetResumeState.
+    //
+    // If you are just preparing all threads to run, you should not override 
the threads that are
+    // marked as suspended by the debugger.  In that case, pass 
override_suspend = false.  If you want
+    // to force the thread to run (e.g. the "thread continue" command, or are 
resetting the state
+    // (e.g. in SBThread::Resume()), then pass true to override_suspend.
     void
-    SetResumeState (lldb::StateType state)
+    SetResumeState (lldb::StateType state, bool override_suspend = false)
     {
+        if (m_resume_state == lldb::eStateSuspended && !override_suspend)
+            return;
         m_resume_state = state;
     }
 

Modified: lldb/trunk/source/API/SBThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=205497&r1=205496&r2=205497&view=diff
==============================================================================
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Wed Apr  2 20:26:14 2014
@@ -1028,7 +1028,8 @@ SBThread::Resume ()
         Process::StopLocker stop_locker;
         if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
         {
-            exe_ctx.GetThreadPtr()->SetResumeState (eStateRunning);
+            const bool override_suspend = true;
+            exe_ctx.GetThreadPtr()->SetResumeState (eStateRunning, 
override_suspend);
             result = true;
         }
         else

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=205497&r1=205496&r2=205497&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Wed Apr  2 20:26:14 2014
@@ -758,7 +758,8 @@ protected:
                 // Set the actions that the threads should each take when 
resuming
                 for (uint32_t idx=0; idx<num_threads; ++idx)
                 {
-                    
process->GetThreadList().GetThreadAtIndex(idx)->SetResumeState (eStateRunning);
+                    const bool override_suspend = false;
+                    
process->GetThreadList().GetThreadAtIndex(idx)->SetResumeState (eStateRunning, 
override_suspend);
                 }
             }
             

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=205497&r1=205496&r2=205497&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Wed Apr  2 20:26:14 2014
@@ -794,8 +794,9 @@ public:
                                 result.AppendMessageWithFormat ("%u, ", 
thread->GetIndexID());
                             else
                                 result.AppendMessageWithFormat ("%u ", 
thread->GetIndexID());
-
-                            thread->SetResumeState (eStateRunning);
+                            
+                            const bool override_suspend = true;
+                            thread->SetResumeState (eStateRunning, 
override_suspend);
                         }
                         else
                         {
@@ -826,7 +827,8 @@ public:
                     if (thread == current_thread)
                     {
                         result.AppendMessageWithFormat ("Resuming thread 
0x%4.4" PRIx64 " in process %" PRIu64 "\n", thread->GetID(), process->GetID());
-                        thread->SetResumeState (eStateRunning);
+                        const bool override_suspend = true;
+                        thread->SetResumeState (eStateRunning, 
override_suspend);
                     }
                     else
                     {

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=205497&r1=205496&r2=205497&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Apr  2 20:26:14 2014
@@ -1904,6 +1904,8 @@ Process::LoadImage (const FileSpec &imag
                         }
                     }
                 }
+                else
+                    error = expr_error;
             }
         }
     }

Modified: lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py?rev=205497&r1=205496&r2=205497&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py (original)
+++ lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py Wed Apr  2 
20:26:14 2014
@@ -176,7 +176,8 @@ class TestCStepping(TestBase):
         thread.StepOver()
 
         # See that we are still in b:
-        self.assertTrue (thread.GetFrameAtIndex(0).GetFunctionName() == "b")
+        func_name = thread.GetFrameAtIndex(0).GetFunctionName()
+        self.assertTrue (func_name == "b", "Should be in 'b', were in 
%s"%(func_name))
 
         # Okay, now if we continue, we will finish off our function call and 
we should end up back in "a" as if nothing had happened:
         process.Continue ()

Modified: lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py?rev=205497&r1=205496&r2=205497&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py 
(original)
+++ lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py Wed 
Apr  2 20:26:14 2014
@@ -33,7 +33,7 @@ class TestObjCIvarStripped(TestBase):
         self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation(self.main_source, 
self.stop_line)
-        self.assertTrue(breakpoint, VALID_BREAKPOINT)
+        self.assertTrue(breakpoint.IsValid() and breakpoint.GetNumLocations() 
> 0, VALID_BREAKPOINT)
 
         process = target.LaunchSimple (None, None, 
self.get_process_working_directory())
         self.assertTrue (process, "Created a process.")


_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to