[Lldb-commits] [PATCH] D147841: [lldb][NFC] Update syntax description for language cplusplus demangle

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 10 14:00:01 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG469bdbd62ce2: [lldb][NFC] Update syntax description for language cplusplus demangle (authored by bulbazord).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147841/new/

https://reviews.llvm.org/D147841

Files:
  lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
  lldb/test/Shell/Commands/command-language-cplusplus-demangle.test


Index: lldb/test/Shell/Commands/command-language-cplusplus-demangle.test
===================================================================
--- /dev/null
+++ 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 [<mangled-name> ...] 
Index: lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
===================================================================
--- lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ 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 [<mangled-name> ...]") {
     CommandArgumentEntry arg;
     CommandArgumentData index_arg;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147841.512247.patch
Type: text/x-patch
Size: 2223 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230410/adb79137/attachment.bin>


More information about the lldb-commits mailing list