OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 bool Done() const; | 82 bool Done() const; |
83 void SetBreakPoint(Handle<Object> break_point_object); | 83 void SetBreakPoint(Handle<Object> break_point_object); |
84 void ClearBreakPoint(Handle<Object> break_point_object); | 84 void ClearBreakPoint(Handle<Object> break_point_object); |
85 void SetOneShot(); | 85 void SetOneShot(); |
86 void ClearOneShot(); | 86 void ClearOneShot(); |
87 void PrepareStepIn(); | 87 void PrepareStepIn(); |
88 bool IsExit() const; | 88 bool IsExit() const; |
89 bool HasBreakPoint(); | 89 bool HasBreakPoint(); |
90 bool IsDebugBreak(); | 90 bool IsDebugBreak(); |
91 Object* BreakPointObjects(); | 91 Object* BreakPointObjects(); |
| 92 void ClearAllDebugBreak(); |
92 | 93 |
93 | 94 |
94 inline int code_position() { return pc() - debug_info_->code()->entry(); } | 95 inline int code_position() { return pc() - debug_info_->code()->entry(); } |
95 inline int break_point() { return break_point_; } | 96 inline int break_point() { return break_point_; } |
96 inline int position() { return position_; } | 97 inline int position() { return position_; } |
97 inline int statement_position() { return statement_position_; } | 98 inline int statement_position() { return statement_position_; } |
98 inline Address pc() { return reloc_iterator_->rinfo()->pc(); } | 99 inline Address pc() { return reloc_iterator_->rinfo()->pc(); } |
99 inline Code* code() { return debug_info_->code(); } | 100 inline Code* code() { return debug_info_->code(); } |
100 inline RelocInfo* rinfo() { return reloc_iterator_->rinfo(); } | 101 inline RelocInfo* rinfo() { return reloc_iterator_->rinfo(); } |
101 inline RelocInfo::Mode rmode() const { | 102 inline RelocInfo::Mode rmode() const { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 static void Unload(); | 166 static void Unload(); |
166 static bool IsLoaded() { return !debug_context_.is_null(); } | 167 static bool IsLoaded() { return !debug_context_.is_null(); } |
167 static bool InDebugger() { return Top::is_break(); } | 168 static bool InDebugger() { return Top::is_break(); } |
168 static void Iterate(ObjectVisitor* v); | 169 static void Iterate(ObjectVisitor* v); |
169 | 170 |
170 static Object* Break(Arguments args); | 171 static Object* Break(Arguments args); |
171 static void SetBreakPoint(Handle<SharedFunctionInfo> shared, | 172 static void SetBreakPoint(Handle<SharedFunctionInfo> shared, |
172 int source_position, | 173 int source_position, |
173 Handle<Object> break_point_object); | 174 Handle<Object> break_point_object); |
174 static void ClearBreakPoint(Handle<Object> break_point_object); | 175 static void ClearBreakPoint(Handle<Object> break_point_object); |
| 176 static void ClearAllBreakPoints(); |
175 static void FloodWithOneShot(Handle<SharedFunctionInfo> shared); | 177 static void FloodWithOneShot(Handle<SharedFunctionInfo> shared); |
176 static void FloodHandlerWithOneShot(); | 178 static void FloodHandlerWithOneShot(); |
177 static void ChangeBreakOnException(ExceptionBreakType type, bool enable); | 179 static void ChangeBreakOnException(ExceptionBreakType type, bool enable); |
178 static void PrepareStep(StepAction step_action, int step_count); | 180 static void PrepareStep(StepAction step_action, int step_count); |
179 static void ClearStepping(); | 181 static void ClearStepping(); |
180 static bool StepNextContinue(BreakLocationIterator* break_location_iterator, | 182 static bool StepNextContinue(BreakLocationIterator* break_location_iterator, |
181 JavaScriptFrame* frame); | 183 JavaScriptFrame* frame); |
182 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); | 184 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); |
183 static bool HasDebugInfo(Handle<SharedFunctionInfo> shared); | 185 static bool HasDebugInfo(Handle<SharedFunctionInfo> shared); |
184 | 186 |
185 // Returns whether the operation succeeded. | 187 // Returns whether the operation succeeded. |
186 static bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared); | 188 static bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared); |
187 | 189 |
188 static bool IsDebugBreak(Address addr); | 190 static bool IsDebugBreak(Address addr); |
| 191 static bool IsDebugBreakAtReturn(RelocInfo* rinfo); |
189 | 192 |
190 // Check whether a code stub with the specified major key is a possible break | 193 // Check whether a code stub with the specified major key is a possible break |
191 // point location. | 194 // point location. |
192 static bool IsSourceBreakStub(Code* code); | 195 static bool IsSourceBreakStub(Code* code); |
193 static bool IsBreakStub(Code* code); | 196 static bool IsBreakStub(Code* code); |
194 | 197 |
195 // Find the builtin to use for invoking the debug break | 198 // Find the builtin to use for invoking the debug break |
196 static Handle<Code> FindDebugBreak(RelocInfo* rinfo); | 199 static Handle<Code> FindDebugBreak(RelocInfo* rinfo); |
197 | 200 |
198 static Handle<Object> GetSourceBreakLocations( | 201 static Handle<Object> GetSourceBreakLocations( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 return &debug_break_return_; | 253 return &debug_break_return_; |
251 } | 254 } |
252 | 255 |
253 static const int kEstimatedNofDebugInfoEntries = 16; | 256 static const int kEstimatedNofDebugInfoEntries = 16; |
254 static const int kEstimatedNofBreakPointsInFunction = 16; | 257 static const int kEstimatedNofBreakPointsInFunction = 16; |
255 | 258 |
256 static void HandleWeakDebugInfo(v8::Persistent<v8::Value> obj, void* data); | 259 static void HandleWeakDebugInfo(v8::Persistent<v8::Value> obj, void* data); |
257 | 260 |
258 friend class Debugger; | 261 friend class Debugger; |
259 friend Handle<FixedArray> GetDebuggedFunctions(); // Found in test-debug.cc | 262 friend Handle<FixedArray> GetDebuggedFunctions(); // Found in test-debug.cc |
| 263 friend void CheckDebuggerUnloaded(bool); // Found in test-debug.cc |
260 | 264 |
261 // Threading support. | 265 // Threading support. |
262 static char* ArchiveDebug(char* to); | 266 static char* ArchiveDebug(char* to); |
263 static char* RestoreDebug(char* from); | 267 static char* RestoreDebug(char* from); |
264 static int ArchiveSpacePerThread(); | 268 static int ArchiveSpacePerThread(); |
265 | 269 |
266 // Mirror cache handling. | 270 // Mirror cache handling. |
267 static void ClearMirrorCache(); | 271 static void ClearMirrorCache(); |
268 | 272 |
269 // Code generation assumptions. | 273 // Code generation assumptions. |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 } | 604 } |
601 private: | 605 private: |
602 Debug::AddressId id_; | 606 Debug::AddressId id_; |
603 int reg_; | 607 int reg_; |
604 }; | 608 }; |
605 | 609 |
606 | 610 |
607 } } // namespace v8::internal | 611 } } // namespace v8::internal |
608 | 612 |
609 #endif // V8_V8_DEBUG_H_ | 613 #endif // V8_V8_DEBUG_H_ |
OLD | NEW |