Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/wasm/wasm-debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ struct LineState {
// XXX these two should be just prologue, epilogue?
bool prologueEnd = false;
bool epilogueBegin = false;
bool endSequence = false;

LineState(const LineState& other) = default;
LineState(const llvm::DWARFYAML::LineTable& table)
Expand All @@ -140,6 +141,7 @@ struct LineState {
break;
}
case llvm::dwarf::DW_LNE_end_sequence: {
endSequence = true;
return true;
}
case llvm::dwarf::DW_LNE_set_discriminator: {
Expand Down Expand Up @@ -299,14 +301,18 @@ struct LineState {
Fatal() << "eb";
}
if (useSpecial) {
// Emit a special, which ends a sequence automatically.
// Emit a special, which emits a line automatically.
// TODO
} else {
// End the sequence manually.
// len = 1 (subopcode)
newOpcodes.push_back(makeItem(llvm::dwarf::DW_LNE_end_sequence, 1));
// Reset the state.
*this = LineState(table);
// Emit the line manually.
if (endSequence) {
// len = 1 (subopcode)
newOpcodes.push_back(makeItem(llvm::dwarf::DW_LNE_end_sequence, 1));
// Reset the state.
*this = LineState(table);
} else {
newOpcodes.push_back(makeItem(llvm::dwarf::DW_LNS_copy));
}
}
}

Expand Down
Loading