Skip to content

Commit a678a0e

Browse files
DavidSpickettweliveindetail
authored andcommitted
[lldb][test] Fix D lang mangling test on Windows (llvm#94196)
On Windows the function does not have a symbol associated with it: Function: id = {0x000001c9}, name = "_Dfunction", range = [0x0000000140001000-0x0000000140001004) LineEntry: <...> Whereas it does on Linux: Function: id = {0x00000023}, name = "_Dfunction", range = [0x0000000000000734-0x0000000000000738) LineEntry: <...> Symbol: id = {0x00000058}, range = [0x0000000000000734-0x0000000000000738), name="_Dfunction" This means that frame.symbol is not valid on Windows. However, frame.function is valid and it also has a "mangled" attribute. So I've updated the test to check the symbol if we've got it, and the function always. In both cases we check that mangled is empty (meaning it has not been treated as mangled) and that the display name matches the original symbol name.
1 parent 8e4971c commit a678a0e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lldb/test/API/lang/c/non-mangled/TestCNonMangled.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@ def test_functions_having_dlang_mangling_prefix(self):
1111
"""
1212
self.build()
1313
_, _, thread, _ = lldbutil.run_to_name_breakpoint(self, "_Dfunction")
14-
symbol = thread.frame[0].symbol
15-
self.assertEqual(symbol.GetDisplayName(), "_Dfunction")
14+
frame = thread.frame[0]
15+
16+
symbol = frame.symbol
17+
# On Windows the function does not have an associated symbol.
18+
if symbol.IsValid():
19+
self.assertFalse(symbol.mangled)
20+
self.assertEqual(symbol.GetDisplayName(), "_Dfunction")
21+
22+
function = frame.function
23+
self.assertFalse(function.mangled)
24+
self.assertEqual(function.GetDisplayName(), "_Dfunction")

0 commit comments

Comments
 (0)