mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
In debugger, the usage of `repl` very ugly. I'd like there is a `p`
like gdb. So the `exec` is coming.
Usage:
```
$ ./iojs debug ~/git/node_research/server.js
< Debugger listening on port 5858
connecting to 127.0.0.1:5858 ... ok
break in /Users/jacksontian/git/node_research/server.js:1
> 1 var http = require('http');
2
3 http.createServer(function (req, res) {
debug> exec process.title
/Users/jacksontian/git/io.js/out/Release/iojs
debug>
```
And the `repl`:
```
debug> repl
Press Ctrl + C to leave debug repl
> process.title
'/Users/jacksontian/git/io.js/out/Release/iojs'
debug>
(^C again to quit)
```
The enter and leave debug repl is superfluous.
R-URL: https://github.com/nodejs/node/pull/1491
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
78 lines
1.2 KiB
JavaScript
78 lines
1.2 KiB
JavaScript
'use strict';
|
|
require('../common');
|
|
var repl = require('./helper-debugger-repl.js');
|
|
|
|
repl.startDebugger('breakpoints.js');
|
|
|
|
var addTest = repl.addTest;
|
|
|
|
// Next
|
|
addTest('n', [
|
|
/break in .*:11/,
|
|
/9/, /10/, /11/, /12/, /13/
|
|
]);
|
|
|
|
// Watch
|
|
addTest('watch("\'x\'")');
|
|
|
|
// Continue
|
|
addTest('c', [
|
|
/break in .*:5/,
|
|
/Watchers/,
|
|
/0:\s+'x' = "x"/,
|
|
/()/,
|
|
/3/, /4/, /5/, /6/, /7/
|
|
]);
|
|
|
|
// Show watchers
|
|
addTest('watchers', [
|
|
/0:\s+'x' = "x"/
|
|
]);
|
|
|
|
// Unwatch
|
|
addTest('unwatch("\'x\'")');
|
|
|
|
// Step out
|
|
addTest('o', [
|
|
/break in .*:12/,
|
|
/10/, /11/, /12/, /13/, /14/
|
|
]);
|
|
|
|
// Continue
|
|
addTest('c', [
|
|
/break in .*:5/,
|
|
/3/, /4/, /5/, /6/, /7/
|
|
]);
|
|
|
|
// Set breakpoint by function name
|
|
addTest('sb("setInterval()", "!(setInterval.flag++)")', [
|
|
/1/, /2/, /3/, /4/, /5/, /6/, /7/, /8/, /9/, /10/
|
|
]);
|
|
|
|
// Continue
|
|
addTest('c', [
|
|
/break in timers.js:\d+/,
|
|
/\d/, /\d/, /\d/, /\d/, /\d/
|
|
]);
|
|
|
|
// Execute
|
|
addTest('exec process.title', [
|
|
/node/
|
|
]);
|
|
|
|
// Execute
|
|
addTest('exec exec process.title', [
|
|
/SyntaxError: Unexpected identifier/
|
|
]);
|
|
|
|
// REPL and process.env regression
|
|
addTest('repl', [
|
|
/Ctrl/
|
|
]);
|
|
|
|
addTest('for (var i in process.env) delete process.env[i]', []);
|
|
|
|
addTest('process.env', [
|
|
/\{\}/
|
|
]);
|