I've got a PR out each for the fastcomp and base emscripten changes to 
enable this system.

It should be usable, you'll need both the fastcomp and emscripten work

Fastcomp: 
https://github.com/hackcasual/emscripten-fastcomp/tree/cvaughn_emdebug_work 
Emscripten: https://github.com/hackcasual/emscripten/tree/cvaughn_emdebug_work

Compile with -s CYBERDWARF=1

That builds a <target_name>.cd file that your program will automatically 
load. 

There are 3 decoder functions so far, all of which return the pointer as 
JSON, the only difference being how they get the type for the pointer. All 
functions are hanging off of Module['emdebugger_heap_printer']

decode_from_stack(ptr, var_name) - Uses the function 4 stack frames 
previous to this one (this should work if you trip an EM_ASM(debugger) or 
see how the tests work).
decode_var_by_var_name(ptr, var_name) - First use set_current_function, 
either with the mangled C++ name or with the minified symbol in Javascript, 
then it works the same as decode_from_stack
decode_var_by_type_name(ptr, type_name) - Doesn't need to know the 
function, just pass it the mangled C++ type name

All functions take an optional depth parameter, controlling how far down 
they follow the types.

Here's a sample output from one of the tests:

{
"struct TestBase * : tb": {
"float : a": 1337,
"char : b": 0,
"char * : c": "null",
"char * : d": "null",
"char * * : e": "null",
"char * * * : f": "null",
"short * * : g": "null",
"int & : h": 50
},
"struct TinyStruct * : ts": {
"short : len": 14,
"char * : chars": 72
}
}




-- 
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