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

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

Issue 11780005: Allow optimized code when debugger is active (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 Dart_Port isolate_id; 229 Dart_Port isolate_id;
230 }; 230 };
231 }; 231 };
232 typedef void EventHandler(DebuggerEvent *event); 232 typedef void EventHandler(DebuggerEvent *event);
233 233
234 Debugger(); 234 Debugger();
235 ~Debugger(); 235 ~Debugger();
236 236
237 void Initialize(Isolate* isolate); 237 void Initialize(Isolate* isolate);
238 void Shutdown(); 238 void Shutdown();
239 bool IsActive();
240 239
241 void NotifyCompilation(const Function& func); 240 void NotifyCompilation(const Function& func);
242 241
243 RawFunction* ResolveFunction(const Library& library, 242 RawFunction* ResolveFunction(const Library& library,
244 const String& class_name, 243 const String& class_name,
245 const String& function_name); 244 const String& function_name);
246 245
247 // Set breakpoint at closest location to function entry. 246 // Set breakpoint at closest location to function entry.
248 SourceBreakpoint* SetBreakpointAtEntry(const Function& target_function); 247 SourceBreakpoint* SetBreakpointAtEntry(const Function& target_function);
249 SourceBreakpoint* SetBreakpointAtLine(const String& script_url, 248 SourceBreakpoint* SetBreakpointAtLine(const String& script_url,
250 intptr_t line_number); 249 intptr_t line_number);
251 250
252 void RemoveBreakpoint(intptr_t bp_id); 251 void RemoveBreakpoint(intptr_t bp_id);
253 SourceBreakpoint* GetBreakpointById(intptr_t id); 252 SourceBreakpoint* GetBreakpointById(intptr_t id);
254 253
255 void SetStepOver() { resume_action_ = kStepOver; } 254 void SetStepOver() { resume_action_ = kStepOver; }
256 void SetStepInto() { resume_action_ = kStepInto; } 255 void SetStepInto() { resume_action_ = kStepInto; }
257 void SetStepOut() { resume_action_ = kStepOut; } 256 void SetStepOut() { resume_action_ = kStepOut; }
258 257
259 void SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info); 258 void SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info);
260 Dart_ExceptionPauseInfo GetExceptionPauseInfo(); 259 Dart_ExceptionPauseInfo GetExceptionPauseInfo();
261 260
262 void VisitObjectPointers(ObjectPointerVisitor* visitor); 261 void VisitObjectPointers(ObjectPointerVisitor* visitor);
263 262
264 // Called from Runtime when a breakpoint in Dart code is reached. 263 // Called from Runtime when a breakpoint in Dart code is reached.
265 void BreakpointCallback(); 264 void BreakpointCallback();
266 265
266 // Returns true if there is at least one breakpoint set in func.
267 // Checks for both user-defined and internal temporary breakpoints.
268 bool HasBreakpoint(const Function& func);
269
267 DebuggerStackTrace* StackTrace() const { return stack_trace_; } 270 DebuggerStackTrace* StackTrace() const { return stack_trace_; }
268 271
269 RawArray* GetInstanceFields(const Instance& obj); 272 RawArray* GetInstanceFields(const Instance& obj);
270 RawArray* GetStaticFields(const Class& cls); 273 RawArray* GetStaticFields(const Class& cls);
271 RawArray* GetLibraryFields(const Library& lib); 274 RawArray* GetLibraryFields(const Library& lib);
272 RawArray* GetGlobalFields(const Library& lib); 275 RawArray* GetGlobalFields(const Library& lib);
273 276
274 intptr_t CacheObject(const Object& obj); 277 intptr_t CacheObject(const Object& obj);
275 RawObject* GetCachedObject(intptr_t obj_id); 278 RawObject* GetCachedObject(intptr_t obj_id);
276 bool IsValidObjectId(intptr_t obj_id); 279 bool IsValidObjectId(intptr_t obj_id);
(...skipping 17 matching lines...) Expand all
294 static void SignalIsolateEvent(EventType type); 297 static void SignalIsolateEvent(EventType type);
295 298
296 private: 299 private:
297 enum ResumeAction { 300 enum ResumeAction {
298 kContinue, 301 kContinue,
299 kStepOver, 302 kStepOver,
300 kStepInto, 303 kStepInto,
301 kStepOut 304 kStepOut
302 }; 305 };
303 306
304 void EnsureFunctionIsDeoptimized(const Function& func); 307 void DeoptimizeWorld();
305 void InstrumentForStepping(const Function& target_function); 308 void InstrumentForStepping(const Function& target_function);
306 SourceBreakpoint* SetBreakpoint(const Function& target_function, 309 SourceBreakpoint* SetBreakpoint(const Function& target_function,
307 intptr_t first_token_pos, 310 intptr_t first_token_pos,
308 intptr_t last_token_pos); 311 intptr_t last_token_pos);
309 void RemoveInternalBreakpoints(); 312 void RemoveInternalBreakpoints();
310 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt); 313 void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt);
311 void RegisterSourceBreakpoint(SourceBreakpoint* bpt); 314 void RegisterSourceBreakpoint(SourceBreakpoint* bpt);
312 void RegisterCodeBreakpoint(CodeBreakpoint* bpt); 315 void RegisterCodeBreakpoint(CodeBreakpoint* bpt);
313 SourceBreakpoint* GetSourceBreakpoint(const Function& func, 316 SourceBreakpoint* GetSourceBreakpoint(const Function& func,
314 intptr_t token_pos); 317 intptr_t token_pos);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 static EventHandler* event_handler_; 372 static EventHandler* event_handler_;
370 373
371 friend class SourceBreakpoint; 374 friend class SourceBreakpoint;
372 DISALLOW_COPY_AND_ASSIGN(Debugger); 375 DISALLOW_COPY_AND_ASSIGN(Debugger);
373 }; 376 };
374 377
375 378
376 } // namespace dart 379 } // namespace dart
377 380
378 #endif // VM_DEBUGGER_H_ 381 #endif // VM_DEBUGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698