2 Test that dynamically discovered ivars of type IMP do not crash LLDB
5 from __future__ import print_function
12 import lldbsuite.test.lldbutil as lldbutil
13 from lldbsuite.test.lldbtest import *
14 import lldbsuite.support.seven as seven
16 def execute_command (command):
17 # print('%% %s' % (command))
18 (exit_status, output) = seven.get_command_status_output(command)
21 # print('status = %u' % (exit_status))
24 class ObjCiVarIMPTestCase(TestBase):
26 mydir = TestBase.compute_mydir(__file__)
30 def test_imp_ivar_type(self):
31 """Test that dynamically discovered ivars of type IMP do not crash LLDB"""
32 if self.getArchitecture() == 'i386':
33 # rdar://problem/9946499
34 self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
36 execute_command("make repro")
38 execute_command("make cleanup")
39 self.addTearDownHook(cleanup)
41 exe = os.path.join(os.getcwd(), "a.out")
43 # Create a target from the debugger.
44 target = self.dbg.CreateTarget (exe)
45 self.assertTrue(target, VALID_TARGET)
47 # Set up our breakpoint
49 bkpt = lldbutil.run_break_set_by_source_regexp (self, "break here")
51 # Now launch the process, and do not stop at the entry point.
52 process = target.LaunchSimple (None, None, self.get_process_working_directory())
54 self.assertTrue(process.GetState() == lldb.eStateStopped,
57 self.expect('frame variable --ptr-depth=1 --show-types -d run -- object', substrs=[
58 '(MyClass *) object = 0x',
61 self.expect('disassemble --start-address `((MyClass*)object)->myImp`', substrs=[