[lldb/DWARF] Add support for pre-standard GNU call site attributes

Summary:
The code changes are very straight-forward -- just handle both DW_AT_GNU
and DW_AT_call versions of all tags and attributes. There is just one
small gotcha: in the GNU version, DW_AT_low_pc was used both for the
"return pc" and the "call pc" values, depending on whether the tag was
describing a tail call, while the official scheme uses different
attributes for the two things.

Reviewers: vsk, dblaikie

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D80519
This commit is contained in:
Pavel Labath
2020-05-25 14:37:04 +02:00
parent c3902b62e6
commit bddd288826
32 changed files with 123 additions and 96 deletions

View File

@@ -396,6 +396,7 @@ static offset_t GetOpcodeDataSize(const DataExtractor &data,
return offset - data_offset;
}
case DW_OP_GNU_entry_value:
case DW_OP_entry_value: // 0xa3 ULEB128 size + variable-length block
{
uint64_t subexpr_len = data.GetULEB128(&offset);
@@ -2522,6 +2523,7 @@ bool DWARFExpression::Evaluate(
stack.push_back(Scalar(value));
} break;
case DW_OP_GNU_entry_value:
case DW_OP_entry_value: {
if (!Evaluate_DW_OP_entry_value(stack, exe_ctx, reg_ctx, opcodes, offset,
error_ptr, log)) {