[Dwarf-Discuss] Help with debug info for fixed-point data types

Robinson, Paul T NonStop paul.t.robinson@hp.com
Tue Nov 6 16:05:03 GMT 2007


I'm not familiar with "long fract (S.39) and accum (S7.31)" but since
you say they both are 8 bytes I assume those are bit counts; long fract
is a 39-bit signed fractional part, accum is a signed value with 7 bits
of integer part and 31 bits of fractional part.  In that case I'd expect
to see long fract with DW_AT_binary_scale = -39 and accum with 
DW_AT_binary_scale = -31.

Certainly the DW_AT_binary_scale or DW_AT_decimal_scale attributes
should be considered as part of the type, as they provide information
about how to interpret the content of the data item (as opposed to
other attributes that, say, tell you where to find the data item).
If you were going to do something like assign a long fract value to an
accum item, you would need to compensate for the different scales.


-----Original Message-----
From: dwarf-discuss-bounces@lists.dwarfstd.org
[mailto:dwarf-discuss-bounces at lists.dwarfstd.org] On Behalf Of Rohit
Arul Raj
Sent: Tuesday, November 06, 2007 5:28 AM
To: Ron Brender
Cc: dwarf-discuss at lists.dwarfstd.org
Subject: Re: [Dwarf-Discuss] Help with debug info for fixed-point data

Hi Ron,

>From the debug information generated, i need to differentiate between
different fixed point types that have same size.
For e.g. the following data types long fract (S.39) and accum (S7.31)
have same size (8 bytes).

Is there any way to find out from the debug information which type it
is if their sizes are same?

>From the manual, i assumed that DW_AT_binary_scale ,DW_AT_digit_count
can be used for this purpose. But i was not sure how to encode this

Can you suggest any way to overcome this issue?


On Nov 6, 2007 6:44 PM, Ron Brender <ron.brender at charter.net> wrote:
> Shafi,
> I don't understand--is there a question here? What do you need help
> I assume you have the DWARF V3 Standard of December 2005, right?
> If there is a question about how to interpret the DWARF standard, this
> list can help. If there is a question about patches to support fixed
> point in gdb, this list is not a good resource.
> Ron
> p.s. For binary fixed point I would not expect you to need
> DW_AT_digit_count at all. That is only relevant for numeric string and
> packed decimal types.
> ---------------------
> Rohit Arul Raj wrote:
> > Hello all,
> >
> > I have implemented fixed point data types in gcc-4.1.1 by
> > incorporating the patches sent out in the gcc patches mailing list.
> > debug fixed-point types, as per the dwarf manual we may need the
> > following info as follows.
> > DW_AT_binary_scale : binary scale factor for fixed-point type.
> > DW_AT_digit_count : digit count for packed decimal or numeric string
> >
> > For a fixed point data type of format s7.15 how to encode the
> > information for the format into the following information
> >
> > Format : s7.15
> > DW_AT_binary_scale :
> > DW_AT_digit_count :
> >
> >
> > Format : s.31
> > DW_AT_binary_scale :
> > DW_AT_digit_count :
> >
> >
> > Any help would be appreciated.
> >
> > Regards,
> > Shafi
Dwarf-Discuss mailing list
Dwarf-Discuss at lists.dwarfstd.org

More information about the Dwarf-discuss mailing list