diff options
author | Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu@amd.com> | 2022-06-15 08:04:32 +0530 |
---|---|---|
committer | Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu@amd.com> | 2022-06-15 08:52:29 +0530 |
commit | ab7fcf24849d9365785dc981613e761e388e560d (patch) | |
tree | 21f512f7ed951515bd0a6d58a54b4ddc5001f260 /lldb/source/Commands/CommandObjectThread.cpp | |
parent | 06c6758a98161262ac97fad42248139d78d39581 (diff) | |
download | llvm-ab7fcf24849d9365785dc981613e761e388e560d.zip llvm-ab7fcf24849d9365785dc981613e761e388e560d.tar.gz llvm-ab7fcf24849d9365785dc981613e761e388e560d.tar.bz2 |
[LLDB] CommandObjectThreadUntil::DoExecute() sets the wrong selected thread ID
For the 'thread until' command, the selected thread ID, to perform the operation on, could be of the current thread or the specified thread.
Reviewed By: jingham
Differential Revision: https://reviews.llvm.org/D48865
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 95a8301..11affe8 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -984,8 +984,8 @@ protected: thread->GetStackFrameAtIndex(m_options.m_frame_idx).get(); if (frame == nullptr) { result.AppendErrorWithFormat( - "Frame index %u is out of range for thread %u.\n", - m_options.m_frame_idx, m_options.m_thread_idx); + "Frame index %u is out of range for thread id %" PRIu64 ".\n", + m_options.m_frame_idx, thread->GetID()); return false; } @@ -1002,9 +1002,8 @@ protected: if (line_table == nullptr) { result.AppendErrorWithFormat("Failed to resolve the line table for " - "frame %u of thread index %u.\n", - m_options.m_frame_idx, - m_options.m_thread_idx); + "frame %u of thread id %" PRIu64 ".\n", + m_options.m_frame_idx, thread->GetID()); return false; } @@ -1090,13 +1089,18 @@ protected: return false; } } else { - result.AppendErrorWithFormat( - "Frame index %u of thread %u has no debug information.\n", - m_options.m_frame_idx, m_options.m_thread_idx); + result.AppendErrorWithFormat("Frame index %u of thread id %" PRIu64 + " has no debug information.\n", + m_options.m_frame_idx, thread->GetID()); return false; } - process->GetThreadList().SetSelectedThreadByID(m_options.m_thread_idx); + if (!process->GetThreadList().SetSelectedThreadByID(thread->GetID())) { + result.AppendErrorWithFormat( + "Failed to set the selected thread to thread id %" PRIu64 ".\n", + thread->GetID()); + return false; + } StreamString stream; Status error; |