]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/expression_command/pr35310/TestExprsBug35310.py
Vendor import of lldb trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / expression_command / pr35310 / TestExprsBug35310.py
1 from __future__ import print_function
2
3 import lldb
4 from lldbsuite.test.decorators import *
5 from lldbsuite.test.lldbtest import *
6 from lldbsuite.test import lldbutil
7
8 class ExprBug35310(TestBase):
9
10     mydir = TestBase.compute_mydir(__file__)
11
12     def setUp(self):
13         # Call super's setUp().
14         TestBase.setUp(self)
15
16         self.main_source = "main.cpp"
17         self.main_source_spec = lldb.SBFileSpec(self.main_source)
18
19     def test_issue35310(self):
20         """Test invoking functions with non-standard linkage names.
21
22         The GNU abi_tag extension used by libstdc++ is a common source
23         of these, but they could originate from other reasons as well.
24         """
25         self.build()
26
27         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
28                                           '// Break here', self.main_source_spec)
29         frame = thread.GetFrameAtIndex(0)
30
31         value = frame.EvaluateExpression("a.test_abi_tag()")
32         self.assertTrue(value.IsValid())
33         self.assertTrue(value.GetError().Success())
34         self.assertEqual(value.GetValueAsSigned(0), 1)
35
36         value = frame.EvaluateExpression("a.test_asm_name()")
37         self.assertTrue(value.IsValid())
38         self.assertTrue(value.GetError().Success())
39         self.assertEqual(value.GetValueAsSigned(0), 2)