Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Support C++ exceptions #17

Open
emesare opened this issue Dec 1, 2023 · 2 comments
Open

Support C++ exceptions #17

emesare opened this issue Dec 1, 2023 · 2 comments
Assignees

Comments

@emesare
Copy link
Owner

emesare commented Dec 1, 2023

Using our RTTI information we can identify and symbolize both the throw metadata and the attached catch routine. This should be done in two passes. First pass should symbolize the throw metadata and the second pass should rewrite callsite to illustrate the branching, possibly with an xref to the catch routine and for the non-catch routine we should just be able to make the throw function returnable.

The end result should look something like this, the throw is highlighted orange to illustrate it could jump to the catch routine instead of continuing. Not sure how "correct" this is.

image

@emesare emesare changed the title Support c++ exceptions Support C++ exceptions Dec 1, 2023
@emesare
Copy link
Owner Author

emesare commented Dec 1, 2023

We could also inline the non-exceptional path like so:
image

@emesare emesare self-assigned this Dec 1, 2023
@ExecuteProtect
Copy link

I recommend taking into consideration whether or not there's debug data for the non-exceptional path's function before you inline anything. If there's debug data or a symbol that wasn't just auto-generated then you don't want to get rid of that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants