-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Make getExceptionMessage work with EXCEPTION_STACK_TRACES in Emscripten EH #26050
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
Changes from all commits
5f7aa28
6115f33
20441a7
f6989c3
8134865
3a81a36
b574c4a
df4417b
775e41d
73f045a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1508,7 +1508,6 @@ def test_exceptions_rethrow_missing(self): | |
|
|
||
| @with_all_eh_sjlj | ||
| def test_EXPORT_EXCEPTION_HANDLING_HELPERS(self): | ||
| self.set_setting('ASSERTIONS', 0) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to just remove this line. No need for the additional change below since core tests run in O0 mode with assertions enabled already.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That may be sufficient for the testing of this PR, but then we don't get to test the case In case it was not clear why we test both
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But we already have the core0 and core1 configurations that test with ASSERTIONS=0 and ASSERTIONS=1. We shouldn't need to duplication that here, unless I'm missing something. If there is a reason to test with
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right. Will remove it. |
||
| self.set_setting('EXPORT_EXCEPTION_HANDLING_HELPERS') | ||
|
|
||
| self.maybe_closure() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a bit on that
ptrmight be something other than a pointer. Why not expect caller to always pass a pointer here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I understand. Do you mean, instead of doing the unwrapping here (and in
getExceptionMessageanddecrementExceptionRefcount), we should let the caller do the unwrapping? But the caller may be a user program:https://github.com/emscripten-core/emscripten/blob/035c704d5cbeb85481eb1c3273617d21b881d674/test/test_core.py#L1553C19-L1553C45
And it can be confusing for the user to do different things depending on whether they are in
ASSERTIONSmode or not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the user is already exposed to the difference aren't they? In one case they get a CppException object and in another case they get a pointer.
Is the idea that we are supposed to treat these two things the same a paper over the differences like this? It seems a little all. If we do want to do this consistently perhaps we should have some kind of helper/macro such as "caughtExceptionToPtr" or something like that?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can think of this as we providing overloaded convenience methods for similar but different types. Making the users change code depending on whether they build with
-O0and-Onwill be at best very inconvenient.