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

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

Issue 149123003: Handle all debugger stepping with the isolate single step flag (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/code_generator.cc ('k') | runtime/vm/debugger.cc » ('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 #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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // Utility functions. 355 // Utility functions.
356 static const char* QualifiedFunctionName(const Function& func); 356 static const char* QualifiedFunctionName(const Function& func);
357 357
358 RawObject* GetInstanceField(const Class& cls, 358 RawObject* GetInstanceField(const Class& cls,
359 const String& field_name, 359 const String& field_name,
360 const Instance& object); 360 const Instance& object);
361 RawObject* GetStaticField(const Class& cls, 361 RawObject* GetStaticField(const Class& cls,
362 const String& field_name); 362 const String& field_name);
363 363
364 void SignalBpReached(); 364 void SignalBpReached();
365 void SingleStepCallback(); 365 void DebuggerStepCallback();
366 366
367 void SignalExceptionThrown(const Instance& exc); 367 void SignalExceptionThrown(const Instance& exc);
368 static void SignalIsolateEvent(EventType type); 368 static void SignalIsolateEvent(EventType type);
369 369
370 uword GetPatchedStubAddress(uword breakpoint_address); 370 uword GetPatchedStubAddress(uword breakpoint_address);
371 371
372 void PrintBreakpointsToJSONArray(JSONArray* jsarr) const; 372 void PrintBreakpointsToJSONArray(JSONArray* jsarr) const;
373 373
374 static bool IsDebuggable(const Function& func); 374 static bool IsDebuggable(const Function& func);
375 375
376 private: 376 private:
377 enum ResumeAction { 377 enum ResumeAction {
378 kContinue, 378 kContinue,
379 kStepOver, 379 kStepOver,
380 kStepOut, 380 kStepOut,
381 kSingleStep 381 kSingleStep
382 }; 382 };
383 383
384 void FindEquivalentFunctions(const Script& script, 384 void FindEquivalentFunctions(const Script& script,
385 intptr_t start_pos, 385 intptr_t start_pos,
386 intptr_t end_pos, 386 intptr_t end_pos,
387 GrowableObjectArray* function_list); 387 GrowableObjectArray* function_list);
388 RawFunction* FindBestFit(const Script& script, intptr_t token_pos); 388 RawFunction* FindBestFit(const Script& script, intptr_t token_pos);
389 RawFunction* FindInnermostClosure(const Function& function, 389 RawFunction* FindInnermostClosure(const Function& function,
390 intptr_t token_pos); 390 intptr_t token_pos);
391 intptr_t ResolveBreakpointPos(const Function& func, 391 intptr_t ResolveBreakpointPos(const Function& func,
392 intptr_t requested_token_pos); 392 intptr_t requested_token_pos);
393 void DeoptimizeWorld(); 393 void DeoptimizeWorld();
394 void InstrumentForStepping(const Function& target_function); 394 void SetInternalBreakpoints(const Function& target_function);
395 SourceBreakpoint* SetBreakpoint(const Script& script, intptr_t token_pos); 395 SourceBreakpoint* SetBreakpoint(const Script& script, intptr_t token_pos);
396 SourceBreakpoint* SetBreakpoint(const Function& target_function, 396 SourceBreakpoint* SetBreakpoint(const Function& target_function,
397 intptr_t first_token_pos, 397 intptr_t first_token_pos,
398 intptr_t last_token_pos); 398 intptr_t last_token_pos);
399 void RemoveInternalBreakpoints(); 399 void RemoveInternalBreakpoints();
400 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt); 400 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt);
401 void RegisterSourceBreakpoint(SourceBreakpoint* bpt); 401 void RegisterSourceBreakpoint(SourceBreakpoint* bpt);
402 void RegisterCodeBreakpoint(CodeBreakpoint* bpt); 402 void RegisterCodeBreakpoint(CodeBreakpoint* bpt);
403 SourceBreakpoint* GetSourceBreakpoint(const Script& script, 403 SourceBreakpoint* GetSourceBreakpoint(const Script& script,
404 intptr_t token_pos); 404 intptr_t token_pos);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 // paused for breakpoints, isolate interruption, and (sometimes) 464 // paused for breakpoints, isolate interruption, and (sometimes)
465 // exceptions. 465 // exceptions.
466 DebuggerEvent* pause_event_; 466 DebuggerEvent* pause_event_;
467 467
468 // An id -> object map. Valid only while IsPaused(). 468 // An id -> object map. Valid only while IsPaused().
469 RemoteObjectCache* obj_cache_; 469 RemoteObjectCache* obj_cache_;
470 470
471 // Current stack trace. Valid only while IsPaused(). 471 // Current stack trace. Valid only while IsPaused().
472 DebuggerStackTrace* stack_trace_; 472 DebuggerStackTrace* stack_trace_;
473 473
474 // When stepping through code, only pause the program if the top
475 // frame corresponds to this fp value, or if the top frame is
476 // lower on the stack.
477 uword stepping_fp_;
478
474 Dart_ExceptionPauseInfo exc_pause_info_; 479 Dart_ExceptionPauseInfo exc_pause_info_;
475 480
476 static EventHandler* event_handler_; 481 static EventHandler* event_handler_;
477 482
478 friend class Isolate; 483 friend class Isolate;
479 friend class SourceBreakpoint; 484 friend class SourceBreakpoint;
480 DISALLOW_COPY_AND_ASSIGN(Debugger); 485 DISALLOW_COPY_AND_ASSIGN(Debugger);
481 }; 486 };
482 487
483 488
484 } // namespace dart 489 } // namespace dart
485 490
486 #endif // VM_DEBUGGER_H_ 491 #endif // VM_DEBUGGER_H_
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698