Re: [PATCH 2/4] Add a dwarf unit type to represent 24 bit values.

John Darrington
2018-09-28T16:03:58Z

On Thu, Sep 27, 2018 at 01:53:35PM -0400, Simon Marchi wrote:

After a short discussion with John on IRC, what I understand is that the
debug info he is dealing with encodes the 24-bit addresses on 32-bits,
with the most significant byte equal to zero. Therefore that revised
patch looks ok to me. I would just ask you to add a comment explaining
that this "case" exists for producer XYZ on S12Z, which encodes 24 bit
addresses on 32 bits. Maybe that in the future somebody will stumble on
a producer that encodes 24 bit addresses on 24 bits. Having an
explanation for why things are the way they are will help.

When I look at the situation in more detail a number of things are
apparent:

1. The dwarf .frame_debug CFI information does indeed code these values
as 32 bits.

2. This would seem to contradict the dwarf 2.0 standard which says they are
"addressing-unit sized values".

3. objdump expects these values to be 24 bits.

4. However readelf expects them to be 32 bits.

5. Notwithstanding the above, the produced dwarf which I have, contains
lots of FDE entries, with lots of CFIs. However the contents of all
CFIs are empty. Consequently it's of little use.

Given the above, I think the best course of action is to do nothing, on
this point.

So I'll do without a dwarf unwinder until there's a producer which
actually produces something useful.

J'