| 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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 | 6 |
| 7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 BreakpointHandler* handler = | 80 BreakpointHandler* handler = |
| 81 reinterpret_cast<BreakpointHandler*>(bp_handler); | 81 reinterpret_cast<BreakpointHandler*>(bp_handler); |
| 82 | 82 |
| 83 isolate->debugger()->SetBreakpointHandler(handler); | 83 isolate->debugger()->SetBreakpointHandler(handler); |
| 84 } | 84 } |
| 85 | 85 |
| 86 | 86 |
| 87 static Dart_BreakpointResolvedHandler* bp_resolved_handler = NULL; | 87 static Dart_BreakpointResolvedHandler* bp_resolved_handler = NULL; |
| 88 | 88 |
| 89 static void DebuggerEventHandler(Debugger::DebuggerEvent* event) { | 89 static void DebuggerEventHandler(Debugger::DebuggerEvent* event) { |
| 90 printf("Debugger event %d\n", event->type); | |
| 91 Isolate* isolate = Isolate::Current(); | 90 Isolate* isolate = Isolate::Current(); |
| 92 ASSERT(isolate != NULL); | 91 ASSERT(isolate != NULL); |
| 93 if (event->type == Debugger::kBreakpointResolved) { | 92 if (event->type == Debugger::kBreakpointResolved) { |
| 94 if (bp_resolved_handler == NULL) { | 93 if (bp_resolved_handler == NULL) { |
| 95 return; | 94 return; |
| 96 } | 95 } |
| 97 SourceBreakpoint* bpt = event->breakpoint; | 96 SourceBreakpoint* bpt = event->breakpoint; |
| 98 ASSERT(bpt != NULL); | 97 ASSERT(bpt != NULL); |
| 99 Dart_Handle url = Api::NewHandle(isolate, bpt->SourceUrl()); | 98 Dart_Handle url = Api::NewHandle(isolate, bpt->SourceUrl()); |
| 100 (*bp_resolved_handler)(bpt->id(), url, bpt->LineNumber()); | 99 (*bp_resolved_handler)(bpt->id(), url, bpt->LineNumber()); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 for (int i = 0; i < num_libs; i++) { | 447 for (int i = 0; i < num_libs; i++) { |
| 449 ASSERT(!lib.IsNull()); | 448 ASSERT(!lib.IsNull()); |
| 450 lib_url = lib.url(); | 449 lib_url = lib.url(); |
| 451 library_list.SetAt(i, lib_url); | 450 library_list.SetAt(i, lib_url); |
| 452 lib = lib.next_registered(); | 451 lib = lib.next_registered(); |
| 453 } | 452 } |
| 454 return Api::NewHandle(isolate, library_list.raw()); | 453 return Api::NewHandle(isolate, library_list.raw()); |
| 455 } | 454 } |
| 456 | 455 |
| 457 } // namespace dart | 456 } // namespace dart |
| OLD | NEW |