GeezerVison is showing github.com — Proposal: add more debugging symbols related to Node internal structures · Issue #46 · nodejs/post-mortem
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
Proposal: add more debugging symbols related to Node internal structures #46DescriptionHello everyone!
I'm writing a command to llnode to print all Handles and Requests on the queue of a core dump (similar to what node::GetActiveHandles and node::GetActiveRequests do). While I was working I noticed that, although there's plenty of debugging symbols to help navigate V8 structures (v8dbg_ symbols, thanks to the postmortem-metadata action on V8 build), there are no symbols to describe Node internal structures.
Using as example the command I'm implementing, I need to get the current Environment, navigate to the corresponding queue (let's say, handle_wrap_queue_), and then iterate over this queue (which was created with ListHead) to be able to get the HandleWrap objects. All of this can be done easily on a node debug build, but it's not possible to do on a common build.
I thought about implementing something similar to V8 postmortem-metadata: a script that creates a .cc file with all wanted symbols prefixed with something like nodedbg_. Would that be acceptable? I could probably publish a draft patch at the end of this week. I think this would be useful for other debugging tools, not just llnode.
I'm opened to suggestions.
In the meantime, thank you so much for your attention and participation. Activityrnchamberlain commented on Aug 18, 2017 This looks like a great step forward for post-mortem debugging of node internals (i.e. not just V8). The requirement raised here is typical: nodejs/llnode#100
Exposing the address of the Environment structure is a key step (as well as the offsets in that structure). You get that by setting a global symbol during node startup that you can then find in the debugger plugin?
Also you are wrapping this with NODE_POSTMORTEM_SUPPORT - is the intention to provide this in production builds of node? Thanks! mhdawson commented on Aug 18, 2017 @mmarchini thanks for suggesting/working on this. Additional meta data would be greatly appreciated. davepacheco commented on Aug 18, 2017 mmarchini commented on Aug 18, 2017 @rnchamberlain yes, the intention is to provide this in production builds too (I already removed those guards from the PR).
@davepacheco I'll add this offset to nodejs/node#14901, I'm just having trouble finding node_string.h, does it still exists on node's master branch?
Suggestions of other constants or offsets that can be added to this PR would be really appreciated! mmarchini commented on Mar 21, 2018 I'm closing because nodejs/node#14901 landed and is shipped on v9.7.0+, but feel free to reopen if you think there's something else to discuss here.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|