NOTE: Even though this module works as is, I am no longer improving it because a better solution is available now. Therefore please use llnode instead.
Debugging Node.js with lldb and jbt | Debugging Node.js with Xcode and jbt |
---|---|
npm install -g lldb-jbt
Requires Node.js version 0.11.13
or higher and works best with a debug build.
For more information see Node.js build instructions.
- Add the script dir to your
PYTHONPATH
by runningsource jbt
- Debug your node process with
--perf-basic-prof
flag, i.e.lldb -- node --perf-basic-prof index.js
- Import the jbt command into lldb
command script import jbt
- Set a breakpoint, i.e.
b uv_fs_read
- When you hit the breakpoint type
jbt
to see the stack trace with JavaScript symbols resolved
To make things work with Xcode do the following:
- Run
jbt
to determine wherejbt.py
was installed on your machine - Add a
~/.lldbinit-xcode
file which will be picked up by Xcode with the below content
command script import <path/to/jbt.py>
Now the jbt command will initialize itself and is accessible to you in the lldb console inside Xcode.
MIT