[v8-users] Re: Debugging wrapped C++ object

2018-05-22 Thread Anoop R. S.
Yes, same behaviour is observed here. In console, it is printed as ƒ [object customValue ] Thank you for your help, ibon. :) regards, Anoop R. S. On Tuesday, 22 May 2018 14:49:55 UTC+5:30, ibon wrote: > > On my side, I don't do anything in the object template with > SetCallAsFunctionHandler.

[v8-users] Re: Debugging wrapped C++ object

2018-05-22 Thread ibon
On my side, I don't do anything in the object template with SetCallAsFunctionHandler. I have tested setting my object template SetCallAsFunctionHandler and as you say, instant tooltip in DevTools shows the object as anonymous, but still prints as [object MyStuff] in the console. so I am afraid I

[v8-users] Re: Debugging wrapped C++ object

2018-05-21 Thread Anoop R. S.
Hi, I read around a bit and did some changes. Instead of using an *ObjectTemplate *directly, for wrapping the C++ object, I created a *FunctionTemplate *first, used *SetClassName()* and then called *InstanceTemplate()* to create an *ObjectTemplate *from it. All handlers were set on this *Object

[v8-users] Re: Debugging wrapped C++ object

2018-05-21 Thread Anoop R. S.
Thank you for your reply, ibon. I am using *FunctionTemplate *to expose the keyword '*Point*'. So, it will call the function registered with the *FunctionTemplate*. In that function, I am using *ObjectTemplate* to wrap the C++ object and return. For the *ObjectTemplate*, I am setting the handler

[v8-users] Re: Debugging wrapped C++ object

2018-05-21 Thread ibon
Have you tried setting the class name in the FunctionTemplate ? interface_template->SetClassName( v8::String ) This names my objects as expected. I also get [object MyObject] instead of [object Object] when calling Object's prototype toString. You also might want to name the prototype by setting

[v8-users] Re: Debugging wrapped C++ object

2018-05-20 Thread Anoop R. S.
Hi All, I noticed another behaviour. If the callback *SetCallAsFunctionHandler() *is implemented for the ObjectTemplate, the value of the object is displayed as *f anonymous() *as shown below.

Re: [v8-users] Re: Debugging wrapped C++ object

2018-05-11 Thread Ben Noordhuis
On Thu, May 10, 2018 at 11:18 AM, Anoop R. S. wrote: > Thank you for the reply, Ben. >> >> Instead of v8::IndexedPropertyHandlerConfiguration, you may >> want to use v8::NamedPropertyHandlerConfiguration. > > I am already using it. What I noticed is that, when I run the code without > devtools deb

Re: [v8-users] Re: Debugging wrapped C++ object

2018-05-10 Thread Anoop R. S.
Thank you for the reply, Ben. > Instead of v8::IndexedPropertyHandlerConfiguration, you may > want to use v8::NamedPropertyHandlerConfiguration. > I am already using it. What I noticed is that, when I run the code without devtools debugging, only the callback *GenericNamedPropertyGetterCallba

Re: [v8-users] Re: Debugging wrapped C++ object

2018-05-10 Thread Anoop R. S.
Thank you for the reply, Ben. > Instead of v8::IndexedPropertyHandlerConfiguration, you may > want to use v8::NamedPropertyHandlerConfiguration. > I am already using it. What I noticed is that, when I run the code without devtools debugging, only the callback *GenericNamedPropertyGetterCallbac

Re: [v8-users] Re: Debugging wrapped C++ object

2018-05-10 Thread Anoop R. S.
Thank you for the reply, Ben. > Instead of v8::IndexedPropertyHandlerConfiguration, you may > want to use v8::NamedPropertyHandlerConfiguration. > I am already using it. What I noticed is that, when I run the code without devtools debugging, only the callback *GenericNamedPropertyGetterCallbac

Re: [v8-users] Re: Debugging wrapped C++ object

2018-05-10 Thread Ben Noordhuis
On Thu, May 10, 2018 at 8:42 AM, Anoop R. S. wrote: > Ok. I figured out that if v8::IndexedPropertyHandlerConfiguration is set, > and IndexedPropertyEnumeratorCallback is implemented, I can configure what > is displayed on mouse over action (Debugger.evaluateOnCallFrame is passed > from devtools

[v8-users] Re: Debugging wrapped C++ object

2018-05-09 Thread Anoop R. S.
Ok. I figured out that if *v8::IndexedPropertyHandlerConfiguration *is set, and *IndexedPropertyEnumeratorCallback *is implemented, I can configure what is displayed on mouse over action (*Debugger.evaluateOnCallFrame *is passed from devtools on doing that operation.) The implementation is p

[v8-users] Re: Debugging wrapped C++ object

2018-05-09 Thread Anoop R. S.
I noticed something else. Whatever value I set using *info.GetReturnValue().Set(), *I am able to see when I do this : *console.log(cppVariable.__proto__);* What maybe the reason for that? regards, Anoop R. S. On Wednesday, 9 May 2018 19:42:35 UTC+5:30, Anoop R. S. wrote: > > Also, when I do a

[v8-users] Re: Debugging wrapped C++ object

2018-05-09 Thread Anoop R. S.
Also, when I do a mouse over on the variable p, *AccessorGetterCallbackFunction* is invoked, which makes me believe that this function is responsible for displaying the content of the variable. But whatever value I set, *v8::Integer* or *v8:String*, it is displayed blank. regards, Anoop R. S.

[v8-users] Re: Debugging wrapped C++ object

2018-05-09 Thread Anoop R. S.
Thank you all for your replies. But my intention is different. Let me be more specific: I want others to debug the JavaScript code but not the c++ part. They will use chrome devtools to do that. So, when they encounter any c++ object that is made available to Javascript, I would like to display

[v8-users] Re: Debugging wrapped C++ object

2018-05-09 Thread ibon
Hey, I do this all the time with android studio. I have an android app with embedded v8, and debug both native c++ and javascript seamlessly. El martes, 8 de mayo de 2018, 6:35:12 (UTC+2), Anoop R. S. escribió: > > Hi All, > I am trying out a debugger prototype using the remote debugger protocol.

[v8-users] Re: Debugging wrapped C++ object

2018-05-07 Thread Zac Hansen
..the second breakpoint being in a native debugger like gdb/lldb/etc. On Monday, May 7, 2018 at 10:00:48 PM UTC-7, Zac Hansen wrote: > > I believe you can only interact with it on a javascript-basis from the > javascript debugger. I don't know of any way to treat it special from the > javascri

[v8-users] Re: Debugging wrapped C++ object

2018-05-07 Thread Zac Hansen
I believe you can only interact with it on a javascript-basis from the javascript debugger. I don't know of any way to treat it special from the javascript debugger. I often end up setting two breakpoints - first in JS, then another in the native callback I registered for the javascript objec