From e6acf35582b78da9a2f495109f5e34d7adf54792 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Fri, 8 Oct 2010 22:01:52 +0000 Subject: Emit a diagnostic message instead of crashing when an argument entry is missing. llvm-svn: 116114 --- lldb/source/Interpreter/CommandObject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lldb/source/Interpreter/CommandObject.cpp') diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 5e2ef9a2d22..2210fc850a3 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -508,7 +508,12 @@ CommandObject::GetArgumentName (CommandArgumentType arg_type) if (entry->arg_type != arg_type) entry = CommandObject::FindArgumentDataByType (arg_type); - return entry->arg_name; + if (entry) + return entry->arg_name; + + StreamString str; + str << "Arg name for type (" << arg_type << ") not in arg table!"; + return str.GetData(); } bool -- cgit v1.2.3