Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 1 | """ |
| 2 | Test thread states. |
| 3 | """ |
| 4 | |
| 5 | import os, time |
| 6 | import unittest2 |
| 7 | import lldb |
| 8 | from lldbtest import * |
| 9 | import lldbutil |
| 10 | |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 11 | class ThreadStateTestCase(TestBase): |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 12 | |
| 13 | mydir = os.path.join("functionalities", "thread", "state") |
| 14 | |
| 15 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 16 | @dsym_test |
Enrico Granata | 03e474b | 2013-11-01 00:57:53 +0000 | [diff] [blame] | 17 | @expectedFailureDarwin("rdar://15367566") |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 18 | def test_state_after_breakpoint_with_dsym(self): |
| 19 | """Test thread state after breakpoint.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 20 | self.buildDsym(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 21 | self.thread_state_after_breakpoint_test() |
| 22 | |
Ed Maste | 34bdbbd | 2013-09-13 15:34:59 +0000 | [diff] [blame] | 23 | @expectedFailureFreeBSD('llvm.org/pr15824') |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 24 | @dwarf_test |
Enrico Granata | 03e474b | 2013-11-01 00:57:53 +0000 | [diff] [blame] | 25 | @expectedFailureDarwin("rdar://15367566") |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 26 | def test_state_after_breakpoint_with_dwarf(self): |
| 27 | """Test thread state after breakpoint.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 28 | self.buildDwarf(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 29 | self.thread_state_after_breakpoint_test() |
| 30 | |
| 31 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 32 | @dsym_test |
| 33 | def test_state_after_continue_with_dsym(self): |
| 34 | """Test thread state after continue.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 35 | self.buildDsym(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 36 | self.thread_state_after_continue_test() |
| 37 | |
| 38 | @dwarf_test |
| 39 | def test_state_after_continue_with_dwarf(self): |
| 40 | """Test thread state after continue.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 41 | self.buildDwarf(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 42 | self.thread_state_after_continue_test() |
| 43 | |
| 44 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 45 | @dsym_test |
| 46 | def test_state_after_expression_with_dsym(self): |
| 47 | """Test thread state after expression.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 48 | self.buildDsym(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 49 | self.thread_state_after_continue_test() |
| 50 | |
| 51 | @dwarf_test |
| 52 | def test_state_after_expression_with_dwarf(self): |
| 53 | """Test thread state after expression.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 54 | self.buildDwarf(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 55 | self.thread_state_after_continue_test() |
| 56 | |
| 57 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 58 | @dsym_test |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 59 | @unittest2.expectedFailure("llvm.org/pr16172") # thread states not properly maintained |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 60 | def test_process_interrupt_with_dsym(self): |
| 61 | """Test process interrupt.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 62 | self.buildDsym(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 63 | self.process_interrupt_test() |
| 64 | |
| 65 | @dwarf_test |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 66 | @unittest2.expectedFailure("llvm.org/pr16712") # thread states not properly maintained |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 67 | def test_process_interrupt_with_dwarf(self): |
| 68 | """Test process interrupt.""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 69 | self.buildDwarf(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 70 | self.process_interrupt_test() |
| 71 | |
| 72 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 73 | @dsym_test |
Daniel Malea | e8bdd1f | 2013-05-15 18:48:32 +0000 | [diff] [blame] | 74 | @unittest2.expectedFailure("llvm.org/pr15824") # thread states not properly maintained |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 75 | def test_process_state_with_dsym(self): |
| 76 | """Test thread states (comprehensive).""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 77 | self.buildDsym(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 78 | self.thread_states_test() |
| 79 | |
| 80 | @dwarf_test |
Daniel Malea | e8bdd1f | 2013-05-15 18:48:32 +0000 | [diff] [blame] | 81 | @unittest2.expectedFailure("llvm.org/pr15824") # thread states not properly maintained |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 82 | def test_process_state_with_dwarf(self): |
| 83 | """Test thread states (comprehensive).""" |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 84 | self.buildDwarf(dictionary=self.getBuildFlags(use_cpp11=False)) |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 85 | self.thread_states_test() |
| 86 | |
| 87 | def setUp(self): |
| 88 | # Call super's setUp(). |
| 89 | TestBase.setUp(self) |
| 90 | # Find the line numbers for our breakpoints. |
| 91 | self.break_1 = line_number('main.c', '// Set first breakpoint here') |
| 92 | self.break_2 = line_number('main.c', '// Set second breakpoint here') |
| 93 | |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 94 | def thread_state_after_breakpoint_test(self): |
| 95 | """Test thread state after breakpoint.""" |
| 96 | exe = os.path.join(os.getcwd(), "a.out") |
| 97 | self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) |
| 98 | |
| 99 | # This should create a breakpoint in the main thread. |
| 100 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1) |
| 101 | |
| 102 | # The breakpoint list should show 1 breakpoint with 1 location. |
| 103 | self.expect("breakpoint list -f", "Breakpoint location shown correctly", |
Matt Kopec | 36e5a7d | 2013-06-17 19:00:31 +0000 | [diff] [blame] | 104 | substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1]) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 105 | |
| 106 | # Run the program. |
| 107 | self.runCmd("run", RUN_SUCCEEDED) |
| 108 | |
| 109 | # The stop reason of the thread should be breakpoint. |
| 110 | self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, |
| 111 | substrs = ['stopped', |
| 112 | '* thread #1', |
| 113 | 'stop reason = breakpoint']) |
| 114 | |
| 115 | # Get the target process |
| 116 | target = self.dbg.GetSelectedTarget() |
| 117 | process = target.GetProcess() |
| 118 | |
| 119 | # Get the number of threads |
| 120 | num_threads = process.GetNumThreads() |
| 121 | |
| 122 | self.assertTrue(num_threads == 1, 'Number of expected threads and actual threads do not match.') |
| 123 | |
| 124 | # Get the thread object |
| 125 | thread = process.GetThreadAtIndex(0) |
| 126 | |
| 127 | # Make sure the thread is in the stopped state. |
| 128 | self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' during breakpoint 1.") |
| 129 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' during breakpoint 1.") |
| 130 | |
| 131 | # Kill the process |
| 132 | self.runCmd("process kill") |
| 133 | |
| 134 | def thread_state_after_continue_test(self): |
| 135 | """Test thread state after continue.""" |
| 136 | exe = os.path.join(os.getcwd(), "a.out") |
| 137 | self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) |
| 138 | |
| 139 | # This should create a breakpoint in the main thread. |
| 140 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1) |
| 141 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_2, num_expected_locations=1) |
| 142 | |
| 143 | # The breakpoint list should show 1 breakpoints with 1 location. |
| 144 | self.expect("breakpoint list -f", "Breakpoint location shown correctly", |
Matt Kopec | 36e5a7d | 2013-06-17 19:00:31 +0000 | [diff] [blame] | 145 | substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1]) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 146 | |
| 147 | # Run the program. |
| 148 | self.runCmd("run", RUN_SUCCEEDED) |
| 149 | |
| 150 | # The stop reason of the thread should be breakpoint. |
| 151 | self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, |
| 152 | substrs = ['stopped', |
| 153 | '* thread #1', |
| 154 | 'stop reason = breakpoint']) |
| 155 | |
| 156 | # Get the target process |
| 157 | target = self.dbg.GetSelectedTarget() |
| 158 | process = target.GetProcess() |
| 159 | |
| 160 | # Get the number of threads |
| 161 | num_threads = process.GetNumThreads() |
| 162 | |
| 163 | self.assertTrue(num_threads == 1, 'Number of expected threads and actual threads do not match.') |
| 164 | |
| 165 | # Get the thread object |
| 166 | thread = process.GetThreadAtIndex(0) |
| 167 | |
| 168 | # Continue, the inferior will go into an infinite loop waiting for 'g_test' to change. |
| 169 | self.dbg.SetAsync(True) |
| 170 | self.runCmd("continue") |
| 171 | time.sleep(1) |
| 172 | |
| 173 | # Check the thread state. It should be running. |
| 174 | self.assertFalse(thread.IsStopped(), "Thread state is \'stopped\' when it should be running.") |
| 175 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' when it should be running.") |
| 176 | |
| 177 | # Go back to synchronous interactions |
| 178 | self.dbg.SetAsync(False) |
| 179 | |
| 180 | # Kill the process |
| 181 | self.runCmd("process kill") |
| 182 | |
| 183 | def thread_state_after_expression_test(self): |
| 184 | """Test thread state after expression.""" |
| 185 | exe = os.path.join(os.getcwd(), "a.out") |
| 186 | self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) |
| 187 | |
| 188 | # This should create a breakpoint in the main thread. |
| 189 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1) |
| 190 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_2, num_expected_locations=1) |
| 191 | |
| 192 | # The breakpoint list should show 1 breakpoints with 1 location. |
| 193 | self.expect("breakpoint list -f", "Breakpoint location shown correctly", |
Matt Kopec | 36e5a7d | 2013-06-17 19:00:31 +0000 | [diff] [blame] | 194 | substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1]) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 195 | |
| 196 | # Run the program. |
| 197 | self.runCmd("run", RUN_SUCCEEDED) |
| 198 | |
| 199 | # The stop reason of the thread should be breakpoint. |
| 200 | self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, |
| 201 | substrs = ['stopped', |
| 202 | '* thread #1', |
| 203 | 'stop reason = breakpoint']) |
| 204 | |
| 205 | # Get the target process |
| 206 | target = self.dbg.GetSelectedTarget() |
| 207 | process = target.GetProcess() |
| 208 | |
| 209 | # Get the number of threads |
| 210 | num_threads = process.GetNumThreads() |
| 211 | |
| 212 | self.assertTrue(num_threads == 1, 'Number of expected threads and actual threads do not match.') |
| 213 | |
| 214 | # Get the thread object |
| 215 | thread = process.GetThreadAtIndex(0) |
| 216 | |
| 217 | # Get the inferior out of its loop |
| 218 | self.runCmd("expression g_test = 1") |
| 219 | |
| 220 | # Check the thread state |
| 221 | self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' after expression evaluation.") |
| 222 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' after expression evaluation.") |
| 223 | |
| 224 | # Let the process run to completion |
| 225 | self.runCmd("process continue") |
| 226 | |
| 227 | |
| 228 | def process_interrupt_test(self): |
| 229 | """Test process interrupt and continue.""" |
| 230 | exe = os.path.join(os.getcwd(), "a.out") |
| 231 | self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) |
| 232 | |
| 233 | # This should create a breakpoint in the main thread. |
| 234 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1) |
| 235 | |
| 236 | # The breakpoint list should show 1 breakpoints with 1 location. |
| 237 | self.expect("breakpoint list -f", "Breakpoint location shown correctly", |
Matt Kopec | 36e5a7d | 2013-06-17 19:00:31 +0000 | [diff] [blame] | 238 | substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1]) |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 239 | |
| 240 | # Run the program. |
| 241 | self.runCmd("run", RUN_SUCCEEDED) |
| 242 | |
| 243 | # The stop reason of the thread should be breakpoint. |
| 244 | self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, |
| 245 | substrs = ['stopped', |
| 246 | '* thread #1', |
| 247 | 'stop reason = breakpoint']) |
| 248 | |
| 249 | # Get the target process |
| 250 | target = self.dbg.GetSelectedTarget() |
| 251 | process = target.GetProcess() |
| 252 | |
| 253 | # Get the number of threads |
| 254 | num_threads = process.GetNumThreads() |
| 255 | |
| 256 | self.assertTrue(num_threads == 1, 'Number of expected threads and actual threads do not match.') |
| 257 | |
| 258 | # Continue, the inferior will go into an infinite loop waiting for 'g_test' to change. |
| 259 | self.dbg.SetAsync(True) |
| 260 | self.runCmd("continue") |
| 261 | time.sleep(1) |
| 262 | |
| 263 | # Go back to synchronous interactions |
| 264 | self.dbg.SetAsync(False) |
| 265 | |
| 266 | # Stop the process |
| 267 | self.runCmd("process interrupt") |
| 268 | |
| 269 | # The stop reason of the thread should be signal. |
| 270 | self.expect("process status", STOPPED_DUE_TO_SIGNAL, |
| 271 | substrs = ['stopped', |
| 272 | '* thread #1', |
| 273 | 'stop reason = signal']) |
| 274 | |
| 275 | # Get the inferior out of its loop |
| 276 | self.runCmd("expression g_test = 1") |
| 277 | |
| 278 | # Run to completion |
| 279 | self.runCmd("continue") |
| 280 | |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 281 | def thread_states_test(self): |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 282 | """Test thread states (comprehensive).""" |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 283 | exe = os.path.join(os.getcwd(), "a.out") |
| 284 | self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) |
| 285 | |
| 286 | # This should create a breakpoint in the main thread. |
| 287 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_1, num_expected_locations=1) |
| 288 | lldbutil.run_break_set_by_file_and_line (self, "main.c", self.break_2, num_expected_locations=1) |
| 289 | |
| 290 | # The breakpoint list should show 2 breakpoints with 1 location each. |
| 291 | self.expect("breakpoint list -f", "Breakpoint location shown correctly", |
Matt Kopec | 36e5a7d | 2013-06-17 19:00:31 +0000 | [diff] [blame] | 292 | substrs = ["1: file = 'main.c', line = %d, locations = 1" % self.break_1, |
| 293 | "2: file = 'main.c', line = %d, locations = 1" % self.break_2]) |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 294 | |
| 295 | # Run the program. |
| 296 | self.runCmd("run", RUN_SUCCEEDED) |
| 297 | |
| 298 | # The stop reason of the thread should be breakpoint. |
| 299 | self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, |
| 300 | substrs = ['stopped', |
| 301 | '* thread #1', |
| 302 | 'stop reason = breakpoint']) |
| 303 | |
| 304 | # Get the target process |
| 305 | target = self.dbg.GetSelectedTarget() |
| 306 | process = target.GetProcess() |
| 307 | |
| 308 | # Get the number of threads |
| 309 | num_threads = process.GetNumThreads() |
| 310 | |
| 311 | self.assertTrue(num_threads == 1, 'Number of expected threads and actual threads do not match.') |
| 312 | |
| 313 | # Get the thread object |
| 314 | thread = process.GetThreadAtIndex(0) |
| 315 | |
| 316 | # Make sure the thread is in the stopped state. |
| 317 | self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' during breakpoint 1.") |
| 318 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' during breakpoint 1.") |
| 319 | |
| 320 | # Continue, the inferior will go into an infinite loop waiting for 'g_test' to change. |
| 321 | self.dbg.SetAsync(True) |
| 322 | self.runCmd("continue") |
| 323 | time.sleep(1) |
| 324 | |
| 325 | # Check the thread state. It should be running. |
| 326 | self.assertFalse(thread.IsStopped(), "Thread state is \'stopped\' when it should be running.") |
| 327 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' when it should be running.") |
| 328 | |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 329 | # Go back to synchronous interactions |
| 330 | self.dbg.SetAsync(False) |
| 331 | |
| 332 | # Stop the process |
| 333 | self.runCmd("process interrupt") |
| 334 | |
| 335 | # The stop reason of the thread should be signal. |
| 336 | self.expect("process status", STOPPED_DUE_TO_SIGNAL, |
| 337 | substrs = ['stopped', |
| 338 | '* thread #1', |
| 339 | 'stop reason = signal']) |
| 340 | |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 341 | # Check the thread state |
| 342 | self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' after process stop.") |
| 343 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' after process stop.") |
| 344 | |
| 345 | # Get the inferior out of its loop |
| 346 | self.runCmd("expression g_test = 1") |
| 347 | |
| 348 | # Check the thread state |
| 349 | self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' after expression evaluation.") |
| 350 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' after expression evaluation.") |
| 351 | |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 352 | # The stop reason of the thread should be signal. |
| 353 | self.expect("process status", STOPPED_DUE_TO_SIGNAL, |
| 354 | substrs = ['stopped', |
| 355 | '* thread #1', |
| 356 | 'stop reason = signal']) |
| 357 | |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 358 | # Run to breakpoint 2 |
| 359 | self.runCmd("continue") |
| 360 | |
Andrew Kaylor | 9f6c535 | 2013-04-30 23:39:14 +0000 | [diff] [blame] | 361 | # The stop reason of the thread should be breakpoint. |
| 362 | self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, |
| 363 | substrs = ['stopped', |
| 364 | '* thread #1', |
| 365 | 'stop reason = breakpoint']) |
| 366 | |
Andrew Kaylor | dbbe36b | 2013-04-23 21:42:03 +0000 | [diff] [blame] | 367 | # Make sure both threads are stopped |
| 368 | self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' during breakpoint 2.") |
| 369 | self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' during breakpoint 2.") |
| 370 | |
| 371 | # Run to completion |
| 372 | self.runCmd("continue") |
| 373 | |
| 374 | # At this point, the inferior process should have exited. |
| 375 | self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) |
| 376 | |
| 377 | if __name__ == '__main__': |
| 378 | import atexit |
| 379 | lldb.SBDebugger.Initialize() |
| 380 | atexit.register(lambda: lldb.SBDebugger.Terminate()) |
| 381 | unittest2.main() |