Repository navigation
inspect objects with "Symbol" attributes #156
Copy link
Copy link
Closed
Labels
Description
Activity
Can you try this patch with node.js master? That should add the metadata for symbols although llnode still needs to be taught to use it.
diff --git a/deps/v8/src/v8.gyp b/deps/v8/src/v8.gyp index 89eb271f61..38670c193d 100644 --- a/deps/v8/src/v8.gyp +++ b/deps/v8/src/v8.gyp @@ -2452,6 +2452,8 @@ 'objects-inl.h', 'objects/map.h', 'objects/map-inl.h', + 'objects/name.h', + 'objects/name-inl.h', 'objects/script.h', 'objects/script-inl.h', 'objects/shared-function-info.h', diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 22f0afbef3..5f33fdebe9 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -417,15 +417,10 @@ def load_objects_from_file(objfilename, checktypes): # way around. # for type in types: - # - # Symbols and Strings are implemented using the same classes. - # - usetype = re.sub('SYMBOL_', 'STRING_', type); - # # REGEXP behaves like REG_EXP, as in JS_REGEXP_TYPE => JSRegExp. # - usetype = re.sub('_REGEXP_', '_REG_EXP_', usetype); + usetype = re.sub('_REGEXP_', '_REG_EXP_', type); # # Remove the "_TYPE" suffix and then convert to camel case,
That gives you these:
$ nm out/Release/node | grep -i v8dbg.*symbol 0000000101596d58 D _v8dbg_class_Symbol__flags__SMI 0000000101596d54 D _v8dbg_class_Symbol__name__Object 000000010159ece4 S _v8dbg_parent_Symbol__Name 0000000101596a50 D _v8dbg_type_Symbol__SYMBOL_TYPE@bnoordhuis yes, this patch is enough on the V8 side. Will you submit a CL with these changes?
- added a commit that references this issue
on Jul 12, 2018 @bnoordhuis would you mind if I open a CL with these changes, or do you want to do it?
- added a commit that references this issue
on Sep 5, 2018 - added a commit that references this issue
on Oct 6, 2018 - added 2 commits that reference this issue
on Oct 6, 2018 - added a commit that references this issue
on Oct 17, 2018 - added a commit that references this issue
on Dec 19, 2018 - added a commit that references this issue
on Feb 22, 2026
Inspect commands can't handle Symbol attributes (e.g. @@toStringTag and @@unscopable), resulting in
<non-string>properties.For example, the following code uses the
@@toStringTagsymbol:If we use llnode to find out the properties for
bar, it will give the following output:As you can see, there's a
<non-string>property instead of our symbol.I was looking at llnode and V8 code to try to find a solution, but I'm not sure how to implement it. Did anyone try this before?