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

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

Issue 118603002: Keep track of current "pause" event in the debugger. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | « no previous file | runtime/vm/debugger.cc » ('j') | runtime/vm/debugger.cc » ('J')
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 #ifndef VM_DEBUGGER_H_ 5 #ifndef VM_DEBUGGER_H_
6 #define VM_DEBUGGER_H_ 6 #define VM_DEBUGGER_H_
7 7
8 #include "include/dart_debugger_api.h" 8 #include "include/dart_debugger_api.h"
9 9
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 void OneTimeBreakAtEntry(const Function& target_function); 297 void OneTimeBreakAtEntry(const Function& target_function);
298 298
299 void RemoveBreakpoint(intptr_t bp_id); 299 void RemoveBreakpoint(intptr_t bp_id);
300 SourceBreakpoint* GetBreakpointById(intptr_t id); 300 SourceBreakpoint* GetBreakpointById(intptr_t id);
301 301
302 void SetStepOver(); 302 void SetStepOver();
303 void SetSingleStep(); 303 void SetSingleStep();
304 void SetStepOut(); 304 void SetStepOut();
305 bool IsStepping() const { return resume_action_ != kContinue; } 305 bool IsStepping() const { return resume_action_ != kContinue; }
306 306
307 bool IsPaused() const { return pause_event_ != NULL; }
308
309 // Indicates why the debugger is currently paused. If the debugger
310 // is not paused, this returns NULL. Note that the debugger can be
311 // paused for breakpoints, isolate interruption, and (sometimes)
312 // exceptions.
313 const DebuggerEvent* PauseEvent() const { return pause_event_; }
314
307 void SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info); 315 void SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info);
308 Dart_ExceptionPauseInfo GetExceptionPauseInfo(); 316 Dart_ExceptionPauseInfo GetExceptionPauseInfo();
309 317
310 void VisitObjectPointers(ObjectPointerVisitor* visitor); 318 void VisitObjectPointers(ObjectPointerVisitor* visitor);
311 319
312 // Called from Runtime when a breakpoint in Dart code is reached. 320 // Called from Runtime when a breakpoint in Dart code is reached.
313 void BreakpointCallback(); 321 void BreakpointCallback();
314 322
315 // Returns true if there is at least one breakpoint set in func. 323 // Returns true if there is at least one breakpoint set in func.
316 // Checks for both user-defined and internal temporary breakpoints. 324 // Checks for both user-defined and internal temporary breakpoints.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 intptr_t nextId() { return next_id_++; } 420 intptr_t nextId() { return next_id_++; }
413 421
414 bool ShouldPauseOnException(DebuggerStackTrace* stack_trace, 422 bool ShouldPauseOnException(DebuggerStackTrace* stack_trace,
415 const Instance& exc); 423 const Instance& exc);
416 424
417 void CollectLibraryFields(const GrowableObjectArray& field_list, 425 void CollectLibraryFields(const GrowableObjectArray& field_list,
418 const Library& lib, 426 const Library& lib,
419 const String& prefix, 427 const String& prefix,
420 bool include_private_fields); 428 bool include_private_fields);
421 429
430 // Handles any events which pause vm execution. Breakpoints,
431 // interrupts, etc.
432 void Pause(DebuggerEvent* event);
433
422 Isolate* isolate_; 434 Isolate* isolate_;
423 Dart_Port isolate_id_; // A unique ID for the isolate in the debugger. 435 Dart_Port isolate_id_; // A unique ID for the isolate in the debugger.
424 bool initialized_; 436 bool initialized_;
425 437
426 // ID number generator. 438 // ID number generator.
427 intptr_t next_id_; 439 intptr_t next_id_;
428 440
429 // Current stack trace. Valid while executing breakpoint callback code.
430 DebuggerStackTrace* stack_trace_;
431
432 RemoteObjectCache* obj_cache_;
433 441
434 SourceBreakpoint* src_breakpoints_; 442 SourceBreakpoint* src_breakpoints_;
435 CodeBreakpoint* code_breakpoints_; 443 CodeBreakpoint* code_breakpoints_;
436 444
437 // Tells debugger what to do when resuming execution after a breakpoint. 445 // Tells debugger what to do when resuming execution after a breakpoint.
438 ResumeAction resume_action_; 446 ResumeAction resume_action_;
439 447
440 // Do not call back to breakpoint handler if this flag is set. 448 // Do not call back to breakpoint handler if this flag is set.
441 // Effectively this means ignoring breakpoints. Set when Dart code may 449 // Effectively this means ignoring breakpoints. Set when Dart code may
442 // be run as a side effect of getting values of fields. 450 // be run as a side effect of getting values of fields.
443 bool ignore_breakpoints_; 451 bool ignore_breakpoints_;
444 452
445 // True while debugger calls event_handler_. Used to prevent recursive 453 // Indicates why the debugger is currently paused. If the debugger
446 // debugger events. 454 // is not paused, this is NULL. Note that the debugger can be
447 bool in_event_notification_; 455 // paused for breakpoints, isolate interruption, and (sometimes)
456 // exceptions.
457 DebuggerEvent* pause_event_;
458
459 // An id -> object map. Valid only while IsPaused().
460 RemoteObjectCache* obj_cache_;
461
462 // Current stack trace. Valid only while IsPaused().
463 DebuggerStackTrace* stack_trace_;
448 464
449 Dart_ExceptionPauseInfo exc_pause_info_; 465 Dart_ExceptionPauseInfo exc_pause_info_;
450 466
451 static EventHandler* event_handler_; 467 static EventHandler* event_handler_;
452 468
453 friend class Isolate; 469 friend class Isolate;
454 friend class SourceBreakpoint; 470 friend class SourceBreakpoint;
455 DISALLOW_COPY_AND_ASSIGN(Debugger); 471 DISALLOW_COPY_AND_ASSIGN(Debugger);
456 }; 472 };
457 473
458 474
459 } // namespace dart 475 } // namespace dart
460 476
461 #endif // VM_DEBUGGER_H_ 477 #endif // VM_DEBUGGER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/debugger.cc » ('j') | runtime/vm/debugger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698