mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
[gdb] Add gdbarch_dwarf2_reg_piece_offset hook
In rw_pieced_value, when reading/writing part of a register, DW_OP_piece and DW_OP_bit_piece are handled the same, but the standard tells us: - DW_OP_piece: if the piece is located in a register, but does not occupy the entire register, the placement of the piece within that register is defined by the ABI. - DW_OP_bit_piece: if the location is a register, the offset is from the least significant bit end of the register. Add a new hook gdbarch_dwarf2_reg_piece_offset that allows us to define the ABI-specific behaviour for DW_OP_piece. The default implementation of the hook is the behaviour of DW_OP_bit_piece, so there should not be any functional changes. Tested on s390x-linux. Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
@@ -829,6 +829,22 @@ allocate and return a struct value with all value attributes
|
||||
invalid=False,
|
||||
)
|
||||
|
||||
Method(
|
||||
comment="""
|
||||
For a DW_OP_piece located in a register, but not occupying the
|
||||
entire register, return the placement of the piece within that
|
||||
register as defined by the ABI.
|
||||
""",
|
||||
type="ULONGEST",
|
||||
name="dwarf2_reg_piece_offset",
|
||||
params=[
|
||||
("int", "regnum"),
|
||||
("ULONGEST", "size")
|
||||
],
|
||||
predefault="default_dwarf2_reg_piece_offset",
|
||||
invalid=False,
|
||||
)
|
||||
|
||||
Method(
|
||||
type="CORE_ADDR",
|
||||
name="pointer_to_address",
|
||||
|
||||
Reference in New Issue
Block a user