Re: uncaught_exceptionv erri

2019-07-09 Thread Stéphane Letz

Yes the -s ASSERTIONS=1 stuff fixes it. Thanks.

Le mardi 9 juillet 2019 23:56:49 UTC+2, Alon Zakai a écrit :
>
> If you are loading the code as an ES6 module, that error looks like it 
> might be the same as 
>
>
> https://github.com/emscripten-core/emscripten/pull/8306#discussion_r284040606
>
> which was pulled off into
>
> https://github.com/emscripten-core/emscripten/issues/8678
>
> As a workaround until that is fixed, removing -s ASSERTIONS=1 should avoid 
> the problem.
>
> - Alon
>
>
> On Thu, Jul 4, 2019 at 7:23 AM Stéphane Letz > 
> wrote:
>
>> I get this error:
>>
>> libwasm-worklet-glue.js:8 Uncaught TypeError: Cannot assign to read only 
>> property '__ZSt18uncaught_exceptionv' of object '[object Object]'
>> at libwasm-worklet-glue.js:8
>> at clarinetMIDI-processor1.js:7
>>
>> when loading and starting a WASM compiled library:  
>>
>> import FaustModule from './libwasm-worklet-glue.js';
>>
>> const faust_module = FaustModule(); 
>>
>> The code is compiled with :
>>
>> --bind -O3 --memory-init-file 0 -s LINKABLE=1 -s WASM=1 -s 
>> EXPORT_NAME=\"'FaustModule'\" -s MODULARIZE=1 -s ASSERTIONS=1 -s 
>> ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=1  -s 
>> BINARYEN_ASYNC_COMPILATION=0 -s SINGLE_FILE=1"
>>
>> Any idea?
>>
>> -- 
>> 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 emscripten-discuss+unsubscr...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/emscripten-discuss/07d23290-a612-4099-86e2-4e235e540043%40googlegroups.com
>>  
>> 
>> .
>> 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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/09c57497-15ab-4f42-837d-4eb1258ae7e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: The state of debugging c++

2019-07-09 Thread Alon Zakai
Source maps are the closest thing currently: build with -g4, load in a
browser's devtools, and you should see the original C++ source code, and
can place breakpoints. However, variable names don't work. That will need
something more like DWARF, which people are currently working on.


On Wed, Jul 3, 2019 at 3:47 PM adam crockett 
wrote:

