OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
11 #include "vm/compiler.h" | 11 #include "vm/compiler.h" |
12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
13 #include "vm/deopt_instructions.h" | 13 #include "vm/deopt_instructions.h" |
14 #include "vm/flags.h" | 14 #include "vm/flags.h" |
15 #include "vm/globals.h" | 15 #include "vm/globals.h" |
16 #include "vm/longjump.h" | 16 #include "vm/longjump.h" |
17 #include "vm/json_stream.h" | 17 #include "vm/json_stream.h" |
| 18 #include "vm/message_handler.h" |
18 #include "vm/object.h" | 19 #include "vm/object.h" |
19 #include "vm/object_store.h" | 20 #include "vm/object_store.h" |
20 #include "vm/os.h" | 21 #include "vm/os.h" |
21 #include "vm/port.h" | 22 #include "vm/port.h" |
22 #include "vm/service_event.h" | 23 #include "vm/service_event.h" |
23 #include "vm/service_isolate.h" | 24 #include "vm/service_isolate.h" |
24 #include "vm/service.h" | 25 #include "vm/service.h" |
25 #include "vm/stack_frame.h" | 26 #include "vm/stack_frame.h" |
26 #include "vm/stub_code.h" | 27 #include "vm/stub_code.h" |
27 #include "vm/symbols.h" | 28 #include "vm/symbols.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 if (HasEventHandler()) { | 343 if (HasEventHandler()) { |
343 SignalIsolateEvent(DebuggerEvent::kIsolateInterrupted); | 344 SignalIsolateEvent(DebuggerEvent::kIsolateInterrupted); |
344 } | 345 } |
345 Dart_IsolateInterruptCallback callback = isolate_->InterruptCallback(); | 346 Dart_IsolateInterruptCallback callback = isolate_->InterruptCallback(); |
346 if (callback != NULL) { | 347 if (callback != NULL) { |
347 if (!(*callback)()) { | 348 if (!(*callback)()) { |
348 if (FLAG_trace_isolates) { | 349 if (FLAG_trace_isolates) { |
349 OS::Print("[!] Embedder api: terminating isolate:\n" | 350 OS::Print("[!] Embedder api: terminating isolate:\n" |
350 "\tisolate: %s\n", isolate_->name()); | 351 "\tisolate: %s\n", isolate_->name()); |
351 } | 352 } |
352 const String& msg = String::Handle(String::New("isolate terminated")); | 353 // TODO(turnidge): We should give the message handler a way to |
| 354 // detect when an isolate is unwinding. |
| 355 isolate_->message_handler()->set_pause_on_exit(false); |
| 356 const String& msg = |
| 357 String::Handle(String::New("isolate terminated by embedder")); |
353 return UnwindError::New(msg); | 358 return UnwindError::New(msg); |
354 } | 359 } |
355 } | 360 } |
356 | 361 |
357 // If any error occurred while in the debug message loop, return it here. | 362 // If any error occurred while in the debug message loop, return it here. |
358 const Error& error = | 363 const Error& error = |
359 Error::Handle(isolate_, isolate_->object_store()->sticky_error()); | 364 Error::Handle(isolate_, isolate_->object_store()->sticky_error()); |
360 isolate_->object_store()->clear_sticky_error(); | 365 isolate_->object_store()->clear_sticky_error(); |
361 return error.raw(); | 366 return error.raw(); |
362 } | 367 } |
(...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 } | 3213 } |
3209 | 3214 |
3210 | 3215 |
3211 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3216 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
3212 ASSERT(bpt->next() == NULL); | 3217 ASSERT(bpt->next() == NULL); |
3213 bpt->set_next(code_breakpoints_); | 3218 bpt->set_next(code_breakpoints_); |
3214 code_breakpoints_ = bpt; | 3219 code_breakpoints_ = bpt; |
3215 } | 3220 } |
3216 | 3221 |
3217 } // namespace dart | 3222 } // namespace dart |
OLD | NEW |