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

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

Issue 10657048: Debugger support to display global variables (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 union { 107 union {
108 uword target_address_; 108 uword target_address_;
109 uint8_t raw[2 * sizeof(uword)]; 109 uint8_t raw[2 * sizeof(uword)];
110 } saved_bytes_; 110 } saved_bytes_;
111 111
112 friend class Debugger; 112 friend class Debugger;
113 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); 113 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint);
114 }; 114 };
115 115
116 116
117
118
119 // ActivationFrame represents one dart function activation frame 117 // ActivationFrame represents one dart function activation frame
120 // on the call stack. 118 // on the call stack.
121 class ActivationFrame : public ZoneAllocated { 119 class ActivationFrame : public ZoneAllocated {
122 public: 120 public:
123 explicit ActivationFrame(uword pc, uword fp, uword sp, const Context& ctx); 121 explicit ActivationFrame(uword pc, uword fp, uword sp, const Context& ctx);
124 122
125 uword pc() const { return pc_; } 123 uword pc() const { return pc_; }
126 uword fp() const { return fp_; } 124 uword fp() const { return fp_; }
127 uword sp() const { return sp_; } 125 uword sp() const { return sp_; }
128 126
129 const Function& DartFunction(); 127 const Function& DartFunction();
130 RawString* QualifiedFunctionName(); 128 RawString* QualifiedFunctionName();
131 RawString* SourceUrl(); 129 RawString* SourceUrl();
132 RawScript* SourceScript(); 130 RawScript* SourceScript();
131 RawLibrary* Library();
133 intptr_t TokenIndex(); 132 intptr_t TokenIndex();
134 intptr_t LineNumber(); 133 intptr_t LineNumber();
135 134
136 // The context level of a frame is the context level at the 135 // The context level of a frame is the context level at the
137 // PC/token index of the frame. It determines the depth of the context 136 // PC/token index of the frame. It determines the depth of the context
138 // chain that belongs to the function of this activation frame. 137 // chain that belongs to the function of this activation frame.
139 intptr_t ContextLevel(); 138 intptr_t ContextLevel();
140 139
141 const char* ToCString(); 140 const char* ToCString();
142 141
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 void VisitObjectPointers(ObjectPointerVisitor* visitor); 256 void VisitObjectPointers(ObjectPointerVisitor* visitor);
258 257
259 // Called from Runtime when a breakpoint in Dart code is reached. 258 // Called from Runtime when a breakpoint in Dart code is reached.
260 void BreakpointCallback(); 259 void BreakpointCallback();
261 260
262 DebuggerStackTrace* StackTrace() const { return stack_trace_; } 261 DebuggerStackTrace* StackTrace() const { return stack_trace_; }
263 262
264 RawArray* GetInstanceFields(const Instance& obj); 263 RawArray* GetInstanceFields(const Instance& obj);
265 RawArray* GetStaticFields(const Class& cls); 264 RawArray* GetStaticFields(const Class& cls);
266 RawArray* GetLibraryFields(const Library& lib); 265 RawArray* GetLibraryFields(const Library& lib);
266 RawArray* GetGlobalFields(const Library& lib);
267 267
268 intptr_t CacheObject(const Object& obj); 268 intptr_t CacheObject(const Object& obj);
269 RawObject* GetCachedObject(intptr_t obj_id); 269 RawObject* GetCachedObject(intptr_t obj_id);
270 bool IsValidObjectId(intptr_t obj_id); 270 bool IsValidObjectId(intptr_t obj_id);
271 271
272 // Utility functions. 272 // Utility functions.
273 static const char* QualifiedFunctionName(const Function& func); 273 static const char* QualifiedFunctionName(const Function& func);
274 274
275 RawObject* GetInstanceField(const Class& cls, 275 RawObject* GetInstanceField(const Class& cls,
276 const String& field_name, 276 const String& field_name,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 DebuggerStackTrace* CollectStackTrace(); 310 DebuggerStackTrace* CollectStackTrace();
311 void SignalBpResolved(SourceBreakpoint *bpt); 311 void SignalBpResolved(SourceBreakpoint *bpt);
312 312
313 bool IsDebuggable(const Function& func); 313 bool IsDebuggable(const Function& func);
314 314
315 intptr_t nextId() { return next_id_++; } 315 intptr_t nextId() { return next_id_++; }
316 316
317 bool ShouldPauseOnException(DebuggerStackTrace* stack_trace, 317 bool ShouldPauseOnException(DebuggerStackTrace* stack_trace,
318 const Object& exc); 318 const Object& exc);
319 319
320 void CollectLibraryFields(const GrowableObjectArray& field_list,
321 const Library& lib,
322 const String& prefix);
323
320 Isolate* isolate_; 324 Isolate* isolate_;
321 bool initialized_; 325 bool initialized_;
322 BreakpointHandler* bp_handler_; 326 BreakpointHandler* bp_handler_;
323 EventHandler* event_handler_; 327 EventHandler* event_handler_;
324 328
325 // ID number generator. 329 // ID number generator.
326 intptr_t next_id_; 330 intptr_t next_id_;
327 331
328 // Current stack trace. Valid while executing breakpoint callback code. 332 // Current stack trace. Valid while executing breakpoint callback code.
329 DebuggerStackTrace* stack_trace_; 333 DebuggerStackTrace* stack_trace_;
(...skipping 18 matching lines...) Expand all
348 intptr_t exc_pause_info_; 352 intptr_t exc_pause_info_;
349 353
350 friend class SourceBreakpoint; 354 friend class SourceBreakpoint;
351 DISALLOW_COPY_AND_ASSIGN(Debugger); 355 DISALLOW_COPY_AND_ASSIGN(Debugger);
352 }; 356 };
353 357
354 358
355 } // namespace dart 359 } // namespace dart
356 360
357 #endif // VM_DEBUGGER_H_ 361 #endif // VM_DEBUGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698