-
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
build: add flag to build V8 with OBJECT_PRINT #32834
Conversation
@mmarchini Just landed #32787 so you can avoid conflicts with it :) |
So it works on gdb, but not on lldb (all commands give empty results on lldb). One caveat though: any command that requires |
@mmarchini |
I'd be okay with turning it on unconditionally. We already do that for the builtin disassembler and that pulls in a lot more code than does object printing. diff --git a/common.gypi b/common.gypi
index d39668b100..7026f41565 100644
--- a/common.gypi
+++ b/common.gypi
@@ -53,6 +53,9 @@
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
+ # Sets -dOBJECT_PRINT.
+ 'v8_enable_object_print%': 1,
+
# https://github.com/nodejs/node/pull/22920/files#r222779926
'v8_enable_handle_zapping': 0,
|
The binary maybe much bigger. If we make it enable by default, maybe need to check binary size first. If the size turns out okay, I think we can close #32402. |
Shouldn't be that much, but I'll double check. cc @nodejs/v8 any performance or stability concerns if we enable OBJECT_PRINT by default (considering we already have |
@gengjiawen 72724 Kb (current build) vs 72972 Kb (with OBJECT_PRINT), so 248 Kb increase, which is not concerning IMO. |
This shouldn't affect anything beyond binary size and more verbose printing. It makes sense for debugging. |
The idea is to set it by default on release builds as well, so native module developers can use those debugging features as well. |
If you can live with the binary size increase that sounds fine. This code isn't battle tested, but it seems somewhat unlikely to cause unexpected issues; especially if you don't accept random untrusted input as JS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
I'll follow up with a PR to set this as default (as suggested by @bnoordhuis). |
@mmarchini This needs rebase. |
8ae28ff
to
2935f72
Compare
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 <mmarchini@netflix.com>
bd8951f
to
ed28d40
Compare
Landed in dd0c522 |
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 <mmarchini@netflix.com> PR-URL: #32834 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The flag improves the experience of debugging V8 with native debuggers. It doens't incur performance penality, the only downside is an increase in binary size by approximately 248 Kb. Ref: nodejs#32834
The flag improves the experience of debugging V8 with native debuggers. It doens't incur performance penality, the only downside is an increase in binary size by approximately 248 Kb. Ref: #32834 PR-URL: #34705 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
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 <mmarchini@netflix.com> PR-URL: #32834 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The flag improves the experience of debugging V8 with native debuggers. It doens't incur performance penality, the only downside is an increase in binary size by approximately 248 Kb. Ref: #32834 PR-URL: #34705 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
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 <mmarchini@netflix.com> PR-URL: #32834 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The flag improves the experience of debugging V8 with native debuggers. It doens't incur performance penality, the only downside is an increase in binary size by approximately 248 Kb. Ref: #32834 PR-URL: #34705 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
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 <mmarchini@netflix.com> PR-URL: #32834 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The flag improves the experience of debugging V8 with native debuggers. It doens't incur performance penality, the only downside is an increase in binary size by approximately 248 Kb. Ref: #32834 PR-URL: #34705 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
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 <mmarchini@netflix.com> PR-URL: #32834 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The flag improves the experience of debugging V8 with native debuggers. It doens't incur performance penality, the only downside is an increase in binary size by approximately 248 Kb. Ref: #32834 PR-URL: #34705 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
Add a configure flag to build V8 with
-DOBJECT_PRINT
, which willexpose auxiliar functions to inspect heap objects using native
debuggers.
Fixes: #32402
Signed-off-by: Mary Marchini mmarchini@netflix.com
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes