-
Notifications
You must be signed in to change notification settings - Fork 786
Debug info handling for new EH try-catch #3496
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
84a34aa
4990843
af57d4e
a211268
c1cc754
3446714
4ffc993
40276eb
3cfaf96
a9d679d
8b11e5f
2797834
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 |
---|---|---|
|
@@ -915,8 +915,9 @@ void WasmBinaryWriter::writeDebugLocationEnd(Expression* curr, Function* func) { | |
} | ||
} | ||
|
||
void WasmBinaryWriter::writeExtraDebugLocation( | ||
Expression* curr, Function* func, BinaryLocations::DelimiterId id) { | ||
void WasmBinaryWriter::writeExtraDebugLocation(Expression* curr, | ||
Function* func, | ||
size_t id) { | ||
if (func && !func->expressionLocations.empty()) { | ||
binaryLocations.delimiters[curr][id] = o.size(); | ||
} | ||
|
@@ -2836,13 +2837,30 @@ BinaryConsts::ASTNodes WasmBinaryBuilder::readExpression(Expression*& curr) { | |
} | ||
break; | ||
case BinaryConsts::Else: | ||
case BinaryConsts::Catch: { | ||
curr = nullptr; | ||
continueControlFlow(BinaryLocations::Else, startPos); | ||
break; | ||
case BinaryConsts::Catch: | ||
curr = nullptr; | ||
continueControlFlow(BinaryLocations::Catch, startPos); | ||
if (DWARF && currFunction) { | ||
assert(!controlFlowStack.empty()); | ||
auto currControlFlow = controlFlowStack.back(); | ||
BinaryLocation delimiterId; | ||
// Else and CatchAll have the same binary ID, so differentiate them | ||
// using the control flow stack. | ||
static_assert(BinaryConsts::CatchAll == BinaryConsts::Else, | ||
"Else and CatchAll should have identical codes"); | ||
if (currControlFlow->is<If>()) { | ||
delimiterId = BinaryLocations::Else; | ||
} else { | ||
// Both Catch and CatchAll can simply append to the list as we go, as | ||
// we visit them in the right order in the binary, and like the binary | ||
// we store the CatchAll at the end. | ||
delimiterId = | ||
currFunction->delimiterLocations[currControlFlow].size(); | ||
} | ||
currFunction->delimiterLocations[currControlFlow][delimiterId] = | ||
startPos - codeSectionLocation; | ||
} | ||
break; | ||
} | ||
case BinaryConsts::RefNull: | ||
visitRefNull((curr = allocator.alloc<RefNull>())->cast<RefNull>()); | ||
break; | ||
|
@@ -3102,18 +3120,6 @@ void WasmBinaryBuilder::startControlFlow(Expression* curr) { | |
} | ||
} | ||
|
||
void WasmBinaryBuilder::continueControlFlow(BinaryLocations::DelimiterId id, | ||
BinaryLocation pos) { | ||
if (DWARF && currFunction) { | ||
assert(!controlFlowStack.empty()); | ||
auto currControlFlow = controlFlowStack.back(); | ||
// We are called after parsing the byte, so we need to subtract one to | ||
// get its position. | ||
Comment on lines
-3110
to
-3111
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. This is old code, but what does this subtracting one mean? Where do we do it? 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. Oh, I think the comment about subtracting one was just stale. A refactoring I did must have removed it, and forgot to update the comment... |
||
currFunction->delimiterLocations[currControlFlow][id] = | ||
pos - codeSectionLocation; | ||
} | ||
} | ||
|
||
void WasmBinaryBuilder::pushBlockElements(Block* curr, | ||
Type type, | ||
size_t start) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.