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 #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 30 matching lines...) Expand all Loading... |
41 RawString* SourceUrl(); | 41 RawString* SourceUrl(); |
42 intptr_t LineNumber(); | 42 intptr_t LineNumber(); |
43 | 43 |
44 void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos); | 44 void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos); |
45 | 45 |
46 void Enable(); | 46 void Enable(); |
47 void Disable(); | 47 void Disable(); |
48 bool IsEnabled() const { return is_enabled_; } | 48 bool IsEnabled() const { return is_enabled_; } |
49 bool IsResolved() const { return is_resolved_; } | 49 bool IsResolved() const { return is_resolved_; } |
50 | 50 |
| 51 bool IsOneShot() const { return is_one_shot_; } |
| 52 void SetIsOneShot() { is_one_shot_ = true; } |
| 53 |
51 void PrintJSON(JSONStream* stream); | 54 void PrintJSON(JSONStream* stream); |
52 | 55 |
53 private: | 56 private: |
54 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 57 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
55 | 58 |
56 void SetResolved(const Function& func, intptr_t token_pos); | 59 void SetResolved(const Function& func, intptr_t token_pos); |
57 void set_next(SourceBreakpoint* value) { next_ = value; } | 60 void set_next(SourceBreakpoint* value) { next_ = value; } |
58 SourceBreakpoint* next() const { return this->next_; } | 61 SourceBreakpoint* next() const { return this->next_; } |
59 | 62 |
60 const intptr_t id_; | 63 const intptr_t id_; |
61 RawScript* script_; | 64 RawScript* script_; |
62 intptr_t token_pos_; | 65 intptr_t token_pos_; |
63 intptr_t end_token_pos_; | 66 intptr_t end_token_pos_; |
64 bool is_resolved_; | 67 bool is_resolved_; |
65 bool is_enabled_; | 68 bool is_enabled_; |
| 69 bool is_one_shot_; |
66 SourceBreakpoint* next_; | 70 SourceBreakpoint* next_; |
67 | 71 |
68 // Valid for resolved breakpoints: | 72 // Valid for resolved breakpoints: |
69 RawFunction* function_; | 73 RawFunction* function_; |
70 intptr_t line_number_; | 74 intptr_t line_number_; |
71 | 75 |
72 friend class Debugger; | 76 friend class Debugger; |
73 DISALLOW_COPY_AND_ASSIGN(SourceBreakpoint); | 77 DISALLOW_COPY_AND_ASSIGN(SourceBreakpoint); |
74 }; | 78 }; |
75 | 79 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 intptr_t start_pos, | 450 intptr_t start_pos, |
447 intptr_t end_pos, | 451 intptr_t end_pos, |
448 GrowableObjectArray* function_list); | 452 GrowableObjectArray* function_list); |
449 RawFunction* FindBestFit(const Script& script, intptr_t token_pos); | 453 RawFunction* FindBestFit(const Script& script, intptr_t token_pos); |
450 RawFunction* FindInnermostClosure(const Function& function, | 454 RawFunction* FindInnermostClosure(const Function& function, |
451 intptr_t token_pos); | 455 intptr_t token_pos); |
452 intptr_t ResolveBreakpointPos(const Function& func, | 456 intptr_t ResolveBreakpointPos(const Function& func, |
453 intptr_t requested_token_pos, | 457 intptr_t requested_token_pos, |
454 intptr_t last_token_pos); | 458 intptr_t last_token_pos); |
455 void DeoptimizeWorld(); | 459 void DeoptimizeWorld(); |
456 RawError* SetInternalBreakpoints(const Function& target_function); | |
457 SourceBreakpoint* SetBreakpoint(const Script& script, | 460 SourceBreakpoint* SetBreakpoint(const Script& script, |
458 intptr_t token_pos, | 461 intptr_t token_pos, |
459 intptr_t last_token_pos); | 462 intptr_t last_token_pos); |
460 void RemoveInternalBreakpoints(); | 463 void RemoveInternalBreakpoints(); |
461 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt); | 464 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt); |
462 void RegisterSourceBreakpoint(SourceBreakpoint* bpt); | 465 void RegisterSourceBreakpoint(SourceBreakpoint* bpt); |
463 void RegisterCodeBreakpoint(CodeBreakpoint* bpt); | 466 void RegisterCodeBreakpoint(CodeBreakpoint* bpt); |
464 SourceBreakpoint* GetSourceBreakpoint(const Script& script, | 467 SourceBreakpoint* GetSourceBreakpoint(const Script& script, |
465 intptr_t token_pos); | 468 intptr_t token_pos); |
466 void MakeCodeBreakpointAt(const Function& func, | 469 void MakeCodeBreakpointAt(const Function& func, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 | 546 |
544 friend class Isolate; | 547 friend class Isolate; |
545 friend class SourceBreakpoint; | 548 friend class SourceBreakpoint; |
546 DISALLOW_COPY_AND_ASSIGN(Debugger); | 549 DISALLOW_COPY_AND_ASSIGN(Debugger); |
547 }; | 550 }; |
548 | 551 |
549 | 552 |
550 } // namespace dart | 553 } // namespace dart |
551 | 554 |
552 #endif // VM_DEBUGGER_H_ | 555 #endif // VM_DEBUGGER_H_ |
OLD | NEW |