From c13ee52c2fff68aef82a64fc3386a69ced0013ee Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Tue, 14 Sep 2010 00:53:53 +0000 Subject: [PATCH] Fixed an error in Debugger::UpdateExecutionContext() where an invalid index ID 0 was used to set the selected thread if none was selected. Use a more robust API to accomplish the task. Also fixed an error found, while investigating, in CommandObjectThreadSelect:: Execute() where the return status was not properly set if successful. As a result, both the stl step-in test cases with expectedFailure decorators now passed. llvm-svn: 113825 --- lldb/source/Commands/CommandObjectThread.cpp | 1 + lldb/source/Core/Debugger.cpp | 2 +- lldb/test/stl/TestSTL.py | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 7532886578ec..b7af449ec64d 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -1280,6 +1280,7 @@ public: } process->GetThreadList().SetSelectedThreadByID(new_thread->GetID()); + result.SetStatus (eReturnStatusSuccessFinishNoResult); DisplayThreadInfo (interpreter, result.GetOutputStream(), diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 2c20a7b85535..408220437b6d 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -507,7 +507,7 @@ Debugger::UpdateExecutionContext (ExecutionContext *override_context) m_exe_ctx.thread = m_exe_ctx.process->GetThreadList().GetThreadAtIndex(0).get(); // If we didn't have a selected thread, select one here. if (m_exe_ctx.thread != NULL) - m_exe_ctx.process->GetThreadList().SetSelectedThreadByIndexID(0); + m_exe_ctx.process->GetThreadList().SetSelectedThreadByID(m_exe_ctx.thread->GetID()); } if (m_exe_ctx.thread) { diff --git a/lldb/test/stl/TestSTL.py b/lldb/test/stl/TestSTL.py index d95948a9d950..91e174da3db7 100644 --- a/lldb/test/stl/TestSTL.py +++ b/lldb/test/stl/TestSTL.py @@ -12,13 +12,11 @@ class STLTestCase(TestBase): mydir = "stl" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - @unittest2.expectedFailure def test_with_dsym(self): """Test that we can successfully step into an STL function.""" self.buildDsym() self.step_into_stl() - @unittest2.expectedFailure def test_with_dwarf(self): """Test that we can successfully step into an STL function.""" self.buildDwarf()