Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iojs debug -p <pid> starts debugger in debug client #889

Closed
bnoordhuis opened this issue Feb 19, 2015 · 2 comments
Closed

iojs debug -p <pid> starts debugger in debug client #889

bnoordhuis opened this issue Feb 19, 2015 · 2 comments
Labels
confirmed-bug Issues with confirmed bugs.

Comments

@bnoordhuis
Copy link
Member

$ out/Release/iojs --debug-brk benchmark/http_simple.js 
Debugger listening on port 5858

# from another terminal window
$ out/Release/iojs debug -p $(pgrep iojs)
< 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
connecting to port 5858... ok
break in benchmark/http_simple.js:1
> 1 var path = require('path'),
  2     exec = require('child_process').exec,
  3     http = require('http');
debug> 

No real harm, the debug client is still fully functional.

@bnoordhuis bnoordhuis added confirmed-bug Issues with confirmed bugs. debugger labels Feb 19, 2015
@JacksonTian
Copy link
Contributor

No need to start agent server when debug with remote mode(-p pid/host:port).

bnoordhuis pushed a commit that referenced this issue Mar 27, 2015
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: #889
PR-URL: #1282
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@Fishrock123
Copy link
Contributor

Fixed in a2ea168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs.
Projects
None yet
Development

No branches or pull requests

3 participants