You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we use llnode to find out the properties for bar, it will give the following output:
(lldb) v8 findjsinstances -v Bar
0x0000015078184729:<Object: Bar properties {
.constructor=0x00000150781846e1:<function: Bar at index.js:17:14>}>
0x0000015078184949:<Object: Bar properties {
.<non-string>=0x00002d2064acb1e1:<String: "Bar">}>
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?
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
Activity
bnoordhuis commentedon Dec 9, 2017
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.
That gives you these:
mmarchini commentedon Jul 12, 2018
@bnoordhuis yes, this patch is enough on the V8 side. Will you submit a CL with these changes?
src: teach llnode how to print Symbol properties names
mmarchini commentedon Jul 23, 2018
@bnoordhuis would you mind if I open a CL with these changes, or do you want to do it?
[postmortem] add postmortem metadata for symbols
deps: backport 958b761 from upstream V8
deps: backport 958b761 from upstream V8
deps: backport 958b761 from upstream V8
deps: backport 958b761 from upstream V8
src: teach llnode how to print Symbol properties names
src: teach llnode how to print Symbol properties names