-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAFE_HEAP=1 disables proper source code mapping #4224
Comments
This does look like a bug. I suspect the issue is that SAFE_HEAP uses js optimizations to apply itself, and those can mess up those annotations. |
Great, let me know if I_can assist in it's squashing. |
Sure, if you have time to look into this that would be great. I don't really know the source mapping code well myself, so probably whoever looks into it will be learning some new code anyhow ;) |
Alright, it may be a bit steep for me considering I'm ~3 days into Emscripten, but I'll see if I can divert the time to it. |
If it's tricky, I wouldn't spend much time on it. That's a rare combination of flags. It would be nice to have it work, but I don't see a reason why 2 builds couldn't be almost as good. |
Maybe related? #5246 |
I'm seeing this issue too. My command line is:
I've combined these because I would like to get better errors on "segfaults" in dev, but it actually makes it harder to debug in normal cases! |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Hello,
With this command line, I get proper source code mapping in the comments of the .js file output.
emcc -g4 -O0 --js-opts 0 -s FS_LOG=1 -s EMULATE_FUNCTION_POINTER_CASTS=1 -s ASSERTIONS=2 --separate-asm --memory-init-file 1
By adding SAFE_HEAP=1 the source code map is no longer correct
emcc -g4 -O0 --js-opts 0 -s SAFE_HEAP=1 -s FS_LOG=1 -s EMULATE_FUNCTION_POINTER_CASTS=1 -s ASSERTIONS=2 --separate-asm --memory-init-file 1
What I see with this setting is "//@line 70514" which judging by the line# is a reference to the inside of my asm.js file, not the original C source code.
Removing SAFE_HEAP=1 fixes the problem, and I get a proper source map output "//@line 284 "./Modules/sre_lib.h""
Perhaps this is by design? I didn't see mention of this behaviour in the documentation that recommends the use of SAFE_HEAP, so I assume it's a bug.
The text was updated successfully, but these errors were encountered: