| 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" |
| 11 #include "vm/port.h" | 11 #include "vm/port.h" |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 class ActiveVariables; | 15 class ActiveVariables; |
| 16 class CodeBreakpoint; | 16 class CodeBreakpoint; |
| 17 class Isolate; | 17 class Isolate; |
| 18 class JSONArray; | 18 class JSONArray; |
| 19 class JSONStream; | 19 class JSONStream; |
| 20 class ObjectPointerVisitor; | 20 class ObjectPointerVisitor; |
| 21 class RemoteObjectCache; | 21 class RemoteObjectCache; |
| 22 class SourceBreakpoint; | 22 class SourceBreakpoint; |
| 23 class StackFrame; | 23 class StackFrame; |
| 24 | 24 |
| 25 // SourceBreakpoint represents a user-specified breakpoint location in | 25 // SourceBreakpoint represents a user-specified breakpoint location in |
| 26 // Dart source. There may be more than one CodeBreakpoint object per | 26 // Dart source. There may be more than one CodeBreakpoint object per |
| 27 // SourceBreakpoint. | 27 // SourceBreakpoint. |
| 28 class SourceBreakpoint { | 28 class SourceBreakpoint { |
| 29 public: | 29 public: |
| 30 SourceBreakpoint(intptr_t id, const Script& script, intptr_t token_pos); | 30 SourceBreakpoint(intptr_t id, |
| 31 const Script& script, |
| 32 intptr_t token_pos, |
| 33 intptr_t end_token_pos); |
| 31 | 34 |
| 32 RawFunction* function() const { return function_; } | 35 RawFunction* function() const { return function_; } |
| 33 intptr_t token_pos() const { return token_pos_; } | 36 intptr_t token_pos() const { return token_pos_; } |
| 37 intptr_t end_token_pos() const { return end_token_pos_; } |
| 34 intptr_t id() const { return id_; } | 38 intptr_t id() const { return id_; } |
| 35 | 39 |
| 36 RawScript* script() { return script_; } | 40 RawScript* script() { return script_; } |
| 37 RawString* SourceUrl(); | 41 RawString* SourceUrl(); |
| 38 intptr_t LineNumber(); | 42 intptr_t LineNumber(); |
| 39 | 43 |
| 40 void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos); | 44 void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos); |
| 41 | 45 |
| 42 void Enable(); | 46 void Enable(); |
| 43 void Disable(); | 47 void Disable(); |
| 44 bool IsEnabled() const { return is_enabled_; } | 48 bool IsEnabled() const { return is_enabled_; } |
| 45 bool IsResolved() { return is_resolved_; } | 49 bool IsResolved() { return is_resolved_; } |
| 46 | 50 |
| 47 void PrintToJSONStream(JSONStream* stream); | 51 void PrintToJSONStream(JSONStream* stream); |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 54 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 51 | 55 |
| 52 void SetResolved(const Function& func, intptr_t token_pos); | 56 void SetResolved(const Function& func, intptr_t token_pos); |
| 53 void set_next(SourceBreakpoint* value) { next_ = value; } | 57 void set_next(SourceBreakpoint* value) { next_ = value; } |
| 54 SourceBreakpoint* next() const { return this->next_; } | 58 SourceBreakpoint* next() const { return this->next_; } |
| 55 | 59 |
| 56 const intptr_t id_; | 60 const intptr_t id_; |
| 57 RawScript* script_; | 61 RawScript* script_; |
| 58 intptr_t token_pos_; | 62 intptr_t token_pos_; |
| 63 intptr_t end_token_pos_; |
| 59 bool is_resolved_; | 64 bool is_resolved_; |
| 60 bool is_enabled_; | 65 bool is_enabled_; |
| 61 SourceBreakpoint* next_; | 66 SourceBreakpoint* next_; |
| 62 | 67 |
| 63 // Valid for resolved breakpoints: | 68 // Valid for resolved breakpoints: |
| 64 RawFunction* function_; | 69 RawFunction* function_; |
| 65 intptr_t line_number_; | 70 intptr_t line_number_; |
| 66 | 71 |
| 67 friend class Debugger; | 72 friend class Debugger; |
| 68 DISALLOW_COPY_AND_ASSIGN(SourceBreakpoint); | 73 DISALLOW_COPY_AND_ASSIGN(SourceBreakpoint); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 }; | 390 }; |
| 386 | 391 |
| 387 void FindCompiledFunctions(const Script& script, | 392 void FindCompiledFunctions(const Script& script, |
| 388 intptr_t start_pos, | 393 intptr_t start_pos, |
| 389 intptr_t end_pos, | 394 intptr_t end_pos, |
| 390 GrowableObjectArray* function_list); | 395 GrowableObjectArray* function_list); |
| 391 RawFunction* FindBestFit(const Script& script, intptr_t token_pos); | 396 RawFunction* FindBestFit(const Script& script, intptr_t token_pos); |
| 392 RawFunction* FindInnermostClosure(const Function& function, | 397 RawFunction* FindInnermostClosure(const Function& function, |
| 393 intptr_t token_pos); | 398 intptr_t token_pos); |
| 394 intptr_t ResolveBreakpointPos(const Function& func, | 399 intptr_t ResolveBreakpointPos(const Function& func, |
| 395 intptr_t requested_token_pos); | 400 intptr_t requested_token_pos, |
| 401 intptr_t last_token_pos); |
| 396 void DeoptimizeWorld(); | 402 void DeoptimizeWorld(); |
| 397 void SetInternalBreakpoints(const Function& target_function); | 403 void SetInternalBreakpoints(const Function& target_function); |
| 398 SourceBreakpoint* SetBreakpoint(const Script& script, intptr_t token_pos); | 404 SourceBreakpoint* SetBreakpoint(const Script& script, |
| 399 SourceBreakpoint* SetBreakpoint(const Function& target_function, | 405 intptr_t token_pos, |
| 400 intptr_t first_token_pos, | |
| 401 intptr_t last_token_pos); | 406 intptr_t last_token_pos); |
| 402 void RemoveInternalBreakpoints(); | 407 void RemoveInternalBreakpoints(); |
| 403 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt); | 408 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt); |
| 404 void RegisterSourceBreakpoint(SourceBreakpoint* bpt); | 409 void RegisterSourceBreakpoint(SourceBreakpoint* bpt); |
| 405 void RegisterCodeBreakpoint(CodeBreakpoint* bpt); | 410 void RegisterCodeBreakpoint(CodeBreakpoint* bpt); |
| 406 SourceBreakpoint* GetSourceBreakpoint(const Script& script, | 411 SourceBreakpoint* GetSourceBreakpoint(const Script& script, |
| 407 intptr_t token_pos); | 412 intptr_t token_pos); |
| 408 void MakeCodeBreakpointsAt(const Function& func, | 413 void MakeCodeBreakpointsAt(const Function& func, |
| 409 SourceBreakpoint* bpt); | 414 SourceBreakpoint* bpt); |
| 410 // Returns NULL if no breakpoint exists for the given address. | 415 // Returns NULL if no breakpoint exists for the given address. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 492 |
| 488 friend class Isolate; | 493 friend class Isolate; |
| 489 friend class SourceBreakpoint; | 494 friend class SourceBreakpoint; |
| 490 DISALLOW_COPY_AND_ASSIGN(Debugger); | 495 DISALLOW_COPY_AND_ASSIGN(Debugger); |
| 491 }; | 496 }; |
| 492 | 497 |
| 493 | 498 |
| 494 } // namespace dart | 499 } // namespace dart |
| 495 | 500 |
| 496 #endif // VM_DEBUGGER_H_ | 501 #endif // VM_DEBUGGER_H_ |
| OLD | NEW |