summaryrefslogtreecommitdiff
path: root/tools/lldb-mi/MICmdCmdThread.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
commitf3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch)
tree48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /tools/lldb-mi/MICmdCmdThread.cpp
parent2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff)
Notes
Diffstat (limited to 'tools/lldb-mi/MICmdCmdThread.cpp')
-rw-r--r--tools/lldb-mi/MICmdCmdThread.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/tools/lldb-mi/MICmdCmdThread.cpp b/tools/lldb-mi/MICmdCmdThread.cpp
index 823a3748248cc..9435655762a9b 100644
--- a/tools/lldb-mi/MICmdCmdThread.cpp
+++ b/tools/lldb-mi/MICmdCmdThread.cpp
@@ -29,9 +29,10 @@
// Throws: None.
//--
CMICmdCmdThreadInfo::CMICmdCmdThreadInfo()
- : m_bSingleThread(false)
- , m_bThreadInvalid(true)
- , m_constStrArgNamedThreadId("thread-id")
+ : m_bSingleThread(false),
+ m_bThreadInvalid(true),
+ m_constStrArgNamedThreadId("thread-id"),
+ m_bHasCurrentThread(false)
{
// Command factory matches this name with that received from the stdin stream
m_strMiCmd = "thread-info";
@@ -124,6 +125,15 @@ CMICmdCmdThreadInfo::Execute()
}
}
+ // -thread-info with multiple threads ends with the current thread id if any
+ if (thread.IsValid())
+ {
+ const CMIUtilString strId(CMIUtilString::Format("%d", thread.GetIndexID()));
+ CMICmnMIValueConst miValueCurrThreadId(strId);
+ m_miValueCurrThreadId = miValueCurrThreadId;
+ m_bHasCurrentThread = true;
+ }
+
return MIstatus::success;
}
@@ -179,7 +189,12 @@ CMICmdCmdThreadInfo::Acknowledge()
++it;
}
- const CMICmnMIValueResult miValueResult("threads", miValueList);
+ CMICmnMIValueResult miValueResult("threads", miValueList);
+ if (m_bHasCurrentThread)
+ {
+ CMIUtilString strCurrThreadId = "current-thread-id";
+ miValueResult.Add(strCurrThreadId, m_miValueCurrThreadId);
+ }
const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
m_miResultRecord = miRecordResult;