Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 1 | """ |
| 2 | Use lldb Python API to test dynamic values in C++ |
| 3 | """ |
| 4 | |
| 5 | import os, time |
| 6 | import re |
| 7 | import unittest2 |
| 8 | import lldb, lldbutil |
| 9 | from lldbtest import * |
| 10 | |
| 11 | class DynamicValueTestCase(TestBase): |
| 12 | |
Johnny Chen | 91b6b77 | 2011-06-25 20:19:47 +0000 | [diff] [blame] | 13 | mydir = os.path.join("lang", "cpp", "dynamic-value") |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 14 | |
| 15 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 16 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 17 | @dsym_test |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 18 | def test_get_dynamic_vals_with_dsym(self): |
| 19 | """Test fetching C++ dynamic values from pointers & references.""" |
Andrew Kaylor | 7268e6e | 2013-10-31 19:42:35 +0000 | [diff] [blame] | 20 | self.buildDsym(dictionary=self.getBuildFlags()) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 21 | self.do_get_dynamic_vals() |
| 22 | |
Ed Maste | 34bdbbd | 2013-09-13 15:34:59 +0000 | [diff] [blame] | 23 | @expectedFailureFreeBSD('llvm.org/pr17225') |
Andrew Kaylor | 70ce6d2 | 2013-10-31 22:07:11 +0000 | [diff] [blame] | 24 | @expectedFailureLinux # FIXME: This needs to be root-caused. It looks like the DWARF info is anticipating the derived class assignment. |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 25 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 26 | @dwarf_test |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 27 | def test_get_dynamic_vals_with_dwarf(self): |
| 28 | """Test fetching C++ dynamic values from pointers & references.""" |
Andrew Kaylor | 7268e6e | 2013-10-31 19:42:35 +0000 | [diff] [blame] | 29 | self.buildDwarf(dictionary=self.getBuildFlags()) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 30 | self.do_get_dynamic_vals() |
| 31 | |
| 32 | def setUp(self): |
| 33 | # Call super's setUp(). |
| 34 | TestBase.setUp(self) |
| 35 | |
| 36 | # Find the line number to break for main.c. |
| 37 | |
| 38 | self.do_something_line = line_number('pass-to-base.cpp', '// Break here in doSomething.') |
| 39 | self.main_first_call_line = line_number('pass-to-base.cpp', |
| 40 | '// Break here and get real addresses of myB and otherB.') |
| 41 | self.main_second_call_line = line_number('pass-to-base.cpp', |
| 42 | '// Break here and get real address of reallyA.') |
| 43 | |
Enrico Granata | 38c5463 | 2013-10-30 00:04:29 +0000 | [diff] [blame] | 44 | self.main_third_call_line = line_number('pass-to-base.cpp', |
| 45 | '// Break here and check b has 0 children') |
| 46 | self.main_fourth_call_line = line_number('pass-to-base.cpp', |
| 47 | '// Break here and check b still has 0 children') |
| 48 | self.main_fifth_call_line = line_number('pass-to-base.cpp', |
| 49 | '// Break here and check b has one child now') |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 54 | def examine_value_object_of_this_ptr (self, this_static, this_dynamic, dynamic_location): |
| 55 | |
| 56 | # Get "this" as its static value |
| 57 | |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 58 | self.assertTrue (this_static) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 59 | this_static_loc = int (this_static.GetValue(), 16) |
| 60 | |
| 61 | # Get "this" as its dynamic value |
| 62 | |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 63 | self.assertTrue (this_dynamic) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 64 | this_dynamic_typename = this_dynamic.GetTypeName() |
| 65 | self.assertTrue (this_dynamic_typename.find('B') != -1) |
| 66 | this_dynamic_loc = int (this_dynamic.GetValue(), 16) |
| 67 | |
| 68 | # Make sure we got the right address for "this" |
| 69 | |
| 70 | self.assertTrue (this_dynamic_loc == dynamic_location) |
| 71 | |
| 72 | # And that the static address is greater than the dynamic one |
| 73 | |
| 74 | self.assertTrue (this_static_loc > this_dynamic_loc) |
| 75 | |
| 76 | # Now read m_b_value which is only in the dynamic value: |
| 77 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 78 | use_dynamic = lldb.eDynamicCanRunTarget |
| 79 | no_dynamic = lldb.eNoDynamicValues |
| 80 | |
| 81 | this_dynamic_m_b_value = this_dynamic.GetChildMemberWithName('m_b_value', use_dynamic) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 82 | self.assertTrue (this_dynamic_m_b_value) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 83 | |
| 84 | m_b_value = int (this_dynamic_m_b_value.GetValue(), 0) |
| 85 | self.assertTrue (m_b_value == 10) |
| 86 | |
| 87 | # Make sure it is not in the static version |
| 88 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 89 | this_static_m_b_value = this_static.GetChildMemberWithName('m_b_value', no_dynamic) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 90 | self.assertFalse (this_static_m_b_value) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 91 | |
| 92 | # Okay, now let's make sure that we can get the dynamic type of a child element: |
| 93 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 94 | contained_auto_ptr = this_dynamic.GetChildMemberWithName ('m_client_A', use_dynamic) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 95 | self.assertTrue (contained_auto_ptr) |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 96 | contained_b = contained_auto_ptr.GetChildMemberWithName ('_M_ptr', use_dynamic) |
Enrico Granata | a0f9512 | 2013-04-11 22:55:45 +0000 | [diff] [blame] | 97 | if not contained_b: |
| 98 | contained_b = contained_auto_ptr.GetChildMemberWithName ('__ptr_', use_dynamic) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 99 | self.assertTrue (contained_b) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 100 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 101 | contained_b_static = contained_auto_ptr.GetChildMemberWithName ('_M_ptr', no_dynamic) |
Enrico Granata | a0f9512 | 2013-04-11 22:55:45 +0000 | [diff] [blame] | 102 | if not contained_b_static: |
| 103 | contained_b_static = contained_auto_ptr.GetChildMemberWithName ('__ptr_', no_dynamic) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 104 | self.assertTrue (contained_b_static) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 105 | |
| 106 | contained_b_addr = int (contained_b.GetValue(), 16) |
| 107 | contained_b_static_addr = int (contained_b_static.GetValue(), 16) |
| 108 | |
| 109 | self.assertTrue (contained_b_addr < contained_b_static_addr) |
| 110 | |
| 111 | def do_get_dynamic_vals(self): |
| 112 | """Get argument vals for the call stack when stopped on a breakpoint.""" |
| 113 | exe = os.path.join(os.getcwd(), "a.out") |
| 114 | |
| 115 | # Create a target from the debugger. |
| 116 | |
Johnny Chen | 6b2a27c | 2011-04-25 18:20:52 +0000 | [diff] [blame] | 117 | target = self.dbg.CreateTarget (exe) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 118 | self.assertTrue(target, VALID_TARGET) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 119 | |
| 120 | # Set up our breakpoints: |
| 121 | |
| 122 | do_something_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.do_something_line) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 123 | self.assertTrue(do_something_bpt, |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 124 | VALID_BREAKPOINT) |
| 125 | |
| 126 | first_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_first_call_line) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 127 | self.assertTrue(first_call_bpt, |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 128 | VALID_BREAKPOINT) |
| 129 | |
| 130 | second_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_second_call_line) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 131 | self.assertTrue(second_call_bpt, |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 132 | VALID_BREAKPOINT) |
Enrico Granata | 38c5463 | 2013-10-30 00:04:29 +0000 | [diff] [blame] | 133 | third_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_third_call_line) |
| 134 | self.assertTrue(third_call_bpt, |
| 135 | VALID_BREAKPOINT) |
| 136 | fourth_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_fourth_call_line) |
| 137 | self.assertTrue(fourth_call_bpt, |
| 138 | VALID_BREAKPOINT) |
| 139 | fifth_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_fifth_call_line) |
| 140 | self.assertTrue(fifth_call_bpt, |
| 141 | VALID_BREAKPOINT) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 142 | |
| 143 | # Now launch the process, and do not stop at the entry point. |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 144 | process = target.LaunchSimple (None, None, os.getcwd()) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 145 | |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 146 | self.assertTrue(process.GetState() == lldb.eStateStopped, |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 147 | PROCESS_STOPPED) |
| 148 | |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 149 | threads = lldbutil.get_threads_stopped_at_breakpoint (process, first_call_bpt) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 150 | self.assertTrue (len(threads) == 1) |
| 151 | thread = threads[0] |
| 152 | |
| 153 | frame = thread.GetFrameAtIndex(0) |
| 154 | |
| 155 | # Now find the dynamic addresses of myB and otherB so we can compare them |
| 156 | # with the dynamic values we get in doSomething: |
| 157 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 158 | use_dynamic = lldb.eDynamicCanRunTarget |
| 159 | no_dynamic = lldb.eNoDynamicValues |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 160 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 161 | myB = frame.FindVariable ('myB', no_dynamic); |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 162 | self.assertTrue (myB) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 163 | myB_loc = int (myB.GetLocation(), 16) |
| 164 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 165 | otherB = frame.FindVariable('otherB', no_dynamic) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 166 | self.assertTrue (otherB) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 167 | otherB_loc = int (otherB.GetLocation(), 16) |
| 168 | |
| 169 | # Okay now run to doSomething: |
| 170 | |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 171 | threads = lldbutil.continue_to_breakpoint (process, do_something_bpt) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 172 | self.assertTrue (len(threads) == 1) |
| 173 | thread = threads[0] |
| 174 | |
| 175 | frame = thread.GetFrameAtIndex(0) |
| 176 | |
| 177 | # Get "this" using FindVariable: |
| 178 | |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 179 | this_static = frame.FindVariable ('this', no_dynamic) |
| 180 | this_dynamic = frame.FindVariable ('this', use_dynamic) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 181 | self.examine_value_object_of_this_ptr (this_static, this_dynamic, myB_loc) |
| 182 | |
Jim Ingham | 60dbabb | 2011-12-08 19:44:08 +0000 | [diff] [blame] | 183 | # Now make sure that the "GetDynamicValue" works: |
| 184 | # This doesn't work currently because we can't get dynamic values from ConstResult objects. |
| 185 | fetched_dynamic_value = this_static.GetDynamicValue(use_dynamic) |
| 186 | self.examine_value_object_of_this_ptr (this_static, fetched_dynamic_value, myB_loc) |
| 187 | |
| 188 | # And conversely that the GetDynamicValue() interface also works: |
| 189 | fetched_static_value = this_dynamic.GetStaticValue() |
| 190 | self.examine_value_object_of_this_ptr (fetched_static_value, this_dynamic, myB_loc) |
| 191 | |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 192 | # Get "this" using FindValue, make sure that works too: |
Jim Ingham | 2837b76 | 2011-05-04 03:43:18 +0000 | [diff] [blame] | 193 | this_static = frame.FindValue ('this', lldb.eValueTypeVariableArgument, no_dynamic) |
| 194 | this_dynamic = frame.FindValue ('this', lldb.eValueTypeVariableArgument, use_dynamic) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 195 | self.examine_value_object_of_this_ptr (this_static, this_dynamic, myB_loc) |
| 196 | |
| 197 | # Get "this" using the EvaluateExpression: |
Jim Ingham | de4b919 | 2011-10-07 18:02:54 +0000 | [diff] [blame] | 198 | this_static = frame.EvaluateExpression ('this', False) |
| 199 | this_dynamic = frame.EvaluateExpression ('this', True) |
| 200 | self.examine_value_object_of_this_ptr (this_static, this_dynamic, myB_loc) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 201 | |
| 202 | # The "frame var" code uses another path to get into children, so let's |
| 203 | # make sure that works as well: |
| 204 | |
Enrico Granata | a0f9512 | 2013-04-11 22:55:45 +0000 | [diff] [blame] | 205 | self.expect('frame var -d run-target --ptr-depth=2 --show-types anotherA.m_client_A', 'frame var finds its way into a child member', |
Greg Clayton | e305594 | 2011-06-30 02:28:26 +0000 | [diff] [blame] | 206 | patterns = ['\(B \*\)']) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 207 | |
| 208 | # Now make sure we also get it right for a reference as well: |
| 209 | |
| 210 | anotherA_static = frame.FindVariable ('anotherA', False) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 211 | self.assertTrue (anotherA_static) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 212 | anotherA_static_addr = int (anotherA_static.GetValue(), 16) |
| 213 | |
| 214 | anotherA_dynamic = frame.FindVariable ('anotherA', True) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 215 | self.assertTrue (anotherA_dynamic) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 216 | anotherA_dynamic_addr = int (anotherA_dynamic.GetValue(), 16) |
| 217 | anotherA_dynamic_typename = anotherA_dynamic.GetTypeName() |
| 218 | self.assertTrue (anotherA_dynamic_typename.find('B') != -1) |
| 219 | |
| 220 | self.assertTrue(anotherA_dynamic_addr < anotherA_static_addr) |
| 221 | |
| 222 | anotherA_m_b_value_dynamic = anotherA_dynamic.GetChildMemberWithName('m_b_value', True) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 223 | self.assertTrue (anotherA_m_b_value_dynamic) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 224 | anotherA_m_b_val = int (anotherA_m_b_value_dynamic.GetValue(), 10) |
| 225 | self.assertTrue (anotherA_m_b_val == 300) |
| 226 | |
| 227 | anotherA_m_b_value_static = anotherA_static.GetChildMemberWithName('m_b_value', True) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 228 | self.assertFalse (anotherA_m_b_value_static) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 229 | |
| 230 | # Okay, now continue again, and when we hit the second breakpoint in main |
| 231 | |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 232 | threads = lldbutil.continue_to_breakpoint (process, second_call_bpt) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 233 | self.assertTrue (len(threads) == 1) |
| 234 | thread = threads[0] |
| 235 | |
| 236 | frame = thread.GetFrameAtIndex(0) |
| 237 | reallyA_value = frame.FindVariable ('reallyA', False) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 238 | self.assertTrue(reallyA_value) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 239 | reallyA_loc = int (reallyA_value.GetLocation(), 16) |
| 240 | |
| 241 | # Finally continue to doSomething again, and make sure we get the right value for anotherA, |
| 242 | # which this time around is just an "A". |
| 243 | |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 244 | threads = lldbutil.continue_to_breakpoint (process, do_something_bpt) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 245 | self.assertTrue(len(threads) == 1) |
| 246 | thread = threads[0] |
| 247 | |
| 248 | frame = thread.GetFrameAtIndex(0) |
| 249 | anotherA_value = frame.FindVariable ('anotherA', True) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 250 | self.assertTrue(anotherA_value) |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 251 | anotherA_loc = int (anotherA_value.GetValue(), 16) |
| 252 | self.assertTrue (anotherA_loc == reallyA_loc) |
| 253 | self.assertTrue (anotherA_value.GetTypeName().find ('B') == -1) |
| 254 | |
Enrico Granata | 38c5463 | 2013-10-30 00:04:29 +0000 | [diff] [blame] | 255 | self.runCmd("continue") |
Enrico Granata | 0ede109 | 2013-10-31 22:49:31 +0000 | [diff] [blame^] | 256 | # self.runCmd("frame select 0") |
| 257 | # self.runCmd("frame variable") |
Enrico Granata | 38c5463 | 2013-10-30 00:04:29 +0000 | [diff] [blame] | 258 | b = self.frame().FindVariable("b").GetDynamicValue(lldb.eDynamicCanRunTarget) |
| 259 | self.assertTrue(b.GetNumChildren() == 0, "b has 0 children") |
Enrico Granata | 0ede109 | 2013-10-31 22:49:31 +0000 | [diff] [blame^] | 260 | self.runCmd("next") |
| 261 | # self.runCmd("frame select 0") |
| 262 | # self.runCmd("frame variable") |
Enrico Granata | 38c5463 | 2013-10-30 00:04:29 +0000 | [diff] [blame] | 263 | self.assertTrue(b.GetNumChildren() == 0, "b still has 0 children") |
| 264 | self.runCmd("continue") |
Enrico Granata | 0ede109 | 2013-10-31 22:49:31 +0000 | [diff] [blame^] | 265 | # self.runCmd("frame select 0") |
| 266 | # self.runCmd("frame variable") |
| 267 | self.assertTrue(b.GetNumChildren() != 0, "b now has 1 child") |
Enrico Granata | 38c5463 | 2013-10-30 00:04:29 +0000 | [diff] [blame] | 268 | |
Jim Ingham | 78a685a | 2011-04-16 00:01:13 +0000 | [diff] [blame] | 269 | if __name__ == '__main__': |
| 270 | import atexit |
| 271 | lldb.SBDebugger.Initialize() |
| 272 | atexit.register(lambda: lldb.SBDebugger.Terminate()) |
| 273 | unittest2.main() |