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

Side by Side Diff: src/debug.h

Issue 16093040: Debug: support breakpoints set in the middle of statement (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: follow code review Created 7 years, 5 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
« no previous file with comments | « no previous file | src/debug.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 }; 72 };
73 73
74 74
75 // Type of exception break. NOTE: These values are in macros.py as well. 75 // Type of exception break. NOTE: These values are in macros.py as well.
76 enum BreakLocatorType { 76 enum BreakLocatorType {
77 ALL_BREAK_LOCATIONS = 0, 77 ALL_BREAK_LOCATIONS = 0,
78 SOURCE_BREAK_LOCATIONS = 1 78 SOURCE_BREAK_LOCATIONS = 1
79 }; 79 };
80 80
81 81
82 // The different types of breakpoint position alignments.
83 // Must match Debug.BreakPositionAlignment in debug-debugger.js
84 enum BreakPositionAlignment {
85 STATEMENT_ALIGNED = 0,
86 BREAK_POSITION_ALIGNED = 1
87 };
88
89
82 // Class for iterating through the break points in a function and changing 90 // Class for iterating through the break points in a function and changing
83 // them. 91 // them.
84 class BreakLocationIterator { 92 class BreakLocationIterator {
85 public: 93 public:
86 explicit BreakLocationIterator(Handle<DebugInfo> debug_info, 94 explicit BreakLocationIterator(Handle<DebugInfo> debug_info,
87 BreakLocatorType type); 95 BreakLocatorType type);
88 virtual ~BreakLocationIterator(); 96 virtual ~BreakLocationIterator();
89 97
90 void Next(); 98 void Next();
91 void Next(int count); 99 void Next(int count);
92 void FindBreakLocationFromAddress(Address pc); 100 void FindBreakLocationFromAddress(Address pc);
93 void FindBreakLocationFromPosition(int position); 101 void FindBreakLocationFromPosition(int position,
102 BreakPositionAlignment alignment);
94 void Reset(); 103 void Reset();
95 bool Done() const; 104 bool Done() const;
96 void SetBreakPoint(Handle<Object> break_point_object); 105 void SetBreakPoint(Handle<Object> break_point_object);
97 void ClearBreakPoint(Handle<Object> break_point_object); 106 void ClearBreakPoint(Handle<Object> break_point_object);
98 void SetOneShot(); 107 void SetOneShot();
99 void ClearOneShot(); 108 void ClearOneShot();
100 bool IsStepInLocation(Isolate* isolate); 109 bool IsStepInLocation(Isolate* isolate);
101 void PrepareStepIn(Isolate* isolate); 110 void PrepareStepIn(Isolate* isolate);
102 bool IsExit() const; 111 bool IsExit() const;
103 bool HasBreakPoint(); 112 bool HasBreakPoint();
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } 243 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; }
235 void PreemptionWhileInDebugger(); 244 void PreemptionWhileInDebugger();
236 void Iterate(ObjectVisitor* v); 245 void Iterate(ObjectVisitor* v);
237 246
238 Object* Break(Arguments args); 247 Object* Break(Arguments args);
239 void SetBreakPoint(Handle<JSFunction> function, 248 void SetBreakPoint(Handle<JSFunction> function,
240 Handle<Object> break_point_object, 249 Handle<Object> break_point_object,
241 int* source_position); 250 int* source_position);
242 bool SetBreakPointForScript(Handle<Script> script, 251 bool SetBreakPointForScript(Handle<Script> script,
243 Handle<Object> break_point_object, 252 Handle<Object> break_point_object,
244 int* source_position); 253 int* source_position,
254 BreakPositionAlignment alignment);
245 void ClearBreakPoint(Handle<Object> break_point_object); 255 void ClearBreakPoint(Handle<Object> break_point_object);
246 void ClearAllBreakPoints(); 256 void ClearAllBreakPoints();
247 void FloodWithOneShot(Handle<JSFunction> function); 257 void FloodWithOneShot(Handle<JSFunction> function);
248 void FloodBoundFunctionWithOneShot(Handle<JSFunction> function); 258 void FloodBoundFunctionWithOneShot(Handle<JSFunction> function);
249 void FloodHandlerWithOneShot(); 259 void FloodHandlerWithOneShot();
250 void ChangeBreakOnException(ExceptionBreakType type, bool enable); 260 void ChangeBreakOnException(ExceptionBreakType type, bool enable);
251 bool IsBreakOnException(ExceptionBreakType type); 261 bool IsBreakOnException(ExceptionBreakType type);
252 void PrepareStep(StepAction step_action, int step_count); 262 void PrepareStep(StepAction step_action, int step_count);
253 void ClearStepping(); 263 void ClearStepping();
254 void ClearStepOut(); 264 void ClearStepOut();
(...skipping 22 matching lines...) Expand all
277 287
278 // Check whether a code stub with the specified major key is a possible break 288 // Check whether a code stub with the specified major key is a possible break
279 // point location. 289 // point location.
280 static bool IsSourceBreakStub(Code* code); 290 static bool IsSourceBreakStub(Code* code);
281 static bool IsBreakStub(Code* code); 291 static bool IsBreakStub(Code* code);
282 292
283 // Find the builtin to use for invoking the debug break 293 // Find the builtin to use for invoking the debug break
284 static Handle<Code> FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode); 294 static Handle<Code> FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode);
285 295
286 static Handle<Object> GetSourceBreakLocations( 296 static Handle<Object> GetSourceBreakLocations(
287 Handle<SharedFunctionInfo> shared); 297 Handle<SharedFunctionInfo> shared,
298 BreakPositionAlignment position_aligment);
288 299
289 // Getter for the debug_context. 300 // Getter for the debug_context.
290 inline Handle<Context> debug_context() { return debug_context_; } 301 inline Handle<Context> debug_context() { return debug_context_; }
291 302
292 // Check whether a global object is the debug global object. 303 // Check whether a global object is the debug global object.
293 bool IsDebugGlobal(GlobalObject* global); 304 bool IsDebugGlobal(GlobalObject* global);
294 305
295 // Check whether this frame is just about to return. 306 // Check whether this frame is just about to return.
296 bool IsBreakAtReturn(JavaScriptFrame* frame); 307 bool IsBreakAtReturn(JavaScriptFrame* frame);
297 308
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 1061
1051 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); 1062 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread);
1052 }; 1063 };
1053 1064
1054 1065
1055 } } // namespace v8::internal 1066 } } // namespace v8::internal
1056 1067
1057 #endif // ENABLE_DEBUGGER_SUPPORT 1068 #endif // ENABLE_DEBUGGER_SUPPORT
1058 1069
1059 #endif // V8_DEBUG_H_ 1070 #endif // V8_DEBUG_H_
OLDNEW
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698