> Thanks everyone, firstly I have searched high and low for a definitive
> answer but have not found anything credible.
>
> Is it possible to place breakpoints in  here and have a
> process (I don't know what) attach so that a developer can debug the c/c++
> portion of the code?
>
> My use case:
> Target: node 8^
> Editor: vscode
>
> Have you managed it, what is your editor of choice and may you share the
> steps.
>
> --
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/491e84c9-7920-4b30-ad34-4b90df381e10%40googlegroups.com
> .
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpQZOo1sYC4cgUWSz_p5c00O%3DcPNKQUqgnMwSKZCXYgSxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: uncaught_exceptionv erri

2019-07-09 Thread Alon Zakai
If you are loading the code as an ES6 module, that error looks like it
might be the same as

https://github.com/emscripten-core/emscripten/pull/8306#discussion_r284040606

which was pulled off into

https://github.com/emscripten-core/emscripten/issues/8678

As a workaround until that is fixed, removing -s ASSERTIONS=1 should avoid
the problem.

- Alon


On Thu, Jul 4, 2019 at 7:23 AM Stéphane Letz  wrote:

> I get this error:
>
> libwasm-worklet-glue.js:8 Uncaught TypeError: Cannot assign to read only
> property '__ZSt18uncaught_exceptionv' of object '[object Object]'
> at libwasm-worklet-glue.js:8
> at clarinetMIDI-processor1.js:7
>
> when loading and starting a WASM compiled library:
>
> import FaustModule from './libwasm-worklet-glue.js';
>
> const faust_module = FaustModule();
>
> The code is compiled with :
>
> --bind -O3 --memory-init-file 0 -s LINKABLE=1 -s WASM=1 -s
> EXPORT_NAME=\"'FaustModule'\" -s MODULARIZE=1 -s ASSERTIONS=1 -s
> ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=1  -s
> BINARYEN_ASYNC_COMPILATION=0 -s SINGLE_FILE=1"
>
> Any idea?
>
> --
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/07d23290-a612-4099-86e2-4e235e540043%40googlegroups.com
> 
> .
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpT3TCm8cbCsSZ1cpg0q5riim7z8hKo2L0byoyna%2BHku1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: C++ main loop and browser events

2019-07-09 Thread Alon Zakai
A "while (1) " loop is not valid on the web. Was that loop pasted in there
by mistake?

The "SimulateInfiniteLoop" exception is part of how emscripten fakes an
infinite loop. It is thrown because you pass "1" as the last param to that
set_main_loop call,

https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_set_main_loop

If that was 0 it would not throw ( but then it would continue to the line
after it, which can also be confusing in some cases).

On Mon, Jul 8, 2019 at 7:32 AM nevo natan  wrote:

>
> I have a straight forward CPP flow as follows:
>
>   emscripten_set_main_loop_arg(one_iter,this, 0, 1);
> while (1) {
>  one_iter(this);
>  SDL_Delay(time_to_next_frame());
>}
>
>
> in my JS it looks like this:
> function initBoreg() {
> myObj = new Module.myObj();
> myObj.myAction() ;
> }
>
>
> but myObj works great.
> but myAction gives this console:
>
> test.html:1 Uncaught (in promise) SimulateInfiniteLoop
>
> Any ideas how I can add myAction functionality to the mainloop?
>
> Help much appreciated!
>
> --
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/3e9d115c-88f8-49c5-93b3-038d6aaef729%40googlegroups.com
> 
> .
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpQ%3DizVj_4KtMu6BJvRcx5nq6F9sf%3DhVZm3g3Lg8ePewFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Strange error in EMCC compiled code

2019-07-09 Thread J Decker
https://github.com/emscripten-core/emscripten/issues/8774

On Tue, Jul 9, 2019 at 6:19 AM Stéphane Letz  wrote:

> We get this error when using C++ code compiled with EMCC 1.38.31
>
> ReferenceError: tempDouble is not defined
> at Object.doStat (http://
> 127.0.0.1:8000/libwasm-worklet-glue.js:4848:46)
> at ___syscall197 (http://
> 127.0.0.1:8000/libwasm-worklet-glue.js:6494:23)
> at _fstat (wasm-function[1849]:0xceadd)
> at _psf_is_pipe (wasm-function[517]:0x4405d)
> at _psf_open_file (wasm-function[71]:0x3343)
> at _sf_open (wasm-function[69]:0x2f36)
> at
> __ZN16LibsndfileReader9checkFileERKNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIc
> (wasm-function[1519]:0xc0e31)
> at
> __ZN15SoundfileReader9checkFileERKNSt3__26vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcNS5_IS7_RKS7_
> (wasm-function[1361]:0xb8561)
> at
> __ZN15SoundfileReader10checkFilesERKNSt3__26vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcNS5_IS7_SB_
> (wasm-function[1360]:0xb8412)
> at __ZN7SoundUI12addSoundfileEPKcS1_PP9Soundfile (wasm-function[1356]:
> 0xb7b0a)
>
>
>
> I has to manually add those two lines in the JS library to make it work:
>
> var tempDouble;
> var tempI64;
>
>
> Any idea? Thanks.
>
> --
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/db0abf1f-e408-4977-978a-529986acf4b2%40googlegroups.com
> 
> .
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAA2GJqWKzgp33RifWSUgBpmn9%3Dmt8icMOPE%3D1Ov7KOcDXd11EA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Strange error in EMCC compiled code

2019-07-09 Thread Stéphane Letz
We get this error when using C++ code compiled with EMCC 1.38.31

ReferenceError: tempDouble is not defined
at Object.doStat (http://127.0.0.1:8000/libwasm-worklet-glue.js:4848:46)
at ___syscall197 (http://127.0.0.1:8000/libwasm-worklet-glue.js:6494:23)
at _fstat (wasm-function[1849]:0xceadd)
at _psf_is_pipe (wasm-function[517]:0x4405d)
at _psf_open_file (wasm-function[71]:0x3343)
at _sf_open (wasm-function[69]:0x2f36)
at 
__ZN16LibsndfileReader9checkFileERKNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIc
 
(wasm-function[1519]:0xc0e31)
at 
__ZN15SoundfileReader9checkFileERKNSt3__26vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcNS5_IS7_RKS7_
 
(wasm-function[1361]:0xb8561)
at 
__ZN15SoundfileReader10checkFilesERKNSt3__26vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcNS5_IS7_SB_
 
(wasm-function[1360]:0xb8412)
at __ZN7SoundUI12addSoundfileEPKcS1_PP9Soundfile (wasm-function[1356]:
0xb7b0a)



I has to manually add those two lines in the JS library to make it work:

var tempDouble;
var tempI64;


Any idea? Thanks.

-- 
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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/db0abf1f-e408-4977-978a-529986acf4b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting emscripten's header files

2019-07-09 Thread Mehdi Sabwat
Hi, 

I use emsdk to manage the versions of the toolchain I use:
https://github.com/emscripten-core/emsdk
when you execute emcc, it will look for what's in emscripten/system/include 
so you can easily #include  or  (look 
into emscripten/system/include for the full list of headers)


On Tuesday, July 9, 2019 at 11:58:43 AM UTC+2, שחר לנגבהיים wrote:
>
> Hi, I didn't find the best practices regarding including emscripten.h and 
> html5.h in a project. Most of the examples I see just copy the files into 
> the project, but that means that the only way to receive updates is to copy 
> them manually. 
> What's the best way to use emscripten's headers? Add it as a git submodule 
> to my project, and add the submodule's include folder into the search path?
>

-- 
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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/afa7c6b2-4ba9-44e5-b660-9c93b08b470d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Getting emscripten's header files

2019-07-09 Thread שחר לנגבהיים
Hi, I didn't find the best practices regarding including emscripten.h and 
html5.h in a project. Most of the examples I see just copy the files into 
the project, but that means that the only way to receive updates is to copy 
them manually. 
What's the best way to use emscripten's headers? Add it as a git submodule 
to my project, and add the submodule's include folder into the search path?

-- 
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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/7e726521-c703-48fd-9e5d-aab76d25e4d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 32-bit SDK of Emscripten 1.38.x

2019-07-09 Thread Manuel Häusler

If I see it right the logic in gnu/stubs.h is responsible for the selection 
of the header file:

#if !defined __x86_64__
# include 
#endif
#if defined __x86_64__ && defined __LP64__
# include 
#endif
#if defined __x86_64__ && defined __ILP32__
# include 
#endif

Therefore I conclude from this that __LP64__ is not defined from JModelica 
but should be defined to be able to use the 64-bit header files. Does 
anyone know what __LP64__ is??

Am Dienstag, 9. Juli 2019 10:08:38 UTC+2 schrieb Beuc:
>
> You can't use your system (i386) headers for an Emscripten (asmjs/wasm) 
> application :)
>
> If JModelica can't be compiled without i386 headers (AFAIU), it probably 
> can't compiled for the asmjs/wasm target.
> You'll need to improve JModelica so it supports more targets/architectures.
> Cheers!
> Beuc
>

-- 
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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/58493340-5755-4c3a-9747-8dd6176d3a13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 32-bit SDK of Emscripten 1.38.x

2019-07-09 Thread Beuc
You can't use your system (i386) headers for an Emscripten (asmjs/wasm)
application :)

If JModelica can't be compiled without i386 headers (AFAIU), it probably
can't compiled for the asmjs/wasm target.
You'll need to improve JModelica so it supports more targets/architectures.

Cheers!
Beuc

On 09/07/2019 07:47, Manuel Häusler wrote:
>
> Without those, emcc will not find needed header files and stop with
> errors...
> What do you suggest then? Do I have to build a 32-Bit Emscripten on a
> 32-Bit system to overcome that problem?
>
>
> Am Montag, 8. Juli 2019 18:52:57 UTC+2 schrieb Alon Zakai:
>
> The use of local system includes can cause errors,
>
> -I /usr/include/ -I /usr/include/i386-linux-gnu/ -I
> /usr/include/i386-linux-gnu/bits/
>
> Without those emcc will properly use the emcc system headers. With
> those, it will use whatever is on the local system, which may be
> wrong (since you aren't compiling for that system natively, but
> cross-compiling for another target).
>

-- 
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 emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/899cfbac-e9ee-13e2-7fd2-2e47557686c8%40beuc.net.
For more options, visit https://groups.google.com/d/optout.