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

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

Issue 1423473004: Switch profiler from isolates to threads [second landing] (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « runtime/vm/dart_api_impl.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 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after
2508 2508
2509 2509
2510 void Debugger::Pause(DebuggerEvent* event) { 2510 void Debugger::Pause(DebuggerEvent* event) {
2511 ASSERT(!IsPaused()); // No recursive pausing. 2511 ASSERT(!IsPaused()); // No recursive pausing.
2512 ASSERT(obj_cache_ == NULL); 2512 ASSERT(obj_cache_ == NULL);
2513 2513
2514 pause_event_ = event; 2514 pause_event_ = event;
2515 pause_event_->UpdateTimestamp(); 2515 pause_event_->UpdateTimestamp();
2516 obj_cache_ = new RemoteObjectCache(64); 2516 obj_cache_ = new RemoteObjectCache(64);
2517 2517
2518 InvokeEventHandler(event); 2518 // We are about to invoke the debuggers event handler. Disable interrupts
2519 // for this thread while waiting for debug commands over the service protocol.
2520 {
2521 DisableThreadInterruptsScope dtis(Thread::Current());
2522 InvokeEventHandler(event);
2523 }
2519 2524
2520 pause_event_ = NULL; 2525 pause_event_ = NULL;
2521 obj_cache_ = NULL; // Zone allocated 2526 obj_cache_ = NULL; // Zone allocated
2522 } 2527 }
2523 2528
2524 2529
2525 void Debugger::EnterSingleStepMode() { 2530 void Debugger::EnterSingleStepMode() {
2526 stepping_fp_ = 0; 2531 stepping_fp_ = 0;
2527 DeoptimizeWorld(); 2532 DeoptimizeWorld();
2528 isolate_->set_single_step(true); 2533 isolate_->set_single_step(true);
(...skipping 20 matching lines...) Expand all
2549 isolate_->set_single_step(true); 2554 isolate_->set_single_step(true);
2550 // Find topmost caller that is debuggable. 2555 // Find topmost caller that is debuggable.
2551 for (intptr_t i = 1; i < stack_trace->Length(); i++) { 2556 for (intptr_t i = 1; i < stack_trace->Length(); i++) {
2552 ActivationFrame* frame = stack_trace->FrameAt(i); 2557 ActivationFrame* frame = stack_trace->FrameAt(i);
2553 if (frame->IsDebuggable()) { 2558 if (frame->IsDebuggable()) {
2554 stepping_fp_ = frame->fp(); 2559 stepping_fp_ = frame->fp();
2555 break; 2560 break;
2556 } 2561 }
2557 } 2562 }
2558 } 2563 }
2559 if (!isolate_->single_step()) {
2560 // We are no longer single stepping, make sure that the ThreadInterrupter
2561 // is awake.
2562 ThreadInterrupter::WakeUp();
2563 }
2564 } 2564 }
2565 2565
2566 2566
2567 // static 2567 // static
2568 bool Debugger::IsDebuggable(const Function& func) { 2568 bool Debugger::IsDebuggable(const Function& func) {
2569 if (!func.is_debuggable()) { 2569 if (!func.is_debuggable()) {
2570 return false; 2570 return false;
2571 } 2571 }
2572 if (ServiceIsolate::IsRunning()) { 2572 if (ServiceIsolate::IsRunning()) {
2573 return true; 2573 return true;
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
3250 } 3250 }
3251 3251
3252 3252
3253 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 3253 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
3254 ASSERT(bpt->next() == NULL); 3254 ASSERT(bpt->next() == NULL);
3255 bpt->set_next(code_breakpoints_); 3255 bpt->set_next(code_breakpoints_);
3256 code_breakpoints_ = bpt; 3256 code_breakpoints_ = bpt;
3257 } 3257 }
3258 3258
3259 } // namespace dart 3259 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698