diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -318,9 +318,9 @@ class CommandObjectMultiwordItaniumABI_Demangle : public CommandObjectParsed { public: CommandObjectMultiwordItaniumABI_Demangle(CommandInterpreter &interpreter) - : CommandObjectParsed(interpreter, "demangle", - "Demangle a C++ mangled name.", - "language cplusplus demangle") { + : CommandObjectParsed( + interpreter, "demangle", "Demangle a C++ mangled name.", + "language cplusplus demangle [ ...]") { CommandArgumentEntry arg; CommandArgumentData index_arg; diff --git a/lldb/test/Shell/Commands/command-language-cplusplus-demangle.test b/lldb/test/Shell/Commands/command-language-cplusplus-demangle.test new file mode 100644 --- /dev/null +++ b/lldb/test/Shell/Commands/command-language-cplusplus-demangle.test @@ -0,0 +1,22 @@ +# RUN: %lldb -b -o "language cplusplus demangle __ZN3Foo7DoThingEv" \ +# RUN: | FileCheck --check-prefix=DOUBLE-UNDERSCORE %s +# RUN: %lldb -b -o "language cplusplus demangle _ZN3Foo7DoThingEv" \ +# RUN: | FileCheck --check-prefix=SINGLE-UNDERSCORE %s +# RUN: not %lldb -b -o "language cplusplus demangle foo" 2>&1 \ +# RUN: | FileCheck --check-prefix=NOT-MANGLED %s +# RUN: not %lldb -b -o "language cplusplus demangle _ZN3Foo7DoThingEv foo" 2>&1 \ +# RUN: | FileCheck --check-prefix=MULTI-ARG %s +# RUN: %lldb -b -o "help language cplusplus demangle" \ +# RUN: | FileCheck --check-prefix=HELP-MESSAGE %s + +# DOUBLE-UNDERSCORE: __ZN3Foo7DoThingEv ---> Foo::DoThing() + +# SINGLE-UNDERSCORE: _ZN3Foo7DoThingEv ---> Foo::DoThing() + +# NOT-MANGLED: error: foo is not a valid C++ mangled name + +# MULTI-ARG: _ZN3Foo7DoThingEv ---> Foo::DoThing() +# MULTI-ARG: error: foo is not a valid C++ mangled name + +# HELP-MESSAGE: Demangle a C++ mangled name. +# HELP-MESSAGE: Syntax: language cplusplus demangle [ ...]