Fantastic! - works like a charm. Thx a lot.
Thomas

Den lørdag den 21. maj 2016 kl. 19.18.46 UTC+2 skrev Charles Vaughn:
>
> So with embind it generates a wrapper if you bind a pointer. This doesn't 
> work with variables inside emscripten code.
>
> In the past I've done this with casting from an int, something like
>
> void dumpObject(uint32_t ptr) {
>   real_dumpObject((MyClass *)(void *)(ptr)));
> }
>
> You might also be able to use CyberDWARF for this: 
> https://github.com/kripken/emscripten/blob/1.36.4/site/source/docs/debugging/CyberDWARF.rst
>
> On Friday, May 20, 2016 at 3:55:27 PM UTC-7, Thomas Arnbjerg wrote:
>>
>> Both $this and $mc are present in the generated JavaScript.
>>
>> Den fredag den 20. maj 2016 kl. 17.33.52 UTC+2 skrev Brion Vibber:
>>>
>>> Are $this and $mc present in the generated JavaScript (without the 
>>> source map) or have they been renamed in the minification? The console will 
>>> need to work with the 'real' variable names.
>>>
>>> -- brion
>>>
>>> On Fri, May 20, 2016 at 6:42 AM, Thomas Arnbjerg <
>>> [email protected]> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I've exposed a function to javascript using embind, which takes a 
>>>> pointer to an object as the argument - e.g. "dumpObject(MyClass* o)"
>>>>
>>>> I then start a debug session in the browser and break the javascript 
>>>> execution at a location, where a non-static method on 'MyClass' is called 
>>>> (as seen in the SourceMap). 
>>>>
>>>> If I call 'Module.dumpObject($this)' the console reports a BindingError 
>>>> stating that '$this' is not of the right type and 'dumpObject' is never 
>>>> called.
>>>>
>>>> The problem is the same if i simply declare a local instance of 
>>>> 'MyClass' as 'mc' and subsequently break and attempt to call 
>>>> 'Module.dumpObject($mc)'.
>>>>
>>>> Can anyone give me a hint on how to solve this?
>>>>
>>>> Thx
>>>>
>>>> Thomas
>>>>
>>>> PS: This is the next chapter in of the post: 'Newbie question - How 
>>>> debug the instance of an object in the browser with source maps'
>>>>
>>>>
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "emscripten-discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to