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

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

Issue 2689623002: Delete Breakpoint objects, fixing memory leak (Closed)
Patch Set: wip Created 3 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
« no previous file with comments | « runtime/tests/vm/vm.status ('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 RUNTIME_VM_DEBUGGER_H_ 5 #ifndef RUNTIME_VM_DEBUGGER_H_
6 #define RUNTIME_VM_DEBUGGER_H_ 6 #define RUNTIME_VM_DEBUGGER_H_
7 7
8 #include "include/dart_tools_api.h" 8 #include "include/dart_tools_api.h"
9 9
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 public: 197 public:
198 CodeBreakpoint(const Code& code, 198 CodeBreakpoint(const Code& code,
199 TokenPosition token_pos, 199 TokenPosition token_pos,
200 uword pc, 200 uword pc,
201 RawPcDescriptors::Kind kind); 201 RawPcDescriptors::Kind kind);
202 ~CodeBreakpoint(); 202 ~CodeBreakpoint();
203 203
204 RawFunction* function() const; 204 RawFunction* function() const;
205 uword pc() const { return pc_; } 205 uword pc() const { return pc_; }
206 TokenPosition token_pos() const { return token_pos_; } 206 TokenPosition token_pos() const { return token_pos_; }
207 bool IsInternal() const { return bpt_location_ == NULL; }
208 207
209 RawScript* SourceCode(); 208 RawScript* SourceCode();
210 RawString* SourceUrl(); 209 RawString* SourceUrl();
211 intptr_t LineNumber(); 210 intptr_t LineNumber();
212 211
213 void Enable(); 212 void Enable();
214 void Disable(); 213 void Disable();
215 bool IsEnabled() const { return is_enabled_; } 214 bool IsEnabled() const { return is_enabled_; }
216 215
217 RawCode* OrigStubAddress() const; 216 RawCode* OrigStubAddress() const;
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 TokenPosition ResolveBreakpointPos(const Function& func, 603 TokenPosition ResolveBreakpointPos(const Function& func,
605 TokenPosition requested_token_pos, 604 TokenPosition requested_token_pos,
606 TokenPosition last_token_pos, 605 TokenPosition last_token_pos,
607 intptr_t requested_column); 606 intptr_t requested_column);
608 void DeoptimizeWorld(); 607 void DeoptimizeWorld();
609 BreakpointLocation* SetBreakpoint(const Script& script, 608 BreakpointLocation* SetBreakpoint(const Script& script,
610 TokenPosition token_pos, 609 TokenPosition token_pos,
611 TokenPosition last_token_pos, 610 TokenPosition last_token_pos,
612 intptr_t requested_line, 611 intptr_t requested_line,
613 intptr_t requested_column); 612 intptr_t requested_column);
614 void RemoveInternalBreakpoints(); 613 void RemoveUnlinkedCodeBreakpoints();
615 void UnlinkCodeBreakpoints(BreakpointLocation* bpt_location); 614 void UnlinkCodeBreakpoints(BreakpointLocation* bpt_location);
616 BreakpointLocation* GetLatentBreakpoint(const String& url, 615 BreakpointLocation* GetLatentBreakpoint(const String& url,
617 intptr_t line, 616 intptr_t line,
618 intptr_t column); 617 intptr_t column);
619 void RegisterBreakpointLocation(BreakpointLocation* bpt); 618 void RegisterBreakpointLocation(BreakpointLocation* bpt);
620 void RegisterCodeBreakpoint(CodeBreakpoint* bpt); 619 void RegisterCodeBreakpoint(CodeBreakpoint* bpt);
621 BreakpointLocation* GetBreakpointLocation(const Script& script, 620 BreakpointLocation* GetBreakpointLocation(const Script& script,
622 TokenPosition token_pos, 621 TokenPosition token_pos,
623 intptr_t requested_column); 622 intptr_t requested_column);
624 void MakeCodeBreakpointAt(const Function& func, BreakpointLocation* bpt); 623 void MakeCodeBreakpointAt(const Function& func, BreakpointLocation* bpt);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 // When stepping through code, only pause the program if the top 718 // When stepping through code, only pause the program if the top
720 // frame corresponds to this fp value, or if the top frame is 719 // frame corresponds to this fp value, or if the top frame is
721 // lower on the stack. 720 // lower on the stack.
722 uword stepping_fp_; 721 uword stepping_fp_;
723 722
724 // If we step while at a breakpoint, we would hit the same pc twice. 723 // If we step while at a breakpoint, we would hit the same pc twice.
725 // We use this field to let us skip the next single-step after a 724 // We use this field to let us skip the next single-step after a
726 // breakpoint. 725 // breakpoint.
727 bool skip_next_step_; 726 bool skip_next_step_;
728 727
728 bool needs_breakpoint_cleanup_;
729
729 // We keep this breakpoint alive until after the debugger does the step over 730 // We keep this breakpoint alive until after the debugger does the step over
730 // async continuation machinery so that we can report that we've stopped 731 // async continuation machinery so that we can report that we've stopped
731 // at the breakpoint. 732 // at the breakpoint.
732 Breakpoint* synthetic_async_breakpoint_; 733 Breakpoint* synthetic_async_breakpoint_;
733 734
734 Dart_ExceptionPauseInfo exc_pause_info_; 735 Dart_ExceptionPauseInfo exc_pause_info_;
735 736
736 static EventHandler* event_handler_; 737 static EventHandler* event_handler_;
737 738
738 friend class Isolate; 739 friend class Isolate;
739 friend class BreakpointLocation; 740 friend class BreakpointLocation;
740 DISALLOW_COPY_AND_ASSIGN(Debugger); 741 DISALLOW_COPY_AND_ASSIGN(Debugger);
741 }; 742 };
742 743
743 744
744 } // namespace dart 745 } // namespace dart
745 746
746 #endif // RUNTIME_VM_DEBUGGER_H_ 747 #endif // RUNTIME_VM_DEBUGGER_H_
OLDNEW
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698