https://github.com/kastiglione updated 
https://github.com/llvm/llvm-project/pull/152201

>From 90eaf547090690c6250fa36937c0f07b170eb8bb Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee....@gmail.com>
Date: Tue, 5 Aug 2025 13:34:50 -0700
Subject: [PATCH 1/4] [lldb] Preserve original symbol of Mangled function names

---
 lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 4c6c3054ba179..a429ea848b7f7 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2509,7 +2509,9 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(
       // If the mangled name is not present in the DWARF, generate the
       // demangled name using the decl context. We skip if the function is
       // "main" as its name is never mangled.
-      func_name.SetValue(ConstructDemangledNameFromDWARF(die));
+      func_name.SetDemangledName(ConstructDemangledNameFromDWARF(die));
+      // Ensure symbol is preserved (as the mangled name).
+      func_name.SetMangledName(ConstString(name));
     } else
       func_name.SetValue(ConstString(name));
 

>From da515bf657ceb49b51f3d5eca3513f12e8d38807 Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee....@gmail.com>
Date: Tue, 5 Aug 2025 14:24:50 -0700
Subject: [PATCH 2/4] Add test

---
 lldb/test/API/lang/cpp/extern_c/main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/test/API/lang/cpp/extern_c/main.cpp 
b/lldb/test/API/lang/cpp/extern_c/main.cpp
index 727ea9255ca7f..0fe262c86ff3c 100644
--- a/lldb/test/API/lang/cpp/extern_c/main.cpp
+++ b/lldb/test/API/lang/cpp/extern_c/main.cpp
@@ -8,7 +8,7 @@ extern "C"
 
 int foo()
 {
-    puts("foo");
+    puts("foo"); //% self.expect("image lookup -v -a $pc", substrs=['mangled = 
"foo"'])
     return 2;
 }
 

>From adcba52addbca946d6a77195b5da793edbb4c680 Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee....@gmail.com>
Date: Tue, 5 Aug 2025 14:38:42 -0700
Subject: [PATCH 3/4] Test formatting

---
 lldb/test/API/lang/cpp/extern_c/main.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lldb/test/API/lang/cpp/extern_c/main.cpp 
b/lldb/test/API/lang/cpp/extern_c/main.cpp
index 0fe262c86ff3c..7017c745be178 100644
--- a/lldb/test/API/lang/cpp/extern_c/main.cpp
+++ b/lldb/test/API/lang/cpp/extern_c/main.cpp
@@ -8,8 +8,10 @@ extern "C"
 
 int foo()
 {
-    puts("foo"); //% self.expect("image lookup -v -a $pc", substrs=['mangled = 
"foo"'])
-    return 2;
+  puts("foo"); //% self.expect("image lookup -va $pc",
+  //%                          substrs=[' name = "::foo()"',
+  //%                                   ' mangled = "foo"'])
+  return 2;
 }
 
 int main (int argc, char const *argv[], char const *envp[])

>From 48fb8e39c1174b875277a3ecfc10a9983e83a261 Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee....@gmail.com>
Date: Tue, 5 Aug 2025 15:18:26 -0700
Subject: [PATCH 4/4] Update debug-types-address-ranges.s test

---
 .../Shell/SymbolFile/DWARF/x86/debug-types-address-ranges.s     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-address-ranges.s 
b/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-address-ranges.s
index 8b3b0e9d56956..792555d99d7b7 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-address-ranges.s
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-address-ranges.s
@@ -11,7 +11,7 @@
 # RUN: %lldb %t -o "image lookup -a 0x48000 -v" -o exit | FileCheck %s
 
 # CHECK:   CompileUnit: id = {0x00000001}, file = "/tmp/a.cc", language = "c++"
-# CHECK:      Function: id = {0x0000006a}, name = "::_start({{.*}})", range = 
[0x0000000000048000-0x000000000004800c)
+# CHECK:      Function: id = {0x0000006a}, name = "::_start({{.*}})", mangled 
= "_start", range = [0x0000000000048000-0x000000000004800c)
 # CHECK:     LineEntry: [0x0000000000048000-0x000000000004800a): /tmp/a.cc:4
 # CHECK:        Symbol: id = {0x00000002}, range = 
[0x0000000000048000-0x000000000004800c), name="_start"
 # CHECK:      Variable: id = {0x00000075}, name = "v1", {{.*}} decl = a.cc:4

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to