Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions src/MICmnLLDBDebugSessionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,17 +424,9 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo(
vwrMIValueTuple.Add(miValueResult1);

// Add "target-id"
const char *pThreadName = rThread.GetName();
const MIuint len = CMIUtilString(pThreadName).length();
const bool bHaveName = (len > 0) && (len < 32) && // 32 is arbitrary number
CMIUtilString::IsAllValidAlphaAndNumeric(pThreadName);
const char *pThrdFmt = bHaveName ? "%s" : "Thread %d";
CMIUtilString strThread;
if (bHaveName)
strThread = CMIUtilString::Format(pThrdFmt, pThreadName);
else
strThread = CMIUtilString::Format(pThrdFmt, rThread.GetIndexID());
const CMICmnMIValueConst miValueConst2(strThread);
CMIUtilString strTargetId =
CMIUtilString::Format("Thread %d", rThread.GetThreadID());
const CMICmnMIValueConst miValueConst2(strTargetId);
const CMICmnMIValueResult miValueResult2("target-id", miValueConst2);
vwrMIValueTuple.Add(miValueResult2);

Expand All @@ -454,6 +446,18 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo(
const CMICmnMIValueResult miValueResult4("state", miValueConst4);
vwrMIValueTuple.Add(miValueResult4);

// Add "name"
const char *pThreadName = rThread.GetName();
CMIUtilString strThreadName(pThreadName);
const MIuint len = strThreadName.length();
const bool bHaveName = (len > 0) && (len < 32) && // 32 is arbitrary number
CMIUtilString::IsAllValidAlphaAndNumeric(pThreadName);
if (bHaveName) {
const CMICmnMIValueConst miValueConst5(strThreadName);
const CMICmnMIValueResult miValueResult5("name", miValueConst5);
vwrMIValueTuple.Add(miValueResult5);
}

return MIstatus::success;
}

Expand Down
Loading