-
Notifications
You must be signed in to change notification settings - Fork 340
Don't create a swift async unwind plan when in a function prologue #2645
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
Don't create a swift async unwind plan when in a function prologue #2645
Conversation
If a swift async function does a standard ABI function call into a normal function, at the start, we will still have the caller's async register values (e.g. deref frame pointer shows us an AsyncContext address with high-nibble flags set). This patch changes SwiftLanguageRuntime to detect when we are in the middle of a function prologue, and not return an async unwind plan in that case.
@swift-ci please test |
} | ||
} | ||
|
||
if (sc.symbol) { |
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.
Shouldn't this be else if (sc.symbol)
? Or is there a reason to test function and symbol?
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'll piggyback off this question and ask: Does anyone know off hand when this call to CalculateSymbolContext
would return only one of function
/symbol
, but not the other?
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.
You're right. Function is based on debug information; Symbol is based on the raw symbol table (here's a list of symbol names and addresses). Symbol may have a prologue description based on the instruction profiler. But the line table based size is going to be the more reliable one. We use the Symbol as a backup if we couldn't find a Function.
Which order should be used: @adrian-prantl mentioned that the line table data for |
Function; Symbol.
We already use GetPrologueByteSize for |
@swift-ci please test |
Thanks for the lesson. |
…2645) * Don't create a swift async unwind plan when in a function prologue If a swift async function does a standard ABI function call into a normal function, at the start, we will still have the caller's async register values (e.g. deref frame pointer shows us an AsyncContext address with high-nibble flags set). This patch changes SwiftLanguageRuntime to detect when we are in the middle of a function prologue, and not return an async unwind plan in that case. * If Function found for $pc, don't also look at Symbol (cherry picked from commit 0734da1)
Don't create a swift async unwind plan when in a function prologue
If a swift async function does a standard ABI function call into
a normal function, at the start, we will still have the caller's
async register values (e.g. deref frame pointer shows us an
AsyncContext address with high-nibble flags set).
This patch changes SwiftLanguageRuntime to detect when we are in the
middle of a function prologue, and not return an async unwind plan
in that case.