Skip to content
Merged
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: 18 additions & 0 deletions src/write/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ impl Expression {
self.operations.push(Operation::CallRef(entry));
}

/// Add a `DW_OP_variable_value` operation to the expression.
pub fn op_variable_value(&mut self, entry: DebugInfoRef) {
self.operations.push(Operation::VariableValue(entry));
}

/// Add a `DW_OP_convert` or `DW_OP_GNU_convert` operation to the expression.
///
/// `base` is the DIE of the base type, or `None` for the generic type.
Expand Down Expand Up @@ -1387,6 +1392,13 @@ mod tests {
offset: read::DieReference::DebugInfoRef(x.debug_info_offset),
},
),
(
&|x| x.op_variable_value(reference),
Operation::VariableValue(reference),
&|x| read::Operation::VariableValue {
offset: x.debug_info_offset,
},
),
(
&|x| x.op(constants::DW_OP_form_tls_address),
Operation::Simple(constants::DW_OP_form_tls_address),
Expand Down Expand Up @@ -1495,6 +1507,11 @@ mod tests {
base_type: x.entry_offset,
},
),
(
&|x| x.op(constants::DW_OP_GNU_uninit),
Operation::Simple(constants::DW_OP_GNU_uninit),
&|_| read::Operation::Uninitialized,
),
(
&|x| x.op_wasm_local(1000),
Operation::WasmLocal(1000),
Expand Down Expand Up @@ -1610,6 +1627,7 @@ mod tests {
*entry = *convert_entry_id;
}
Operation::CallRef(entry)
| Operation::VariableValue(entry)
| Operation::ImplicitPointer { entry, .. } => {
*entry = DebugInfoRef::Entry(convert_unit_id, *convert_entry_id);
}
Expand Down