Stack frame unwinding for exception handling
AssigneeMicrosoft Technology Licensing, LLC
InventorsPedro Miguel Teixeira, Neeraj K. Singh, Kenneth D. Johnson
Life of this patent
Estimating the term…
Abstract
A system for exception handling is configured to, in response to detection of an exception during a function call, search for an exception handler to handle the detected exception by unwinding a stack across a plurality of frames. A binary includes functions associated with one of a first application binary interface (ABI) or a second ABI. The stack includes a transition frame created between frames of the first ABI and the second ABI during execution of the binaries. The system is configured to detect the transition frame in the stack when encountering a change from a frame of one ABI to a frame of another ABI, and translate an interface context therebetween to handle the exception.
Claims20
A system for exception handling, the system comprising:
- an exception dispatch mechanism configured to, in response to detection of an exception during a function call, search for an exception handler to handle the detected exception by unwinding a stack across a plurality of frames, the plurality of frames including frames created by functions of a binary, the functions being of a first application binary interface (ABI) and a second ABI, the first and second ABIs having different exception handling methods, the stack including a transition frame created between frames of the first ABI and the second ABI during execution of the binary;
- a transition handler configured to detect the transition frame in the stack when encountering a change from a frame of the first ABI to a frame of the second ABI, the transition frame containing an exception handler that follows exception handling of the second ABI by translating an interface context of the first ABI to an interface context of the second ABI using information in the transition frame, wherein the information in the transition frame comprises exception handling relevant information for frames on each side of the transition frame;
- and
- an execution handler configured to translate the interface context from the first ABI to the second ABI, the exception handler of the second ABI handling the exception using the translated interface context to allow the function call to be performed, the translated interface context defining functionality to perform the function call on a host computing device operating as a native host machine.
A computerized method for exception handling, the computerized method comprising:
- searching for, in response to detection of an exception during a function call, an exception handler to handle the detected exception by unwinding a stack across a plurality of frames, the plurality of frames including a binary having functions associated with one of a first application binary interface (ABI) or a second ABI, the stack including a transition frame created between frames of the first ABI and the second ABI during execution of the binary;
- detecting the transition frame in the stack when encountering a change from a frame of the first ABI to a frame of the second ABI;
- translating an interface context of the first ABI to an interface context of the second ABI using information in the transition frame to unwind the frame of the second ABI using the translated interface context, the translated interface context defining functionality to perform the function call on a host computing device operating as a native host machine, the exception handler following exception handling of the second ABI, wherein the information in the transition frame comprises exception handling relevant information for frames on each side of the transition frame;
- and
- handling the exception with the exception handler following exception handling of the second ABI using the translated interface context.
One or more computer storage media having computer-executable instructions for exception handling that, upon execution by a processor, cause the processor to at least:
- search for, in response to detection of an exception during a function call, an exception handler to handle the detected exception by unwinding a stack across a plurality of frames, the plurality of frames including frames created by functions associated with one of a first application binary interface (ABI) or a second ABI, the stack including a transition frame created between frames of the first ABI and the second ABI during execution of the binaries;
- detect the transition frame in the stack when encountering a change from a frame of the first ABI to a frame of the second ABI;
- translate an interface context of the first ABI to an interface context of the second ABI using information in the transition frame to unwind the frame of the second ABI, the translated interface context defining functionality to perform the function call on a host computing device operating as a native host machine, the exception handler following exception handling of the second ABI, wherein the information in the transition frame comprises exception handling relevant information for frames on each side of the transition frame;
- and
- handle the exception with the exception handler following exception handling of the second ABI using the translated interface context.
Dependencies are inferred from the claim text.