src, test: node internals' postmortem metadata #14901
Conversation
There was a problem hiding this comment.
style nit: align the * to the left (i.e. Environment* Environment::currentEnvironment)
There was a problem hiding this comment.
What’s the motivation for making this optional?
There was a problem hiding this comment.
I don’t think these guards are necessary either way.
There was a problem hiding this comment.
Tbh, I’d just put #define private public at the top of the generated file and use offsetof.
Added two new commands (getactivehandles and getactiverequests) which prints all pending handles and requests (same return given by process._getActiveHandles() and process._getActiveRequests()). Those changes were built upon the symbols added on nodejs/node#14901, which means it's currently not working with node's latest build. Fixes: nodejs#100 Ref: nodejs/node#14901
|
The changes to src/ seem rather ad hoc. I'm also not a fan of adding global variables. You don't need to because the env can be found by following |
|
Thanks for the feedbacks, I just updated the PR with the suggestions made by @addaleax. I'm just not sure if All changes previously made on |
There was a problem hiding this comment.
Is this the right place to include node-postmortem-metadata as a dependency?
There was a problem hiding this comment.
Seems fine to me but you should add a #host at the end. For consistency, I'd name it node_postmortem_metadata, i.e., underscores instead of dashes.
There was a problem hiding this comment.
I'll make those changes. Should I also rename gen-postmortem-metadata.py to gen_postmortem_metadata.py (most files on tools/ are using dashes, but there are some files using underscores)?
There was a problem hiding this comment.
This will be changed in the next update to this PR
There was a problem hiding this comment.
Is it safe to be used here?
Those changes are the first steps towards allowing debug tools to
navigate some of Node's internals strucutres, giving more possibilities
to developers doing post-mortem debugging. One example of what can be
achieved with the symbols added is a new command being developed for
llnode, which prints information about handles and requests on the
queue for a core dump file.
Ref: nodejs/post-mortem#46
Obs.: To add good tests for those changes, something like nodejs/build#777 is needed.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)