In building large programs, it's often necessary to examine state after a
program has crashed, as one can do with a process core dump. I've been
working on a tool for extracting JavaScript-level state from a core dump or
a running process in production. Although I've been testing with Node, the
tool has almost no dependence on node and should work for any program using
libv8. I've described some initial results here:
http://dtrace.org/blogs/dap/2011/10/31/nodejs-v8-postmortem-debugging/
The biggest challenge is just getting the debugger to understand the
various structure offsets, masks, tags, and other constants required to
know what type an object is and how to print it out. All of this is
available in objects.h, but most these values are compiled out of the final
binary. I made some changes to V8 to explicitly export symbols that encode
this information:
https://github.com/davepacheco/node/commit/8065e14b08aa95368d1a3b9d372ec63d7b9c7cb0
Could such a change be incorporated into V8 proper to support this and
other postmortem analysis tools?
Thanks,
Dave Pacheco
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users