llnode
llnode copied to clipboard
No llnode command in the path when `brew install`ing
I understand from @rnchamberlain that the latest llnode creates a wrapper script that loads the plugin and runs lldb. This doesn't seem to get installed via brew.
▶▶▶ brew reinstall llnode ~/tmp/inspector-zero 20s
==> Reinstalling llnode
==> Downloading https://homebrew.bintray.com/bottles/llnode-1.6.2.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring llnode-1.6.2.high_sierra.bottle.tar.gz
==> Caveats
`brew install llnode` does not link the plugin to LLDB PlugIns dir.
To load this plugin in LLDB, one will need to either
* Type `plugin load /usr/local/opt/llnode/llnode.dylib` on each run of lldb
* Install plugin into PlugIns dir manually:
mkdir -p ~/Library/Application\ Support/LLDB/PlugIns
ln -sf /usr/local/opt/llnode/llnode.dylib \
~/Library/Application\ Support/LLDB/PlugIns/
==> Summary
🍺 /usr/local/Cellar/llnode/1.6.2: 6 files, 279.8KB
▶▶▶ llnode ~/tmp/inspector-zero 5s
zsh: command not found: llnode
llnode
is not an executable file. This is a plugin for another executable called lldb
.
https://github.com/nodejs/llnode#quick-start
I thought there was a script that was installed that wrappers lldb with the plugin install.
https://github.com/nodejs/llnode/blob/efaf0234bffc2cfe4871c6f15b2e14e7c5c7607f/package.json#L10
https://github.com/nodejs/llnode/blob/efaf0234bffc2cfe4871c6f15b2e14e7c5c7607f/scripts/configure.js#L142
I think that the npm install
for llnode does extra work to construct the llnode shell script. Probably the brew install
does not do that, though perhaps it could - enhancement useful to MacOS users?
I think it definitely could! This is a great idea.
@gibfahn sorry, I didn't know that it could do this with npm.
I think basically what we need to do is make brew install llnode
as a script that runs this
LLDB_EXE=/path/to/LLDB
LLNODE_PLUGIN=/path/to/the/built/plugin
$LLDB_EXE --one-line "plugin load $LLNODE_PLUGIN" --one-line "settings set prompt '(llnode) '" $@
BTW I usually just put plugin load /path/to/my/llnode/plugin
into my ~/.lldbinit
and it works out of the box no matter which version of lldb I am on
@joyeecheung does that error if the plugin isn't installed?
@gibfahn You mean the snippet or the lldbinit
approach? I think in the first case the brew formula would know in advance. In the second case, there would be this:
(lldb) plugin load /path/to/my/llnode/plugin
error: no such file
I meant the lldbinit
approach.
So it prints an error but otherwise works fine? I was thinking of adding it to my dotfiles 😁 .
@gibfahn Yes, it just prints an error and then keeps running, similar to what it does when trying to load a non-existent coredump. Of course v8
commands would be Unrecognized command
if the plugin fails to load but other stuff still work as usual.