| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_V8_DEBUG_H_ | 5 #ifndef V8_V8_DEBUG_H_ |
| 6 #define V8_V8_DEBUG_H_ | 6 #define V8_V8_DEBUG_H_ |
| 7 | 7 |
| 8 #include "v8.h" // NOLINT(build/include) | 8 #include "v8.h" // NOLINT(build/include) |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Debugger support for the V8 JavaScript engine. | 11 * Debugger support for the V8 JavaScript engine. |
| 12 */ | 12 */ |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 | 14 |
| 15 // Debug events which can occur in the V8 JavaScript engine. | 15 // Debug events which can occur in the V8 JavaScript engine. |
| 16 enum DebugEvent { | 16 enum DebugEvent { |
| 17 Break = 1, | 17 Break = 1, |
| 18 Exception = 2, | 18 Exception = 2, |
| 19 NewFunction = 3, | 19 BeforeCompile = 3, |
| 20 BeforeCompile = 4, | 20 AfterCompile = 4, |
| 21 AfterCompile = 5, | 21 CompileError = 5, |
| 22 CompileError = 6, | 22 AsyncTaskEvent = 6, |
| 23 AsyncTaskEvent = 7, | |
| 24 }; | 23 }; |
| 25 | 24 |
| 26 class V8_EXPORT Debug { | 25 class V8_EXPORT Debug { |
| 27 public: | 26 public: |
| 28 /** | 27 /** |
| 29 * A client object passed to the v8 debugger whose ownership will be taken by | 28 * A client object passed to the v8 debugger whose ownership will be taken by |
| 30 * it. v8 is always responsible for deleting the object. | 29 * it. v8 is always responsible for deleting the object. |
| 31 */ | 30 */ |
| 32 class ClientData { | 31 class ClientData { |
| 33 public: | 32 public: |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 158 |
| 160 // Schedule a debugger break to happen when JavaScript code is run | 159 // Schedule a debugger break to happen when JavaScript code is run |
| 161 // in the given isolate. | 160 // in the given isolate. |
| 162 static void DebugBreak(Isolate* isolate); | 161 static void DebugBreak(Isolate* isolate); |
| 163 | 162 |
| 164 // Remove scheduled debugger break in given isolate if it has not | 163 // Remove scheduled debugger break in given isolate if it has not |
| 165 // happened yet. | 164 // happened yet. |
| 166 static void CancelDebugBreak(Isolate* isolate); | 165 static void CancelDebugBreak(Isolate* isolate); |
| 167 | 166 |
| 168 // Check if a debugger break is scheduled in the given isolate. | 167 // Check if a debugger break is scheduled in the given isolate. |
| 169 static bool CheckDebugBreak(Isolate* isolate); | 168 V8_DEPRECATED("No longer supported", |
| 169 static bool CheckDebugBreak(Isolate* isolate)); |
| 170 | 170 |
| 171 // Message based interface. The message protocol is JSON. | 171 // Message based interface. The message protocol is JSON. |
| 172 V8_DEPRECATED("No longer supported", | 172 V8_DEPRECATED("No longer supported", |
| 173 static void SetMessageHandler(Isolate* isolate, | 173 static void SetMessageHandler(Isolate* isolate, |
| 174 MessageHandler handler)); | 174 MessageHandler handler)); |
| 175 | 175 |
| 176 V8_DEPRECATED("No longer supported", | 176 V8_DEPRECATED("No longer supported", |
| 177 static void SendCommand(Isolate* isolate, | 177 static void SendCommand(Isolate* isolate, |
| 178 const uint16_t* command, int length, | 178 const uint16_t* command, int length, |
| 179 ClientData* client_data = NULL)); | 179 ClientData* client_data = NULL)); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 197 * \endcode | 197 * \endcode |
| 198 */ | 198 */ |
| 199 // TODO(dcarney): data arg should be a MaybeLocal | 199 // TODO(dcarney): data arg should be a MaybeLocal |
| 200 static MaybeLocal<Value> Call(Local<Context> context, | 200 static MaybeLocal<Value> Call(Local<Context> context, |
| 201 v8::Local<v8::Function> fun, | 201 v8::Local<v8::Function> fun, |
| 202 Local<Value> data = Local<Value>()); | 202 Local<Value> data = Local<Value>()); |
| 203 | 203 |
| 204 /** | 204 /** |
| 205 * Returns a mirror object for the given object. | 205 * Returns a mirror object for the given object. |
| 206 */ | 206 */ |
| 207 static MaybeLocal<Value> GetMirror(Local<Context> context, | 207 V8_DEPRECATED("No longer supported", |
| 208 v8::Local<v8::Value> obj); | 208 static MaybeLocal<Value> GetMirror(Local<Context> context, |
| 209 v8::Local<v8::Value> obj)); |
| 209 | 210 |
| 210 /** | 211 /** |
| 211 * Makes V8 process all pending debug messages. | 212 * Makes V8 process all pending debug messages. |
| 212 * | 213 * |
| 213 * From V8 point of view all debug messages come asynchronously (e.g. from | 214 * From V8 point of view all debug messages come asynchronously (e.g. from |
| 214 * remote debugger) but they all must be handled synchronously: V8 cannot | 215 * remote debugger) but they all must be handled synchronously: V8 cannot |
| 215 * do 2 things at one time so normal script execution must be interrupted | 216 * do 2 things at one time so normal script execution must be interrupted |
| 216 * for a while. | 217 * for a while. |
| 217 * | 218 * |
| 218 * Generally when message arrives V8 may be in one of 3 states: | 219 * Generally when message arrives V8 may be in one of 3 states: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 247 * debugger context. Note that the content of the debugger context is subject | 248 * debugger context. Note that the content of the debugger context is subject |
| 248 * to change. The Context exists only when the debugger is active, i.e. at | 249 * to change. The Context exists only when the debugger is active, i.e. at |
| 249 * least one DebugEventListener or MessageHandler is set. | 250 * least one DebugEventListener or MessageHandler is set. |
| 250 */ | 251 */ |
| 251 static Local<Context> GetDebugContext(Isolate* isolate); | 252 static Local<Context> GetDebugContext(Isolate* isolate); |
| 252 | 253 |
| 253 /** | 254 /** |
| 254 * While in the debug context, this method returns the top-most non-debug | 255 * While in the debug context, this method returns the top-most non-debug |
| 255 * context, if it exists. | 256 * context, if it exists. |
| 256 */ | 257 */ |
| 257 static MaybeLocal<Context> GetDebuggedContext(Isolate* isolate); | 258 V8_DEPRECATED( |
| 259 "No longer supported", |
| 260 static MaybeLocal<Context> GetDebuggedContext(Isolate* isolate)); |
| 258 | 261 |
| 259 /** | 262 /** |
| 260 * Enable/disable LiveEdit functionality for the given Isolate | 263 * Enable/disable LiveEdit functionality for the given Isolate |
| 261 * (default Isolate if not provided). V8 will abort if LiveEdit is | 264 * (default Isolate if not provided). V8 will abort if LiveEdit is |
| 262 * unexpectedly used. LiveEdit is enabled by default. | 265 * unexpectedly used. LiveEdit is enabled by default. |
| 263 */ | 266 */ |
| 264 static void SetLiveEditEnabled(Isolate* isolate, bool enable); | 267 static void SetLiveEditEnabled(Isolate* isolate, bool enable); |
| 265 | 268 |
| 266 /** | 269 /** |
| 267 * Returns array of internal properties specific to the value type. Result has | 270 * Returns array of internal properties specific to the value type. Result has |
| (...skipping 13 matching lines...) Expand all Loading... |
| 281 }; | 284 }; |
| 282 | 285 |
| 283 | 286 |
| 284 } // namespace v8 | 287 } // namespace v8 |
| 285 | 288 |
| 286 | 289 |
| 287 #undef EXPORT | 290 #undef EXPORT |
| 288 | 291 |
| 289 | 292 |
| 290 #endif // V8_V8_DEBUG_H_ | 293 #endif // V8_V8_DEBUG_H_ |
| OLD | NEW |