summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmdCmdThread.cpp
diff options
context:
space:
mode:
authorHafiz Abid Qadeer <hafiz_abid@mentor.com>2015-02-03 10:05:54 +0000
committerHafiz Abid Qadeer <hafiz_abid@mentor.com>2015-02-03 10:05:54 +0000
commit0d51c1563b8c37ee34a82e7f7592d7a27ba28822 (patch)
tree88da8fb8d5e4de42d1a180c148515871bd06d53f /lldb/tools/lldb-mi/MICmdCmdThread.cpp
parente03491d39074a28585f7d4b8eebc88ad24d69aab (diff)
downloadbcm5719-llvm-0d51c1563b8c37ee34a82e7f7592d7a27ba28822.tar.gz
bcm5719-llvm-0d51c1563b8c37ee34a82e7f7592d7a27ba28822.zip
Fix CLI commands in lldb-mi.
This patch fixes execution of CLI commands in MI mode. The CLI commands are executed using "-interpreter-exec" command. The bug was in the CMICmnLLDBDebugSessionInfo class which contained the following members: SBProcess, SBTarget, SBDebugger and SBListener, but CLI commands don't affect them and they aren't updated. Therefore some members can contain incorrect (or obsolete) reference and it can cause an error. My patch removes these members and uses getters that provides the updated instance every time it is used. Patch from Ilia K ki.stfu@gmail.com. Approved by Greg. llvm-svn: 227958
Diffstat (limited to 'lldb/tools/lldb-mi/MICmdCmdThread.cpp')
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdThread.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/tools/lldb-mi/MICmdCmdThread.cpp b/lldb/tools/lldb-mi/MICmdCmdThread.cpp
index bc36260810f..52fd9605063 100644
--- a/lldb/tools/lldb-mi/MICmdCmdThread.cpp
+++ b/lldb/tools/lldb-mi/MICmdCmdThread.cpp
@@ -99,12 +99,12 @@ CMICmdCmdThreadInfo::Execute(void)
}
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBProcess &rProcess = rSessionInfo.m_lldbProcess;
- lldb::SBThread thread = rProcess.GetSelectedThread();
+ lldb::SBProcess sbProcess = rSessionInfo.GetProcess();
+ lldb::SBThread thread = sbProcess.GetSelectedThread();
if (m_bSingleThread)
{
- thread = rProcess.GetThreadByIndexID(nThreadId);
+ thread = sbProcess.GetThreadByIndexID(nThreadId);
m_bThreadInvalid = thread.IsValid();
if (!m_bThreadInvalid)
return MIstatus::success;
@@ -120,10 +120,10 @@ CMICmdCmdThreadInfo::Execute(void)
// Multiple threads
m_vecMIValueTuple.clear();
- const MIuint nThreads = rProcess.GetNumThreads();
+ const MIuint nThreads = sbProcess.GetNumThreads();
for (MIuint i = 0; i < nThreads; i++)
{
- lldb::SBThread thread = rProcess.GetThreadAtIndex(i);
+ lldb::SBThread thread = sbProcess.GetThreadAtIndex(i);
if (thread.IsValid())
{
CMICmnMIValueTuple miTuple;
OpenPOWER on IntegriCloud