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. On Wednesday, 9 May 2018 19:35:59 UTC+5:30, Anoop R. S. wrote: > > 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 some custom > information about it. > > While wrapping the object, I implimented *GenericNamedPropertyGetterCallback > *and called *SetHandler* to set it to the *ObjectTemplate* using function > *NamedPropertyHandlerConfiguration* > > point_object_template->SetHandler( > v8::NamedPropertyHandlerConfiguration(AccessorGetterCallbackFunction,0, > NamedPropertyQueryCallbackFunction)); > > The function is implemented as follows: > void AccessorGetterCallbackFunction(v8::Local<v8::Name> property, const v8 > ::PropertyCallbackInfo<v8::Value>& info) > { > auto pointPtr = UnwrapPoint(info.Holder()); > bool bIsString = property->IsString(); > std::string accessed_property; > auto value = v8::Local<v8::String>::Cast(property); > v8::String::Utf8Value utf8_value(v8::Local<v8::String>::Cast(property)); > accessed_property = *utf8_value; > if (accessed_property == "x") > > info.GetReturnValue().Set(v8::Integer::New(info.GetIsolate(), pointPtr-> > x_)); > > else if (accessed_property == "y") > > info.GetReturnValue().Set(v8::Integer::New(info.GetIsolate(), pointPtr-> > y_)); > > } > > The content of p is coming as {} as shown below. > > > <https://lh3.googleusercontent.com/-JE5N1GWgBZY/WvL8eaJ88OI/AAAAAAAAFdI/rfNwKshqsqUVH7y7VetfcWHqmcp-ae9dACLcBGAs/s1600/Capture.PNG> > Are there any callbacks are available to set the content that is displayed > as value of p? Also, other than x and y, which are members of *Point, > *another > property named *splice* is showing up. When is this property accessed? > Please let me know if you have any information. > > regards, > Anoop R. S. > > On Wednesday, 9 May 2018 17:44:12 UTC+5:30, ibon wrote: >> >> 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. >>> Going by the standard example in Embedder's Guide: >>> C++ class: >>> ------------- >>> class Point { >>> public: >>> Point(int x, int y) : x_(x), y_(y) { } >>> int x_, y_; >>> } >>> >>> Usage in JavaScript: >>> --------------------------- >>> var p = Point(1,2); >>> >>> Has anyone tried debugging a wrapped C++ object that is being returned >>> to Javascript? Is it possible? >>> >>> regards, >>> Anoop R. S. >>> >> -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.