Skip to content

Commit e6acf35

Browse files
author
Johnny Chen
committed
Emit a diagnostic message instead of crashing when an argument entry is missing.
llvm-svn: 116114
1 parent fc3642b commit e6acf35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/source/Interpreter/CommandObject.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,12 @@ CommandObject::GetArgumentName (CommandArgumentType arg_type)
508508
if (entry->arg_type != arg_type)
509509
entry = CommandObject::FindArgumentDataByType (arg_type);
510510

511-
return entry->arg_name;
511+
if (entry)
512+
return entry->arg_name;
513+
514+
StreamString str;
515+
str << "Arg name for type (" << arg_type << ") not in arg table!";
516+
return str.GetData();
512517
}
513518

514519
bool

0 commit comments

Comments
 (0)