[Dwarf-Discuss] Register kinds
Mon Nov 1 12:55:40 GMT 2010
The register numbers are positive integers.
Registers 0 to 31 encode in a single byte of a DW_OP_reg or DW_OP_breg,
beyond that Dwarf uses ULEB128 little-endian representation to compact
the encoding, so numbers up to 127 take two bytes and numbers up to
16383 take three bytes with DW_OP_regx or DW_OP_bregx opcodes.
If there's an even distribution of usage you might try spreading the
'kind' field over bits 7..6 and 14..13 and 21..20.
Since you don't state how many kinds you intend, the Dwarf producer
can't predict which kinds are most common nor how many references there
will be to each register it's hard to think of a scheme to get anywhere
near Huffman-like density. Using the register numbers to index into
another table shared over all compilation units and sorted by frequency
is a tempting extension, especially if that table also provided the
mapping to ABI names and bit-sizes of registers. Are you in control of
the compiler and debugger?
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dwarf-discuss