[lldb] Add missing operations to GetOpcodeDataSize (#120163)
[llvm-project.git] / lldb / test / API / lang / cpp / limit-debug-info / TestWithLimitDebugInfo.py
blobebd9e662c3d40843d3f4ab8765839a0eb24cb56b
1 import lldb
2 from lldbsuite.test.decorators import *
3 from lldbsuite.test.lldbtest import *
4 from lldbsuite.test import lldbutil
7 class TestWithLimitDebugInfo(TestBase):
8 def _run_test(self, build_dict):
9 self.build(dictionary=build_dict)
11 # Get the path of the executable
12 exe_path = self.getBuildArtifact("a.out")
14 # Load the executable
15 target = self.dbg.CreateTarget(exe_path)
16 self.assertTrue(target.IsValid(), VALID_TARGET)
18 # Break on main function
19 lldbutil.run_break_set_by_file_and_line(
20 self, "derived.h", line_number("derived.h", "// break1")
22 lldbutil.run_break_set_by_file_and_line(
23 self, "derived.h", line_number("derived.h", "// break2")
26 # Launch the process
27 process = target.LaunchSimple(None, None, self.get_process_working_directory())
28 self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
30 # Get the thread of the process
31 self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
33 self.expect_expr("1", result_type="int", result_value="1")
34 self.expect_expr("this", result_type="Foo *")
35 self.expect_expr("this->x", result_type="int", result_value="12345")
37 self.runCmd("continue")
39 self.expect_expr("1", result_type="int", result_value="1")
40 self.expect_expr("this", result_type="ns::Foo2 *")
41 self.expect_expr("this->x", result_type="int", result_value="23456")
43 @add_test_categories(["dwarf", "dwo"])
44 def test_default(self):
45 self._run_test(dict(CFLAGS_EXTRAS="$(LIMIT_DEBUG_INFO_FLAGS)"))
47 @add_test_categories(["dwarf", "dwo"])
48 def test_debug_names(self):
49 self._run_test(
50 dict(CFLAGS_EXTRAS="$(LIMIT_DEBUG_INFO_FLAGS) -gdwarf-5 -gpubnames")