Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 352 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to disable in the node debugger "break on first line"

#1
Is there a command line argument or an environment variable that disables the "break on first line" feature of the node debugger?
Reply

#2
There are actually two debugger concepts in node: V8 debugger (with its TCP-based protocol) and a node command-line debugger (CLI).

When you run `node debug app.js`, a debugger CLI is run in the master node process and a new child node process is spawned for the debugged script (`node --debug-brk app.js`). The option `--debug` or `--debug-brk` is used to turn on V8 debugger in the child process.

The difference between `--debug` and `--debug-brk` is that the latter one adds a breakpoint on the first line, so that execution immediately stops there.

I would suggest you this solution:

1. When you are creating a child process from your webserver, run `node --debug` instead of `node debug`. This way there is only one child process created, it is running your application and it is not paused on the first line.

2. Now you can use any debugging tool that supports [V8 debugger protocol](

[To see links please register here]

) - node built-in CLI debugger, [node-inspector](

[To see links please register here]

) or you can event implement your own debugger front-end (GUI) if you like. (I presume this is what you are trying achieve by running CLI debugger in background?)

If you decided to use built-in CLI, just spawn another another child process and tell node CLI debugger to connect to the process started in step 1:

`node debug localhost:5858`

and continue as before.
Reply

#3
Found this while looking for the answer myself - Seems that you can simply run

`node-debug --debug-brk=0 (progname)`

Hope this helps someone.
Reply

#4
# Write a chrome extension to click the start button

### 1. Run shell
mkdir run_as_devtools
cd run_as_devtools
touch manifest.json
touch run_as_devtools.js

### 2. Edit the files

run_as_devtools.js:

if (location.protocol === 'chrome-devtools:' && location.href.match(/ws=localhost/))(function () {
'use strict';
setTimeout(function () {
try {
document.querySelector('html /deep/ .long-click-glyph').click();
} catch (e) {
console.log(e);
}
}, 500);
})();

manifest.json: (it uses chromevox's key, so don't use it with chromevox)

{
"content_scripts": [{
"js": [ "run_as_devtools.js" ],
"matches": [ "<all_urls>" ]
}],
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEGBi/oD7Yl/Y16w3+gee/95/EUpRZ2U6c+8orV5ei+3CRsBsoXI/DPGBauZ3rWQ47aQnfoG00sXigFdJA2NhNK9OgmRA2evnsRRbjYm2BG1twpaLsgQPPus3PyczbDCvhFu8k24wzFyEtxLrfxAGBseBPb9QrCz7B4k2QgxD/CwIDAQAB",
"manifest_version": 2,
"name": "Elevated Devtools extension",
"version": "1.0"
}

### 3. Install the extension
Chrome settings - More tools - Extensions- Developer mode - Load unpacked extension - **select run_as_devtools folder**


P.S. Better to use it with Node inspector manager

[To see links please register here]


Reference:

[To see links please register here]

Reply

#5
I solved same issue just by switching from node v6 to v7
Reply

#6
Similar to blackmiaool's idea but simpler, with node v8 you can start the script with --inspect. If you have the following code in it, when you open the debug window in Chrome devtools it will take you straight to the debugger point. Additionally this allows you to execute async code by hitting the "continue" button, which allows your code to run before returning you to the repl:

// app_shell.js

var UserModel = require("./some_user_model");

function looper() {
var Tmp = { UserModel: UserModel };
debugger;
setTimeout(looper, 100);
}
looper();

And in a shell script you can do something like:

echo "Click the 'Open dedicated DevTools for Node' link"
python -mwebbrowser about:inspect
node --inspect app_shell.js

[See here for more info][1]


[1]:

[To see links please register here]

Reply

#7
According [this issue][1] I have opened in the [node][2] repo, currently, this is not possible. This is also something that the node guys don't see as a feature worth implementing *"because it seems kind of pointless. […] Attaching to a running process does exactly"* the same thing. See the rest of the discussion in the mentioned issue.

If you think you want such a feature, vote this up, leave a comment in the Github issue, and, if no response, open a new one and post it here as well.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#8
**This worked for me .**

node --inspect index.js


If you **haven't install inspector** , install it as receommended by node docs:

npm install -g node-inspect
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through