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

Javascript API for llnode? #14

Open
rnchamberlain opened this issue Jun 22, 2016 · 9 comments
Open

Javascript API for llnode? #14

rnchamberlain opened this issue Jun 22, 2016 · 9 comments
Assignees

Comments

@rnchamberlain
Copy link
Contributor

@indutny @hhellyer
Hi Fedor, we've been discussing the possibility of an NPM/Javascript API on top of llnode, so that diagnostic tools could be written that exploit the llnode+lldb libraries. An alternative to using the line-mode lldb debugger + plugin itself to read a core dump. For example, an interactive web viewer for core dumps that are stored on a node server. Also possibility of user add-ons written in Javascript.

Here's a very basic prototype, just to load a core dump and list the thread stacks:
indutny/llnode@master...rnchamberlain:llnode_api

Any thoughts? Would need to design the API, make the calls async etc etc

@indutny
Copy link
Member

indutny commented Jun 22, 2016

Hello!

I totally enjoy the idea, it sounds lovely! Considering that there are quite a lot of people interested in this kind of thing:

https://github.com/nodejs/post-mortem

Do you think it may be worth opening an issue, and having some kind of discussion or even call?

This JS API looks amazing!

@langhuihui
Copy link

When it will be done?

@rnchamberlain
Copy link
Contributor Author

@langhuihui Unfortunately I have not had time to work on this much this year. I have 2 branches, both quite old now (there has been quite a lot of other development on llnode recently):
https://github.com/rnchamberlain/llnode/tree/llnode_api
https://github.com/rnchamberlain/llnode/tree/javascript-api

There was also some discussion and other contributions in the post mortem workgroup:
nodejs/post-mortem#33

@joyeecheung
Copy link
Member

I am interested in picking this one up. Will try to rebase previous work to master first.

@joyeecheung
Copy link
Member

Some progress: got it working on MacOS and Ubuntu with linked libraries detected using llvm-config. Rewrote the API layer using Nan and bindings. Can load Linux coredumps on MacOS now. Will try to build a more full-fledged demo and polish the API on top of that.

https://github.com/joyeecheung/llnode/tree/js-api

@No9
Copy link
Member

No9 commented Oct 13, 2017

@joyeecheung will take a look on FreeBSD over the weekend

@joyeecheung
Copy link
Member

A few more progress: put the module (inherits ObjectWrap now) and the API into classes. To actually make it possible to instantiate multiple instances would require some surgery in llscan.cc and llnode.cc to remove the dependency on that global llv8 instance. The plan is to open a PR when the API is ready, not necessarily when the multiple instantiation is ready.

@joyeecheung
Copy link
Member

Another progress: redesigned the API a bit, it's documented in https://github.com/joyeecheung/llnode/blob/js-api/JSAPI.md, the instance iterators is still WIP but the other parts are done and tested in https://github.com/joyeecheung/llnode/blob/js-api/test/jsapi-test.js

@langhuihui
Copy link

great job

joyeecheung added a commit to joyeecheung/llnode that referenced this issue Jul 6, 2018
Co-authored-by: Richard Chamberlain <richard_chamberlain@uk.ibm.com>
PR-URL: nodejs#206
Refs: nodejs#14
Reviewed-By: Matheus Marchini <matheus@sthima.com>
joyeecheung added a commit to joyeecheung/llnode that referenced this issue Jul 6, 2018
PR-URL: nodejs#206
Refs: nodejs#14
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants