'out': 'o',
'backtrace': 'bt',
'setBreakpoint': 'sb',
- 'clearBreakpoint': 'cb'
+ 'clearBreakpoint': 'cb',
+ 'pause_': 'pause'
};
function defineProperty(key, protoKey) {
};
+// Pause child process
+Interface.prototype.pause_ = function() {
+ if (!this.requireConnection()) return;
+
+ var self = this,
+ cmd = 'process._debugPause();';
+
+ this.pause();
+ this.client.reqFrameEval(cmd, NO_FRAME, function(err, res) {
+ if (err) {
+ self.error(err);
+ } else {
+ self.resume();
+ }
+ });
+};
+
+
// Kill child process
Interface.prototype.kill = function() {
if (!this.child) return;
static void DebugMessageCallback(uv_async_t* watcher, int status) {
HandleScope scope;
assert(watcher == &debug_watcher);
- Debug::ProcessDebugMessages();
+ v8::Debug::ProcessDebugMessages();
}
static void DebugMessageDispatch(void) {
uv_async_send(&debug_watcher);
}
-static void DebugBreakMessageHandler(const Debug::Message& message) {
+static void DebugBreakMessageHandler(const v8::Debug::Message& message) {
// do nothing with debug messages.
// The message handler will get changed by DebuggerAgent::CreateSession in
// debug-agent.cc of v8/src when a new session is created
static Handle<Value> DebugProcess(const Arguments& args);
+static Handle<Value> DebugPause(const Arguments& args);
Handle<Object> SetupProcessObject(int argc, char *argv[]) {
HandleScope scope;
NODE_SET_METHOD(process, "_kill", Kill);
NODE_SET_METHOD(process, "_debugProcess", DebugProcess);
+ NODE_SET_METHOD(process, "_debugPause", DebugPause);
NODE_SET_METHOD(process, "dlopen", DLOpen);
node_isolate->Enter();
// Start the debug thread and it's associated TCP server on port 5858.
- bool r = Debug::EnableAgent("node " NODE_VERSION, debug_port);
+ bool r = v8::Debug::EnableAgent("node " NODE_VERSION, debug_port);
if (wait_connect) {
// Set up an empty handler so v8 will not continue until a debugger
// attaches. This is the same behavior as Debug::EnableAgent(_,_,true)
// except we don't break at the beginning of the script.
// see Debugger::StartAgent in debug.cc of v8/src
- Debug::SetMessageHandler2(node::DebugBreakMessageHandler);
+ v8::Debug::SetMessageHandler2(node::DebugBreakMessageHandler);
}
// Crappy check that everything went well. FIXME
#endif // _WIN32
+static Handle<Value> DebugPause(const Arguments& args) {
+ v8::Debug::DebugBreak(node_isolate);
+}
+
+
char** Init(int argc, char *argv[]) {
// Initialize prog_start_time to get relative uptime.
uv_uptime(&prog_start_time);
// Set the callback DebugMessageDispatch which is called from the debug
// thread.
- Debug::SetDebugMessageDispatchHandler(node::DebugMessageDispatch);
+ v8::Debug::SetDebugMessageDispatchHandler(node::DebugMessageDispatch);
// Initialize the async watcher. DebugMessageCallback() is called from the
// main thread to execute a random bit of javascript - which will give V8