Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-12-22 06:14:29 +0300
committerRyan Dahl <ry@tinyclouds.org>2010-12-30 12:35:11 +0300
commit8d82ec21308812132a71afe45c5bc517b4a43354 (patch)
treecd5138d97432387f51332bee46b034ada1cabda8 /src
parent0df804b9e7b509797e652a0e8657989023a01911 (diff)
Add beginning of build-in debugger
+ test-debugger-client (which is currently broken)
Diffstat (limited to 'src')
-rw-r--r--src/node.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/node.js b/src/node.js
index 43ccdb03258..4717e65d471 100644
--- a/src/node.js
+++ b/src/node.js
@@ -535,14 +535,23 @@
}
if (process.argv[1]) {
- // Load module
- if (process.argv[1].charAt(0) != '/' &&
- !(/^http:\/\//).exec(process.argv[1])) {
- process.argv[1] = path.join(cwd, process.argv[1]);
+
+ if (process.argv[1] == 'debug') {
+ // Start the debugger agent
+ var d = requireNative('_debugger');
+ var pid = process.argv[2];
+ d.start(pid);
+
+ } else {
+ // Load module
+ if (process.argv[1].charAt(0) != '/' &&
+ !(/^http:\/\//).exec(process.argv[1])) {
+ process.argv[1] = path.join(cwd, process.argv[1]);
+ }
+ // REMOVEME: nextTick should not be necessary. This hack to get
+ // test/simple/test-exception-handler2.js working.
+ process.nextTick(module.runMain);
}
- // REMOVEME: nextTick should not be necessary. This hack to get
- // test/simple/test-exception-handler2.js working.
- process.nextTick(module.runMain);
} else if (process._eval) {
// -e, --eval