v8-debug.h | v8-debug.h | |||
---|---|---|---|---|
skipping to change at line 222 | skipping to change at line 222 | |||
int period = 100); | int period = 100); | |||
/** | /** | |||
* Register a callback function to be called when a debug message has bee n | * Register a callback function to be called when a debug message has bee n | |||
* received and is ready to be processed. For the debug messages to be | * received and is ready to be processed. For the debug messages to be | |||
* processed V8 needs to be entered, and in certain embedding scenarios t his | * processed V8 needs to be entered, and in certain embedding scenarios t his | |||
* callback can be used to make sure V8 is entered for the debug message to | * callback can be used to make sure V8 is entered for the debug message to | |||
* be processed. Note that debug messages will only be processed if there is | * be processed. Note that debug messages will only be processed if there is | |||
* a V8 break. This can happen automatically by using the option | * a V8 break. This can happen automatically by using the option | |||
* --debugger-auto-break. | * --debugger-auto-break. | |||
* \param provide_locker requires that V8 acquires v8::Locker for you bef | ||||
ore | ||||
* calling handler | ||||
*/ | */ | |||
static void SetDebugMessageDispatchHandler( | static void SetDebugMessageDispatchHandler( | |||
DebugMessageDispatchHandler handler); | DebugMessageDispatchHandler handler, bool provide_locker = false); | |||
/** | /** | |||
* Run a JavaScript function in the debugger. | * Run a JavaScript function in the debugger. | |||
* \param fun the function to call | * \param fun the function to call | |||
* \param data passed as second argument to the function | * \param data passed as second argument to the function | |||
* With this call the debugger is entered and the function specified is ca lled | * With this call the debugger is entered and the function specified is ca lled | |||
* with the execution state as the first argument. This makes it possible to | * with the execution state as the first argument. This makes it possible to | |||
* get access to information otherwise not available during normal JavaScr ipt | * get access to information otherwise not available during normal JavaScr ipt | |||
* execution e.g. details on stack frames. The following example show a | * execution e.g. details on stack frames. The following example show a | |||
* JavaScript function which when passed to v8::Debug::Call will return th e | * JavaScript function which when passed to v8::Debug::Call will return th e | |||
skipping to change at line 261 | skipping to change at line 263 | |||
/** | /** | |||
* Enable the V8 builtin debug agent. The debugger agent will listen on th e | * Enable the V8 builtin debug agent. The debugger agent will listen on th e | |||
* supplied TCP/IP port for remote debugger connection. | * supplied TCP/IP port for remote debugger connection. | |||
* \param name the name of the embedding application | * \param name the name of the embedding application | |||
* \param port the TCP/IP port to listen on | * \param port the TCP/IP port to listen on | |||
* \param wait_for_connection whether V8 should pause on a first statement | * \param wait_for_connection whether V8 should pause on a first statement | |||
* allowing remote debugger to connect before anything interesting happe ned | * allowing remote debugger to connect before anything interesting happe ned | |||
*/ | */ | |||
static bool EnableAgent(const char* name, int port, | static bool EnableAgent(const char* name, int port, | |||
bool wait_for_connection = false); | bool wait_for_connection = false); | |||
/** | ||||
* Makes V8 process all pending debug messages. | ||||
* | ||||
* From V8 point of view all debug messages come asynchronously (e.g. fro | ||||
m | ||||
* remote debugger) but they all must be handled synchronously: V8 cannot | ||||
* do 2 things at one time so normal script execution must be interrupted | ||||
* for a while. | ||||
* | ||||
* Generally when message arrives V8 may be in one of 3 states: | ||||
* 1. V8 is running script; V8 will automatically interrupt and process a | ||||
ll | ||||
* pending messages (however auto_break flag should be enabled); | ||||
* 2. V8 is suspended on debug breakpoint; in this state V8 is dedicated | ||||
* to reading and processing debug messages; | ||||
* 3. V8 is not running at all or has called some long-working C++ functi | ||||
on; | ||||
* by default it means that processing of all debug message will be defer | ||||
red | ||||
* until V8 gets control again; however, embedding application may improv | ||||
e | ||||
* this by manually calling this method. | ||||
* | ||||
* It makes sense to call this method whenever a new debug message arrive | ||||
d and | ||||
* V8 is not already running. Method v8::Debug::SetDebugMessageDispatchHa | ||||
ndler | ||||
* should help with the former condition. | ||||
* | ||||
* Technically this method in many senses is equivalent to executing empt | ||||
y | ||||
* script: | ||||
* 1. It does nothing except for processing all pending debug messages. | ||||
* 2. It should be invoked with the same precautions and from the same co | ||||
ntext | ||||
* as V8 script would be invoked from, because: | ||||
* a. with "evaluate" command it can do whatever normal script can do, | ||||
* including all native calls; | ||||
* b. no other thread should call V8 while this method is running | ||||
* (v8::Locker may be used here). | ||||
* | ||||
* "Evaluate" debug command behavior currently is not specified in scope | ||||
* of this method. | ||||
*/ | ||||
static void ProcessDebugMessages(); | ||||
}; | }; | |||
} // namespace v8 | } // namespace v8 | |||
#undef EXPORT | #undef EXPORT | |||
#endif // V8_V8_DEBUG_H_ | #endif // V8_V8_DEBUG_H_ | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 50 lines changed or added | |||