aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/DataFormatters/FormatManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/DataFormatters/FormatManager.cpp')
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index d7ba5b4..6076595 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -176,8 +176,14 @@ void FormatManager::GetPossibleMatches(
FormattersMatchCandidate::Flags current_flags, bool root_level) {
compiler_type = compiler_type.GetTypeForFormatters();
ConstString type_name(compiler_type.GetTypeName());
+ // A ValueObject that couldn't be made correctly won't necessarily have a
+ // target. We aren't going to find a formatter in this case anyway, so we
+ // should just exit.
+ TargetSP target_sp = valobj.GetTargetSP();
+ if (!target_sp)
+ return;
ScriptInterpreter *script_interpreter =
- valobj.GetTargetSP()->GetDebugger().GetScriptInterpreter();
+ target_sp->GetDebugger().GetScriptInterpreter();
if (valobj.GetBitfieldBitSize() > 0) {
StreamString sstring;
sstring.Printf("%s:%d", type_name.AsCString(), valobj.GetBitfieldBitSize());