$ docker pull evanlucas/node_debug:latest
Sometimes debugging during development isn't enough. Enter llnode
.
$ ./build.sh
$ docker run --rm -it --security-opt seccomp:unconfined -p "10000:10000" \
evanlucas/node_debug:latest \
lldb -- node example.js
When the (lldb)
prompt appears, type:
# This is output from lldb
(lldb) target create "node"
Current executable set to 'node' (x86_64).
(lldb) settings set -- target.run-args "example.js"
# Now, let's set a breakpoint
(lldb) b DoWrite
# output
Breakpoint 1: 3 locations.
# Now, let's run the script
(lldb) r
# output
Process 3832 launched: '/usr/local/bin/node' (x86_64)
Now, it's time to make a request to the server. In another terminal:
$ curl http://localhost:10000/
The process should hit a breakpoint in the first terminal window.
Have fun and please report issues!
MIT