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; |
| 19 class JSONStream; |
18 class ObjectPointerVisitor; | 20 class ObjectPointerVisitor; |
19 class RemoteObjectCache; | 21 class RemoteObjectCache; |
20 class SourceBreakpoint; | 22 class SourceBreakpoint; |
21 class StackFrame; | 23 class StackFrame; |
22 | 24 |
23 // SourceBreakpoint represents a user-specified breakpoint location in | 25 // SourceBreakpoint represents a user-specified breakpoint location in |
24 // Dart source. There may be more than one CodeBreakpoint object per | 26 // Dart source. There may be more than one CodeBreakpoint object per |
25 // SourceBreakpoint. | 27 // SourceBreakpoint. |
26 class SourceBreakpoint { | 28 class SourceBreakpoint { |
27 public: | 29 public: |
28 SourceBreakpoint(intptr_t id, const Function& func, intptr_t token_pos); | 30 SourceBreakpoint(intptr_t id, const Function& func, intptr_t token_pos); |
29 | 31 |
30 RawFunction* function() const { return function_; } | 32 RawFunction* function() const { return function_; } |
31 intptr_t token_pos() const { return token_pos_; } | 33 intptr_t token_pos() const { return token_pos_; } |
32 void set_token_pos(intptr_t value) { token_pos_ = value; } | 34 void set_token_pos(intptr_t value) { token_pos_ = value; } |
33 intptr_t id() const { return id_; } | 35 intptr_t id() const { return id_; } |
34 | 36 |
35 RawScript* SourceCode(); | 37 RawScript* SourceCode(); |
36 RawString* SourceUrl(); | 38 RawString* SourceUrl(); |
37 intptr_t LineNumber(); | 39 intptr_t LineNumber(); |
38 | 40 |
39 void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos); | 41 void GetCodeLocation(Library* lib, |
| 42 Script* script, |
| 43 intptr_t* token_pos) const; |
40 | 44 |
41 void Enable(); | 45 void Enable(); |
42 void Disable(); | 46 void Disable(); |
43 bool IsEnabled() const { return is_enabled_; } | 47 bool IsEnabled() const { return is_enabled_; } |
44 | 48 |
| 49 void PrintToJSONStream(JSONStream* stream) const; |
| 50 |
45 private: | 51 private: |
46 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 52 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
47 | 53 |
48 void set_function(const Function& func); | 54 void set_function(const Function& func); |
49 void set_next(SourceBreakpoint* value) { next_ = value; } | 55 void set_next(SourceBreakpoint* value) { next_ = value; } |
50 SourceBreakpoint* next() const { return this->next_; } | 56 SourceBreakpoint* next() const { return this->next_; } |
51 | 57 |
52 const intptr_t id_; | 58 const intptr_t id_; |
53 RawFunction* function_; | 59 RawFunction* function_; |
54 intptr_t token_pos_; | 60 intptr_t token_pos_; |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 const String& field_name); | 351 const String& field_name); |
346 | 352 |
347 void SignalBpReached(); | 353 void SignalBpReached(); |
348 void SingleStepCallback(); | 354 void SingleStepCallback(); |
349 | 355 |
350 void SignalExceptionThrown(const Instance& exc); | 356 void SignalExceptionThrown(const Instance& exc); |
351 static void SignalIsolateEvent(EventType type); | 357 static void SignalIsolateEvent(EventType type); |
352 | 358 |
353 uword GetPatchedStubAddress(uword breakpoint_address); | 359 uword GetPatchedStubAddress(uword breakpoint_address); |
354 | 360 |
| 361 void PrintBreakpointsToJSONArray(JSONArray* jsarr) const; |
| 362 |
355 static bool IsDebuggable(const Function& func); | 363 static bool IsDebuggable(const Function& func); |
356 | 364 |
357 private: | 365 private: |
358 enum ResumeAction { | 366 enum ResumeAction { |
359 kContinue, | 367 kContinue, |
360 kStepOver, | 368 kStepOver, |
361 kStepOut, | 369 kStepOut, |
362 kSingleStep | 370 kSingleStep |
363 }; | 371 }; |
364 | 372 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 452 |
445 friend class Isolate; | 453 friend class Isolate; |
446 friend class SourceBreakpoint; | 454 friend class SourceBreakpoint; |
447 DISALLOW_COPY_AND_ASSIGN(Debugger); | 455 DISALLOW_COPY_AND_ASSIGN(Debugger); |
448 }; | 456 }; |
449 | 457 |
450 | 458 |
451 } // namespace dart | 459 } // namespace dart |
452 | 460 |
453 #endif // VM_DEBUGGER_H_ | 461 #endif // VM_DEBUGGER_H_ |
OLD | NEW |