| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 enum DebugEvent { | 73 enum DebugEvent { |
| 74 Break = 1, | 74 Break = 1, |
| 75 Exception = 2, | 75 Exception = 2, |
| 76 NewFunction = 3, | 76 NewFunction = 3, |
| 77 BeforeCompile = 4, | 77 BeforeCompile = 4, |
| 78 AfterCompile = 5, | 78 AfterCompile = 5, |
| 79 ScriptCollected = 6 | 79 ScriptCollected = 6 |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 | 82 |
| 83 /** |
| 84 * Function helps debug agent to start V8 whenever there are debug requests |
| 85 * pending. This makes V8 responsive to remote debugger even when no script |
| 86 * is being running. |
| 87 * Should cause an empty cycle to be run in V8 (e.g. evaluate "void(0)") |
| 88 * either synchronously or asynchronously. |
| 89 * Should return false if embedder for some reason is not going to start V8 |
| 90 * in any reasonable future. |
| 91 */ |
| 92 typedef bool (*AsyncDebugRunner)(); |
| 93 |
| 94 |
| 83 class EXPORT Debug { | 95 class EXPORT Debug { |
| 84 public: | 96 public: |
| 85 /** | 97 /** |
| 86 * A client object passed to the v8 debugger whose ownership will be taken by | 98 * A client object passed to the v8 debugger whose ownership will be taken by |
| 87 * it. v8 is always responsible for deleting the object. | 99 * it. v8 is always responsible for deleting the object. |
| 88 */ | 100 */ |
| 89 class ClientData { | 101 class ClientData { |
| 90 public: | 102 public: |
| 91 virtual ~ClientData() {} | 103 virtual ~ClientData() {} |
| 92 }; | 104 }; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 /** | 263 /** |
| 252 * Returns a mirror object for the given object. | 264 * Returns a mirror object for the given object. |
| 253 */ | 265 */ |
| 254 static Local<Value> GetMirror(v8::Handle<v8::Value> obj); | 266 static Local<Value> GetMirror(v8::Handle<v8::Value> obj); |
| 255 | 267 |
| 256 /** | 268 /** |
| 257 * Enable the V8 builtin debug agent. The debugger agent will listen on the | 269 * Enable the V8 builtin debug agent. The debugger agent will listen on the |
| 258 * supplied TCP/IP port for remote debugger connection. | 270 * supplied TCP/IP port for remote debugger connection. |
| 259 * \param name the name of the embedding application | 271 * \param name the name of the embedding application |
| 260 * \param port the TCP/IP port to listen on | 272 * \param port the TCP/IP port to listen on |
| 273 * \param debug_runner helps V8 respond when idle; may be NULL |
| 261 */ | 274 */ |
| 262 static bool EnableAgent(const char* name, int port); | 275 static bool EnableAgent(const char* name, int port, |
| 276 AsyncDebugRunner async_debug_runner = NULL); |
| 263 }; | 277 }; |
| 264 | 278 |
| 265 | 279 |
| 266 } // namespace v8 | 280 } // namespace v8 |
| 267 | 281 |
| 268 | 282 |
| 269 #undef EXPORT | 283 #undef EXPORT |
| 270 | 284 |
| 271 | 285 |
| 272 #endif // V8_V8_DEBUG_H_ | 286 #endif // V8_V8_DEBUG_H_ |
| OLD | NEW |