[Dwarf-Discuss] dwarf stack operator for byte swap.

Jakub Jelinek jakub@redhat.com
Fri Nov 8 08:14:57 GMT 2019

On Fri, Nov 08, 2019 at 06:51:52AM +0000, Chirag Patel via Dwarf-Discuss wrote:
> Proposed changes to DWARF
> ---------------------------
> Special Operation
> Addition
> <n> DW_OP_byte_swap
>                The DW_OP_byte_swap operation pops the top stack entry, byte swaps the value
>                and pushes back the swapped value on the dwarf stack.
>                e.g. so 0x12345678 will become 0x78563412, useful to change endianity of raw
>                data.

With the typed DWARF stack it is clear, the types have well defined size,
but when using the most common values, where the values have generic type,
does that mean DW_OP_byte_swap there is bswap64 if address is 64-bit, or
bswap32 if address is 32-bit, or for 16-bit addresses bswap16 etc.?


More information about the Dwarf-discuss mailing list