When using `iojs debug -p <pid>` with an invalid pid, the debugger
printed an internal error message because it wasn't smart enough
to figure out that the target process didn't exist. Now it is.
PR-URL: https://github.com/nodejs/io.js/pull/1863
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
When debug in remote mode with host:port or pid, the interface
spawn child process also. If the debugger agent is running, will
get following output:
```
< Error: listen EADDRINUSE :::5858
< at Object.exports._errnoException (util.js:734:11)
< at exports._exceptionWithHostPort (util.js:757:20)
< at Agent.Server._listen2 (net.js:1155:14)
< at listen (net.js:1181:10)
< at Agent.Server.listen (net.js:1268:5)
< at Object.start (_debug_agent.js:21:9)
< at startup (node.js:68:9)
< at node.js:799:3
```
This fix won't spawn child process and no more error message was
shown.
When use `iojs debug`, the tip information just like this:
```
Usage: iojs debug script.js
```
This fix will display the advance usage also:
```
Usage: iojs debug script.js
iojs debug <host>:<port>
iojs debug -p <pid>
```
Fixes: https://github.com/iojs/io.js/issues/889
PR-URL: https://github.com/iojs/io.js/pull/1282
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Many of the util.is*() methods used to check data types
simply compare against a single value or the result of
typeof. This commit replaces calls to these methods with
equivalent checks. This commit does not touch calls to the
more complex methods (isRegExp(), isDate(), etc.).
Fixes: https://github.com/iojs/io.js/issues/607
PR-URL: https://github.com/iojs/io.js/pull/647
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Overriding module argument with const causes a SyntaxError. This
commit changes the variable name to remove the error.
PR-URL: https://github.com/iojs/io.js/pull/572
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit replaces a number of var statements throughout
the lib code with const statements.
PR-URL: https://github.com/iojs/io.js/pull/541
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The copyright and license notice is already in the LICENSE file. There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
I was originally going to do this after the v0.11.15 release, but as
that release is three weeks overdue now, I decided not to wait any
longer; we don't want the delta to get too big.
Conflicts:
lib/net.js
test/simple/simple.status
PR-URL: https://github.com/iojs/io.js/pull/236
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Currently clearBreakpoint error is confusing, it says "Script not found"
when there is no breakpoint, also documentation doesn't include
signature for clearBreakpoint.
PR-URL: https://github.com/iojs/io.js/pull/175
Reviewed-By: Miroslav Bajtoš <miroslav@strongloop.com>
Fix Interface.setBreakpoint() to correctly handle an attempt to set a
breakpoint in the current script when there is no current script.
This usually happens when the debugged process is not paused.
Fixes: https://github.com/joyent/node/issues/6453
PR-URL: https://github.com/joyent/node/pull/6460
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Currently, the debugger uses require('repl') to setup the repl.
However, require.extensions is not available yet, causing a
crash on tab completion of require('. This commit uses the
module.requireRepl() method to bootstrap the repl.
Fixes: https://github.com/joyent/node/issues/8359
PR-URL: https://github.com/iojs/io.js/pull/49
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Turn on strict mode for the files in the lib/ directory. It helps
catch bugs and can have a positive effect on performance.
PR-URL: https://github.com/node-forward/node/pull/64
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
It wasn't doing anything, and actually due to
3ae0b17c76, it was causing
the readline `prompt()` function to be overwritten
which throws an error in the REPL shortly after.
The reason this wasn't working was because after restart, when restoring
breakpoints the scripts wasn't loaded, so the breakpoint.script was
undefined. As a fix I added another check to use breakpoint.scriptReq
instead of breakpoint.script, which is the same except when the
breakpoint is a function.
fixes #7027
We now wait to connect to the debuggee until we know that
its error stream has data, to ensure that the output message
"connecting..... ok" appears after "Debugger listening on port xyz"
I also increased the test timeout to let the more complex
tests finish in time on Windows
This change fixes the following unit tests on Windows:
test-debugger-repl.js
test-debugger-repl-term.js
test-debugger-repl-utf8.js
test-debugger-repl-restart.js
When developer calls setBreakpoint with an unknown script name,
we convert the script name into regular expression matching all
paths ending with given name (name can be a relative path too).
To create such breakpoint in V8, we use type `scriptRegEx`
instead of `scriptId` for `setbreakpoint` request.
To restore such breakpoint, we save the original script name
send by the user. We use this original name to set (restore)
breakpoint in the new child process.
This is a back-port of commit 5db936d from the master branch.
When developer calls setBreakpoint with an unknown script name,
we convert the script name into regular expression matching all
paths ending with given name (name can be a relative path too).
To create such breakpoint in V8, we use type `scriptRegEx`
instead of `scriptId` for `setbreakpoint` request.
To restore such breakpoint, we save the original script name
send by the user. We use this original name to set (restore)
breakpoint in the new child process.
Fixed a bug in debugger repl where `restart` command did not work
when a custom debug port was specified via command-line option
--port={number}.
File test/simple/helper-debugger-repl.js was extracted
from test/simple/test-debugger-repl.js
Fixed a bug in debugger repl where `restart` command did not work
when a custom debug port was specified via command-line option
--port={number}.
File test/simple/helper-debugger-repl.js was extracted
from test/simple/test-debugger-repl.js
Otherwise (especially with stdin) you sometimes end up in cases
where the high water mark is zero, and the current buffer is at 0,
and it doesn't need a readable event, so it never calls _read().
This should only be minimally used, since the `terminal` value will usually be
what you are expecting. This option is specifically for the case where `terminal`
is false, but you still want colors to be output (or vice-versa).