-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose _v8_internal_Print_Object symbol for debug addon and Node.js core easily #32402
Comments
Are you using a debug build? The * Well, not quite, I think V8 has a flag to expose those methods without debug builds (with some performance overhead, but less than a full debug build) Edit: here's the issue on how lldb_commands might be broken: #29667 (maybe it's fixed on 8.1) |
debug build works fine. I want release also works.
Yeap, but @danbev fixed again (should be bundled in v8 8.3, macOS still broken, but linux is fine). See danbev/learning-v8#10.
Maybe a solution. I am okay with any if we can debug |
AFAIK V8 recommends against using it in release builds. It's not just that these methods are not exposed on release builds, they are not compiled, as well as many code paths which are left out because of overhead. As for "Maybe expose it via node.h or declare this api public", this would be a huge no, we can't publicly expose a private API from V8. If you still want to try, it's already possible (but not recommended and we should not document it) to make a release build with those print objects with (if you want to see everything that changes on V8 when this flag is enabled: |
Without |
With that being said, V8 has a new API for debugging release builds called |
Maybe publish a debug version when making a new release, only for debug purpose. PS: If you want to check the repo in description, see https://github.com/gengjiawen/node-debug. |
|
I suggested in nodejs/Release#555 (comment) but if you want a debug build perhaps add it to https://unofficial-builds.nodejs.org/? That would avoid placing an extra burden on the release team. You can PR your dockerfile and scripts to https://github.com/nodejs/unofficial-builds/. |
@gengjiawen the biggest request here is an improved experience for debugging addons, and not for debugging core itself (since core developers will build Node.js on their own), correct? If that's the case, this seems like something worth discussing on (it also seems to fall under the scope of |
Looks like a solution, I will take a look.
I am thinking bundled it with the default docker image, but it will help debugging with this case for now IIUC. |
Not a bug, since lldb_comamnds are aliases to call V8 functions. You'd need to write a VSCode extension to use the output from those commands in a more integrated way (which is not recommended, since there's no format guarantees for the output of those commands from V8). |
Add a configure flag to build V8 with `-DOBJECT_PRINT`, which will expose auxiliar functions to inspect heap objects using native debuggers. Fixes: nodejs#32402 Signed-off-by: Mary Marchini <[email protected]>
Add a configure flag to build V8 with `-DOBJECT_PRINT`, which will expose auxiliar functions to inspect heap objects using native debuggers. Fixes: #32402 Signed-off-by: Mary Marchini <[email protected]> PR-URL: #32834 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
Add a configure flag to build V8 with `-DOBJECT_PRINT`, which will expose auxiliar functions to inspect heap objects using native debuggers. Fixes: #32402 Signed-off-by: Mary Marchini <[email protected]> PR-URL: #32834 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
Add a configure flag to build V8 with `-DOBJECT_PRINT`, which will expose auxiliar functions to inspect heap objects using native debuggers. Fixes: #32402 Signed-off-by: Mary Marchini <[email protected]> PR-URL: #32834 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
Add a configure flag to build V8 with `-DOBJECT_PRINT`, which will expose auxiliar functions to inspect heap objects using native debuggers. Fixes: #32402 Signed-off-by: Mary Marchini <[email protected]> PR-URL: #32834 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
Is your feature request related to a problem? Please describe.
Currently we can't debug
v8::Value
due to some symbol not exposedAfter we import
https://github.com/nodejs/node/blob/master/deps/v8/tools/lldb_commands.py
in lldb, if we want to print a v8 value, it's not workingWith the result, making hard to debug
This could be fixed by running a debug Node.js, but it's not very friendly for developers.
Source should here: https://github.com/nodejs/node/blob/2883c855e0105b51e5c8020d21458af109ffe3d4/deps/v8/src/diagnostics/objects-printer.cc#L2678-L2677
Describe the solution you'd like
Maybe expose it via
node.h
or declare this api public ?cc @addaleax @bnoordhuis @danbev @joyeecheung @nodejs/n-api
The text was updated successfully, but these errors were encountered: