Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 1 | """ |
| 2 | Test lldb Python event APIs. |
| 3 | """ |
| 4 | |
| 5 | import os, time |
| 6 | import re |
| 7 | import unittest2 |
| 8 | import lldb, lldbutil |
| 9 | from lldbtest import * |
| 10 | |
| 11 | class EventAPITestCase(TestBase): |
| 12 | |
Greg Clayton | 4570d3e | 2013-12-10 23:19:29 +0000 | [diff] [blame] | 13 | mydir = TestBase.compute_mydir(__file__) |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 14 | |
Robert Flack | 13c7ad9 | 2015-03-30 14:12:17 +0000 | [diff] [blame] | 15 | @skipUnlessDarwin |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 16 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 17 | @dsym_test |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 18 | def test_listen_for_and_print_event_with_dsym(self): |
| 19 | """Exercise SBEvent API.""" |
| 20 | self.buildDsym() |
| 21 | self.do_listen_for_and_print_event() |
| 22 | |
| 23 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 24 | @dwarf_test |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 25 | def test_listen_for_and_print_event_with_dwarf(self): |
| 26 | """Exercise SBEvent API.""" |
| 27 | self.buildDwarf() |
| 28 | self.do_listen_for_and_print_event() |
| 29 | |
Robert Flack | 13c7ad9 | 2015-03-30 14:12:17 +0000 | [diff] [blame] | 30 | @skipUnlessDarwin |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 31 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 32 | @dsym_test |
Johnny Chen | 3635eae | 2010-12-21 19:52:54 +0000 | [diff] [blame] | 33 | def test_wait_for_event_with_dsym(self): |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 34 | """Exercise SBListener.WaitForEvent() API.""" |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 35 | self.buildDsym() |
Johnny Chen | 3635eae | 2010-12-21 19:52:54 +0000 | [diff] [blame] | 36 | self.do_wait_for_event() |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 37 | |
| 38 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 39 | @dwarf_test |
Johnny Chen | 3635eae | 2010-12-21 19:52:54 +0000 | [diff] [blame] | 40 | def test_wait_for_event_with_dwarf(self): |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 41 | """Exercise SBListener.WaitForEvent() API.""" |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 42 | self.buildDwarf() |
Johnny Chen | 3635eae | 2010-12-21 19:52:54 +0000 | [diff] [blame] | 43 | self.do_wait_for_event() |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 44 | |
Robert Flack | 13c7ad9 | 2015-03-30 14:12:17 +0000 | [diff] [blame] | 45 | @skipUnlessDarwin |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 46 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 47 | @dsym_test |
| 48 | def test_add_listener_to_broadcaster_with_dsym(self): |
Johnny Chen | 77c4697 | 2010-12-22 00:56:47 +0000 | [diff] [blame] | 49 | """Exercise some SBBroadcaster APIs.""" |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 50 | self.buildDsym() |
Johnny Chen | 77c4697 | 2010-12-22 00:56:47 +0000 | [diff] [blame] | 51 | self.do_add_listener_to_broadcaster() |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 52 | |
Ed Maste | 2ec8e1b | 2014-10-29 20:02:54 +0000 | [diff] [blame] | 53 | @skipIfFreeBSD # llvm.org/pr21325 |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 54 | @python_api_test |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 55 | @dwarf_test |
Tamas Berghammer | a98788d | 2015-05-21 14:04:17 +0000 | [diff] [blame] | 56 | @expectedFailureLinux("llvm.org/pr23617") # Flaky, fails ~1/10 cases |
Johnny Chen | 24086bc | 2012-04-06 19:54:10 +0000 | [diff] [blame] | 57 | def test_add_listener_to_broadcaster_with_dwarf(self): |
Johnny Chen | 77c4697 | 2010-12-22 00:56:47 +0000 | [diff] [blame] | 58 | """Exercise some SBBroadcaster APIs.""" |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 59 | self.buildDwarf() |
Johnny Chen | 77c4697 | 2010-12-22 00:56:47 +0000 | [diff] [blame] | 60 | self.do_add_listener_to_broadcaster() |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 61 | |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 62 | def setUp(self): |
| 63 | # Call super's setUp(). |
| 64 | TestBase.setUp(self) |
| 65 | # Find the line number to of function 'c'. |
| 66 | self.line = line_number('main.c', '// Find the line number of function "c" here.') |
| 67 | |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 68 | def do_listen_for_and_print_event(self): |
| 69 | """Create a listener and use SBEvent API to print the events received.""" |
| 70 | exe = os.path.join(os.getcwd(), "a.out") |
| 71 | |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 72 | self.dbg.SetAsync(True) |
| 73 | |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 74 | # Create a target by the debugger. |
| 75 | target = self.dbg.CreateTarget(exe) |
| 76 | self.assertTrue(target, VALID_TARGET) |
| 77 | |
| 78 | # Now create a breakpoint on main.c by name 'c'. |
| 79 | breakpoint = target.BreakpointCreateByName('c', 'a.out') |
| 80 | |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 81 | listener = lldb.SBListener("my listener") |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 82 | |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 83 | # Now launch the process, and do not stop at the entry point. |
| 84 | error = lldb.SBError() |
| 85 | process = target.Launch (listener, |
| 86 | None, # argv |
| 87 | None, # envp |
| 88 | None, # stdin_path |
| 89 | None, # stdout_path |
| 90 | None, # stderr_path |
| 91 | None, # working directory |
| 92 | 0, # launch flags |
| 93 | False, # Stop at entry |
| 94 | error) # error |
| 95 | |
| 96 | self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 97 | |
| 98 | # Create an empty event object. |
| 99 | event = lldb.SBEvent() |
| 100 | |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 101 | traceOn = self.TraceOn() |
| 102 | if traceOn: |
| 103 | lldbutil.print_stacktraces(process) |
| 104 | |
| 105 | # Create MyListeningThread class to wait for any kind of event. |
| 106 | import threading |
| 107 | class MyListeningThread(threading.Thread): |
| 108 | def run(self): |
| 109 | count = 0 |
| 110 | # Let's only try at most 4 times to retrieve any kind of event. |
| 111 | # After that, the thread exits. |
| 112 | while not count > 3: |
| 113 | if traceOn: |
| 114 | print "Try wait for event..." |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 115 | if listener.WaitForEvent(5, event): |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 116 | if traceOn: |
| 117 | desc = lldbutil.get_description(event) |
| 118 | print "Event description:", desc |
| 119 | print "Event data flavor:", event.GetDataFlavor() |
| 120 | print "Process state:", lldbutil.state_type_to_str(process.GetState()) |
| 121 | print |
| 122 | else: |
| 123 | if traceOn: |
| 124 | print "timeout occurred waiting for event..." |
| 125 | count = count + 1 |
| 126 | return |
| 127 | |
| 128 | # Let's start the listening thread to retrieve the events. |
| 129 | my_thread = MyListeningThread() |
| 130 | my_thread.start() |
| 131 | |
| 132 | # Use Python API to continue the process. The listening thread should be |
| 133 | # able to receive the state changed events. |
| 134 | process.Continue() |
| 135 | |
| 136 | # Use Python API to kill the process. The listening thread should be |
| 137 | # able to receive the state changed event, too. |
| 138 | process.Kill() |
| 139 | |
| 140 | # Wait until the 'MyListeningThread' terminates. |
| 141 | my_thread.join() |
| 142 | |
Johnny Chen | 3635eae | 2010-12-21 19:52:54 +0000 | [diff] [blame] | 143 | def do_wait_for_event(self): |
| 144 | """Get the listener associated with the debugger and exercise WaitForEvent API.""" |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 145 | exe = os.path.join(os.getcwd(), "a.out") |
| 146 | |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 147 | self.dbg.SetAsync(True) |
| 148 | |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 149 | # Create a target by the debugger. |
| 150 | target = self.dbg.CreateTarget(exe) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 151 | self.assertTrue(target, VALID_TARGET) |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 152 | |
| 153 | # Now create a breakpoint on main.c by name 'c'. |
| 154 | breakpoint = target.BreakpointCreateByName('c', 'a.out') |
| 155 | #print "breakpoint:", breakpoint |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 156 | self.assertTrue(breakpoint and |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 157 | breakpoint.GetNumLocations() == 1, |
| 158 | VALID_BREAKPOINT) |
| 159 | |
Johnny Chen | d762ff1 | 2011-02-03 23:15:53 +0000 | [diff] [blame] | 160 | # Get the debugger listener. |
| 161 | listener = self.dbg.GetListener() |
| 162 | |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 163 | # Now launch the process, and do not stop at entry point. |
Greg Clayton | 6f907e6 | 2011-01-23 17:46:22 +0000 | [diff] [blame] | 164 | error = lldb.SBError() |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 165 | process = target.Launch (listener, |
| 166 | None, # argv |
| 167 | None, # envp |
| 168 | None, # stdin_path |
| 169 | None, # stdout_path |
| 170 | None, # stderr_path |
| 171 | None, # working directory |
| 172 | 0, # launch flags |
| 173 | False, # Stop at entry |
| 174 | error) # error |
Johnny Chen | 2494f55 | 2011-07-20 00:14:20 +0000 | [diff] [blame] | 175 | self.assertTrue(error.Success() and process, PROCESS_IS_VALID) |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 176 | |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 177 | # Create an empty event object. |
| 178 | event = lldb.SBEvent() |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 179 | self.assertFalse(event, "Event should not be valid initially") |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 180 | |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 181 | # Create MyListeningThread to wait for any kind of event. |
| 182 | import threading |
| 183 | class MyListeningThread(threading.Thread): |
| 184 | def run(self): |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 185 | count = 0 |
| 186 | # Let's only try at most 3 times to retrieve any kind of event. |
| 187 | while not count > 3: |
| 188 | if listener.WaitForEvent(5, event): |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 189 | #print "Got a valid event:", event |
Johnny Chen | 3a709ac | 2011-07-08 23:02:33 +0000 | [diff] [blame] | 190 | #print "Event data flavor:", event.GetDataFlavor() |
| 191 | #print "Event type:", lldbutil.state_type_to_str(event.GetType()) |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 192 | return |
| 193 | count = count + 1 |
| 194 | print "Timeout: listener.WaitForEvent" |
| 195 | |
| 196 | return |
| 197 | |
Johnny Chen | 4f8caab | 2010-12-21 05:43:37 +0000 | [diff] [blame] | 198 | # Use Python API to kill the process. The listening thread should be |
| 199 | # able to receive a state changed event. |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 200 | process.Kill() |
Johnny Chen | 4f8caab | 2010-12-21 05:43:37 +0000 | [diff] [blame] | 201 | |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 202 | # Let's start the listening thread to retrieve the event. |
| 203 | my_thread = MyListeningThread() |
| 204 | my_thread.start() |
| 205 | |
Johnny Chen | 4f8caab | 2010-12-21 05:43:37 +0000 | [diff] [blame] | 206 | # Wait until the 'MyListeningThread' terminates. |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 207 | my_thread.join() |
Johnny Chen | 4f8caab | 2010-12-21 05:43:37 +0000 | [diff] [blame] | 208 | |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 209 | self.assertTrue(event, |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 210 | "My listening thread successfully received an event") |
Johnny Chen | 4f8caab | 2010-12-21 05:43:37 +0000 | [diff] [blame] | 211 | |
Johnny Chen | 77c4697 | 2010-12-22 00:56:47 +0000 | [diff] [blame] | 212 | def do_add_listener_to_broadcaster(self): |
| 213 | """Get the broadcaster associated with the process and wait for broadcaster events.""" |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 214 | exe = os.path.join(os.getcwd(), "a.out") |
| 215 | |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 216 | self.dbg.SetAsync(True) |
| 217 | |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 218 | # Create a target by the debugger. |
| 219 | target = self.dbg.CreateTarget(exe) |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 220 | self.assertTrue(target, VALID_TARGET) |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 221 | |
| 222 | # Now create a breakpoint on main.c by name 'c'. |
| 223 | breakpoint = target.BreakpointCreateByName('c', 'a.out') |
| 224 | #print "breakpoint:", breakpoint |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 225 | self.assertTrue(breakpoint and |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 226 | breakpoint.GetNumLocations() == 1, |
| 227 | VALID_BREAKPOINT) |
| 228 | |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 229 | listener = lldb.SBListener("my listener") |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 230 | |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 231 | # Now launch the process, and do not stop at the entry point. |
| 232 | error = lldb.SBError() |
| 233 | process = target.Launch (listener, |
| 234 | None, # argv |
| 235 | None, # envp |
| 236 | None, # stdin_path |
| 237 | None, # stdout_path |
| 238 | None, # stderr_path |
| 239 | None, # working directory |
| 240 | 0, # launch flags |
| 241 | False, # Stop at entry |
| 242 | error) # error |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 243 | |
| 244 | # Create an empty event object. |
| 245 | event = lldb.SBEvent() |
Johnny Chen | 4ebd019 | 2011-05-24 18:22:45 +0000 | [diff] [blame] | 246 | self.assertFalse(event, "Event should not be valid initially") |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 247 | |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 248 | |
| 249 | # The finite state machine for our custom listening thread, with an |
Siva Chandra | 8a1f769 | 2015-05-08 00:43:28 +0000 | [diff] [blame] | 250 | # initail state of None, which means no event has been received. |
| 251 | # It changes to 'connected' after 'connected' event is received (for remote platforms) |
| 252 | # It changes to 'running' after 'running' event is received (should happen only if the |
| 253 | # currentstate is either 'None' or 'connected') |
| 254 | # It changes to 'stopped' if a 'stopped' event is received (should happen only if the |
| 255 | # current state is 'running'.) |
| 256 | self.state = None |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 257 | |
| 258 | # Create MyListeningThread to wait for state changed events. |
| 259 | # By design, a "running" event is expected following by a "stopped" event. |
| 260 | import threading |
| 261 | class MyListeningThread(threading.Thread): |
| 262 | def run(self): |
| 263 | #print "Running MyListeningThread:", self |
| 264 | |
| 265 | # Regular expression pattern for the event description. |
| 266 | pattern = re.compile("data = {.*, state = (.*)}$") |
| 267 | |
| 268 | # Let's only try at most 6 times to retrieve our events. |
| 269 | count = 0 |
| 270 | while True: |
Greg Clayton | a6cffde | 2014-10-17 23:58:27 +0000 | [diff] [blame] | 271 | if listener.WaitForEvent(5, event): |
Johnny Chen | 9ae9820 | 2011-04-23 00:34:56 +0000 | [diff] [blame] | 272 | desc = lldbutil.get_description(event) |
| 273 | #print "Event description:", desc |
| 274 | match = pattern.search(desc) |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 275 | if not match: |
| 276 | break; |
Siva Chandra | 8a1f769 | 2015-05-08 00:43:28 +0000 | [diff] [blame] | 277 | if match.group(1) == 'connected': |
| 278 | # When debugging remote targets with lldb-server, we |
| 279 | # first get the 'connected' event. |
| 280 | self.context.assertTrue(self.context.state == None) |
| 281 | self.context.state = 'connected' |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 282 | continue |
Siva Chandra | 8a1f769 | 2015-05-08 00:43:28 +0000 | [diff] [blame] | 283 | elif match.group(1) == 'running': |
| 284 | self.context.assertTrue(self.context.state == None or self.context.state == 'connected') |
| 285 | self.context.state = 'running' |
| 286 | continue |
| 287 | elif match.group(1) == 'stopped': |
| 288 | self.context.assertTrue(self.context.state == 'running') |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 289 | # Whoopee, both events have been received! |
Siva Chandra | 8a1f769 | 2015-05-08 00:43:28 +0000 | [diff] [blame] | 290 | self.context.state = 'stopped' |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 291 | break |
| 292 | else: |
| 293 | break |
| 294 | print "Timeout: listener.WaitForEvent" |
| 295 | count = count + 1 |
| 296 | if count > 6: |
| 297 | break |
| 298 | |
| 299 | return |
| 300 | |
| 301 | # Use Python API to continue the process. The listening thread should be |
| 302 | # able to receive the state changed events. |
Johnny Chen | 5a0bee7 | 2011-06-15 22:14:12 +0000 | [diff] [blame] | 303 | process.Continue() |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 304 | |
| 305 | # Start the listening thread to receive the "running" followed by the |
| 306 | # "stopped" events. |
| 307 | my_thread = MyListeningThread() |
| 308 | # Supply the enclosing context so that our listening thread can access |
| 309 | # the 'state' variable. |
| 310 | my_thread.context = self |
| 311 | my_thread.start() |
| 312 | |
| 313 | # Wait until the 'MyListeningThread' terminates. |
| 314 | my_thread.join() |
| 315 | |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 316 | # The final judgement. :-) |
Siva Chandra | 8a1f769 | 2015-05-08 00:43:28 +0000 | [diff] [blame] | 317 | self.assertTrue(self.state == 'stopped', |
Johnny Chen | f2df189 | 2010-12-22 00:32:54 +0000 | [diff] [blame] | 318 | "Both expected state changed events received") |
Johnny Chen | f667ab5 | 2010-12-21 02:06:56 +0000 | [diff] [blame] | 319 | |
| 320 | |
| 321 | if __name__ == '__main__': |
| 322 | import atexit |
| 323 | lldb.SBDebugger.Initialize() |
| 324 | atexit.register(lambda: lldb.SBDebugger.Terminate()) |
| 325 | unittest2.main() |