Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: runtime/vm/debugger.cc

Issue 889443002: Service isolate rework take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 latent_breakpoints_ = latent_breakpoints_->next(); 1059 latent_breakpoints_ = latent_breakpoints_->next();
1060 delete bpt; 1060 delete bpt;
1061 } 1061 }
1062 while (code_breakpoints_ != NULL) { 1062 while (code_breakpoints_ != NULL) {
1063 CodeBreakpoint* bpt = code_breakpoints_; 1063 CodeBreakpoint* bpt = code_breakpoints_;
1064 code_breakpoints_ = code_breakpoints_->next(); 1064 code_breakpoints_ = code_breakpoints_->next();
1065 bpt->Disable(); 1065 bpt->Disable();
1066 delete bpt; 1066 delete bpt;
1067 } 1067 }
1068 // Signal isolate shutdown event. 1068 // Signal isolate shutdown event.
1069 SignalIsolateEvent(DebuggerEvent::kIsolateShutdown); 1069 if (!Service::IsServiceIsolate(isolate_)) {
1070 SignalIsolateEvent(DebuggerEvent::kIsolateShutdown);
1071 }
1070 } 1072 }
1071 1073
1072 1074
1073 static RawFunction* ResolveLibraryFunction( 1075 static RawFunction* ResolveLibraryFunction(
1074 const Library& library, 1076 const Library& library,
1075 const String& fname) { 1077 const String& fname) {
1076 ASSERT(!library.IsNull()); 1078 ASSERT(!library.IsNull());
1077 const Object& object = Object::Handle(library.ResolveName(fname)); 1079 const Object& object = Object::Handle(library.ResolveName(fname));
1078 if (!object.IsNull() && object.IsFunction()) { 1080 if (!object.IsNull() && object.IsFunction()) {
1079 return Function::Cast(object).raw(); 1081 return Function::Cast(object).raw();
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 RemoveInternalBreakpoints(); 2248 RemoveInternalBreakpoints();
2247 } 2249 }
2248 } 2250 }
2249 2251
2250 2252
2251 void Debugger::Initialize(Isolate* isolate) { 2253 void Debugger::Initialize(Isolate* isolate) {
2252 if (initialized_) { 2254 if (initialized_) {
2253 return; 2255 return;
2254 } 2256 }
2255 isolate_ = isolate; 2257 isolate_ = isolate;
2258
2256 // Use the isolate's control port as the isolate_id for debugging. 2259 // Use the isolate's control port as the isolate_id for debugging.
2257 // This port will be used as a unique ID to represet the isolate in the 2260 // This port will be used as a unique ID to represent the isolate in the
2258 // debugger wire protocol messages. 2261 // debugger wire protocol messages.
2259 isolate_id_ = isolate->main_port(); 2262 isolate_id_ = isolate->main_port();
2260 initialized_ = true; 2263 initialized_ = true;
2261 } 2264 }
2262 2265
2263 2266
2264 void Debugger::NotifyIsolateCreated() { 2267 void Debugger::NotifyIsolateCreated() {
2265 // Signal isolate creation event. 2268 // Signal isolate creation event.
2266 SignalIsolateEvent(DebuggerEvent::kIsolateCreated); 2269 if (!Service::IsServiceIsolate(isolate_)) {
2270 SignalIsolateEvent(DebuggerEvent::kIsolateCreated);
2271 }
2267 } 2272 }
2268 2273
2269 2274
2270 // Return innermost closure contained in 'function' that contains 2275 // Return innermost closure contained in 'function' that contains
2271 // the given token position. 2276 // the given token position.
2272 RawFunction* Debugger::FindInnermostClosure(const Function& function, 2277 RawFunction* Debugger::FindInnermostClosure(const Function& function,
2273 intptr_t token_pos) { 2278 intptr_t token_pos) {
2274 const Class& owner = Class::Handle(isolate_, function.Owner()); 2279 const Class& owner = Class::Handle(isolate_, function.Owner());
2275 if (owner.closures() == GrowableObjectArray::null()) { 2280 if (owner.closures() == GrowableObjectArray::null()) {
2276 return Function::null(); 2281 return Function::null();
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 } 2628 }
2624 2629
2625 2630
2626 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 2631 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
2627 ASSERT(bpt->next() == NULL); 2632 ASSERT(bpt->next() == NULL);
2628 bpt->set_next(code_breakpoints_); 2633 bpt->set_next(code_breakpoints_);
2629 code_breakpoints_ = bpt; 2634 code_breakpoints_ = bpt;
2630 } 2635 }
2631 2636
2632 } // namespace dart 2637 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698