summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2014-04-03 01:26:14 +0000
committerJim Ingham <jingham@apple.com>2014-04-03 01:26:14 +0000
commit6c9ed91ccae7f08784c234c26f1e2b4cbd8ed4d0 (patch)
treede261ad0754faa6e1ffcc26ea00f647e09657027
parent6cc0d2f61d20b5f5debacbfea575985e34764fea (diff)
downloadbcm5719-llvm-6c9ed91ccae7f08784c234c26f1e2b4cbd8ed4d0.tar.gz
bcm5719-llvm-6c9ed91ccae7f08784c234c26f1e2b4cbd8ed4d0.zip
Make the fail messages
llvm-svn: 205497
-rw-r--r--lldb/include/lldb/Target/Thread.h16
-rw-r--r--lldb/source/API/SBThread.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp8
-rw-r--r--lldb/source/Target/Process.cpp2
-rw-r--r--lldb/test/lang/c/stepping/TestStepAndBreakpoints.py3
-rw-r--r--lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py2
7 files changed, 28 insertions, 9 deletions
diff --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h
index aa484287c45..18141222f85 100644
--- a/lldb/include/lldb/Target/Thread.h
+++ b/lldb/include/lldb/Target/Thread.h
@@ -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;
}
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index 29381dff326..fe672d10719 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -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
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 9a137a24116..27c1109571e 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -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);
}
}
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index b693cb37345..22ee5d85573 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -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
{
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index a4ac782de02..6f86a6158ae 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -1904,6 +1904,8 @@ Process::LoadImage (const FileSpec &image_spec, Error &error)
}
}
}
+ else
+ error = expr_error;
}
}
}
diff --git a/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py b/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py
index 0651ddcb064..9d3b3c6bd29 100644
--- a/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py
+++ b/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py
@@ -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 ()
diff --git a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
index 47e2802137c..5a86baf7689 100644
--- a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
+++ b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
@@ -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.")
OpenPOWER on IntegriCloud