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/2] [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/2] 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;
 }
 

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

Reply via email to