summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
diff options
context:
space:
mode:
authorEugene Leviant <evgeny.leviant@gmail.com>2016-01-29 12:17:09 +0000
committerEugene Leviant <evgeny.leviant@gmail.com>2016-01-29 12:17:09 +0000
commitec4d04e507a7e2dec5f5b8739a6d4feaea0bc2f4 (patch)
treed45c6a44a596f4cdf9e83a4a8128504e1bc99ef3 /lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
parent941ca06688539eba1241ad1500fa80890cefdaa7 (diff)
downloadbcm5719-llvm-ec4d04e507a7e2dec5f5b8739a6d4feaea0bc2f4.tar.gz
bcm5719-llvm-ec4d04e507a7e2dec5f5b8739a6d4feaea0bc2f4.zip
Fix crash in lldb-mi when stack variable name is nullptr. This always happens when execution stops in try scope with unnamed catch clause
llvm-svn: 259189
Diffstat (limited to 'lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp')
-rw-r--r--lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
index ef99ac9a420..389da4eb48d 100644
--- a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
+++ b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
@@ -452,7 +452,12 @@ CMICmnLLDBDebugSessionInfo::MIResponseForVariableInfoInternal(const VariableInfo
{
CMICmnMIValueTuple miValueTuple;
lldb::SBValue value = vwrSBValueList.GetValueAtIndex(i);
- const CMICmnMIValueConst miValueConst(value.GetName());
+ // If one stops inside try block with, which catch clause type is unnamed
+ // (e.g std::exception&) then value name will be nullptr as well as value pointer
+ const char* name = value.GetName();
+ if (name == nullptr)
+ continue;
+ const CMICmnMIValueConst miValueConst(name);
const CMICmnMIValueResult miValueResultName("name", miValueConst);
if (vbMarkArgs && vbIsArgs)
{
OpenPOWER on IntegriCloud