From 756a34e86386bbc879234c4987eacdcb21e0e54b Mon Sep 17 00:00:00 2001 From: Matheus Marchini Date: Mon, 25 Dec 2017 22:17:25 -0200 Subject: src, test: node internals' postmortem metadata Before these changes, only V8 added postmortem metadata to Node's binary, limiting the possibilities for debugger's developers to add some features that rely on investigating Node's internal structures. These changes are first steps towards empowering debug tools to navigate Node's internal structures. One example of what can be achieved with this is shown at nodejs/llnode#122 (a command which prints information about handles and requests on the queue for a core dump file). Node postmortem metadata are prefixed with nodedbg_. This also adds tests to validate if all postmortem metadata are calculated correctly, plus some documentation on what is postmortem metadata and a few care to be taken to avoid breaking it. Ref: https://github.com/nodejs/llnode/pull/122 Ref: https://github.com/nodejs/post-mortem/issues/46 PR-URL: https://github.com/nodejs/node/pull/14901 Refs: https://github.com/nodejs/post-mortem/issues/46 Reviewed-By: Michael Dawson Reviewed-By: Matteo Collina Reviewed-By: Ben Noordhuis Reviewed-By: Joyee Cheung --- src/handle_wrap.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/handle_wrap.h') diff --git a/src/handle_wrap.h b/src/handle_wrap.h index 29e4f36460..1cfe3e2ebb 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -81,6 +81,11 @@ class HandleWrap : public AsyncWrap { friend class Environment; friend void GetActiveHandles(const v8::FunctionCallbackInfo&); static void OnClose(uv_handle_t* handle); + // handle_wrap_queue_ needs to be at a fixed offset from the start of the + // class because it is used by src/node_postmortem_metadata.cc to calculate + // offsets and generate debug symbols for HandleWrap, which assumes that the + // position of members in memory are predictable. For more information please + // refer to `doc/guides/node-postmortem-support.md` ListNode handle_wrap_queue_; enum { kInitialized, kClosing, kClosingWithCallback, kClosed } state_; uv_handle_t* const handle_; -- cgit v1.2.3