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

Side by Side Diff: src/debug.h

Issue 18326007: Revert "Debug: support breakpoints set in the middle of statement" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
90 // Class for iterating through the break points in a function and changing 82 // Class for iterating through the break points in a function and changing
91 // them. 83 // them.
92 class BreakLocationIterator { 84 class BreakLocationIterator {
93 public: 85 public:
94 explicit BreakLocationIterator(Handle<DebugInfo> debug_info, 86 explicit BreakLocationIterator(Handle<DebugInfo> debug_info,
95 BreakLocatorType type); 87 BreakLocatorType type);
96 virtual ~BreakLocationIterator(); 88 virtual ~BreakLocationIterator();
97 89
98 void Next(); 90 void Next();
99 void Next(int count); 91 void Next(int count);
100 void FindBreakLocationFromAddress(Address pc); 92 void FindBreakLocationFromAddress(Address pc);
101 void FindBreakLocationFromPosition(int position, 93 void FindBreakLocationFromPosition(int position);
102 BreakPositionAlignment alignment);
103 void Reset(); 94 void Reset();
104 bool Done() const; 95 bool Done() const;
105 void SetBreakPoint(Handle<Object> break_point_object); 96 void SetBreakPoint(Handle<Object> break_point_object);
106 void ClearBreakPoint(Handle<Object> break_point_object); 97 void ClearBreakPoint(Handle<Object> break_point_object);
107 void SetOneShot(); 98 void SetOneShot();
108 void ClearOneShot(); 99 void ClearOneShot();
109 bool IsStepInLocation(Isolate* isolate); 100 bool IsStepInLocation(Isolate* isolate);
110 void PrepareStepIn(Isolate* isolate); 101 void PrepareStepIn(Isolate* isolate);
111 bool IsExit() const; 102 bool IsExit() const;
112 bool HasBreakPoint(); 103 bool HasBreakPoint();
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } 234 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; }
244 void PreemptionWhileInDebugger(); 235 void PreemptionWhileInDebugger();
245 void Iterate(ObjectVisitor* v); 236 void Iterate(ObjectVisitor* v);
246 237
247 Object* Break(Arguments args); 238 Object* Break(Arguments args);
248 void SetBreakPoint(Handle<JSFunction> function, 239 void SetBreakPoint(Handle<JSFunction> function,
249 Handle<Object> break_point_object, 240 Handle<Object> break_point_object,
250 int* source_position); 241 int* source_position);
251 bool SetBreakPointForScript(Handle<Script> script, 242 bool SetBreakPointForScript(Handle<Script> script,
252 Handle<Object> break_point_object, 243 Handle<Object> break_point_object,
253 int* source_position, 244 int* source_position);
254 BreakPositionAlignment alignment);
255 void ClearBreakPoint(Handle<Object> break_point_object); 245 void ClearBreakPoint(Handle<Object> break_point_object);
256 void ClearAllBreakPoints(); 246 void ClearAllBreakPoints();
257 void FloodWithOneShot(Handle<JSFunction> function); 247 void FloodWithOneShot(Handle<JSFunction> function);
258 void FloodBoundFunctionWithOneShot(Handle<JSFunction> function); 248 void FloodBoundFunctionWithOneShot(Handle<JSFunction> function);
259 void FloodHandlerWithOneShot(); 249 void FloodHandlerWithOneShot();
260 void ChangeBreakOnException(ExceptionBreakType type, bool enable); 250 void ChangeBreakOnException(ExceptionBreakType type, bool enable);
261 bool IsBreakOnException(ExceptionBreakType type); 251 bool IsBreakOnException(ExceptionBreakType type);
262 void PrepareStep(StepAction step_action, int step_count); 252 void PrepareStep(StepAction step_action, int step_count);
263 void ClearStepping(); 253 void ClearStepping();
264 void ClearStepOut(); 254 void ClearStepOut();
(...skipping 22 matching lines...) Expand all
287 277
288 // Check whether a code stub with the specified major key is a possible break 278 // Check whether a code stub with the specified major key is a possible break
289 // point location. 279 // point location.
290 static bool IsSourceBreakStub(Code* code); 280 static bool IsSourceBreakStub(Code* code);
291 static bool IsBreakStub(Code* code); 281 static bool IsBreakStub(Code* code);
292 282
293 // Find the builtin to use for invoking the debug break 283 // Find the builtin to use for invoking the debug break
294 static Handle<Code> FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode); 284 static Handle<Code> FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode);
295 285
296 static Handle<Object> GetSourceBreakLocations( 286 static Handle<Object> GetSourceBreakLocations(
297 Handle<SharedFunctionInfo> shared, 287 Handle<SharedFunctionInfo> shared);
298 BreakPositionAlignment position_aligment);
299 288
300 // Getter for the debug_context. 289 // Getter for the debug_context.
301 inline Handle<Context> debug_context() { return debug_context_; } 290 inline Handle<Context> debug_context() { return debug_context_; }
302 291
303 // Check whether a global object is the debug global object. 292 // Check whether a global object is the debug global object.
304 bool IsDebugGlobal(GlobalObject* global); 293 bool IsDebugGlobal(GlobalObject* global);
305 294
306 // Check whether this frame is just about to return. 295 // Check whether this frame is just about to return.
307 bool IsBreakAtReturn(JavaScriptFrame* frame); 296 bool IsBreakAtReturn(JavaScriptFrame* frame);
308 297
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 1050
1062 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); 1051 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread);
1063 }; 1052 };
1064 1053
1065 1054
1066 } } // namespace v8::internal 1055 } } // namespace v8::internal
1067 1056
1068 #endif // ENABLE_DEBUGGER_SUPPORT 1057 #endif // ENABLE_DEBUGGER_SUPPORT
1069 1058
1070 #endif // V8_DEBUG_H_ 1059 #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