Skip to content

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

@arekinath

Description

@arekinath

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions