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

want dcmd to find context and global object from threadlocals #115

Open
arekinath opened this issue Feb 21, 2019 · 0 comments
Open

want dcmd to find context and global object from threadlocals #115

arekinath opened this issue Feb 21, 2019 · 0 comments

Comments

@arekinath
Copy link

arekinath commented Feb 21, 2019

v8 stashes a pointer to the current Isolate in a thread-local which we can very quickly read from mdb and use to walk down to the global object in use. This would be useful to quickly read (some) data out of process memory without doing a full heap scan.

https://gist.github.com/arekinath/f118c19af43d3955e674d22d3b0a5eb5 is an example of using this data to locate the "process" global and then the exports of all require() loaded modules in a nodejs process (and then it goes to specifically grab data that's accessible from the exports of the cueball module). I've also automated this process in https://gist.github.com/arekinath/6b46eb5291e400de117350f9bca905c6#file-diagnose-js-L380 which can run reliably with -o nostop.

It would be useful to turn basically this procedure into a couple of dcmds (the first of which would be this one, to get from the thread id to the context and global object)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant