[Dwarf-discuss] Encoding fixed-point types

Todd Allen todd.allen
Tue Jun 28 09:59:07 GMT 2005

On Tue, Jun 28, 2005 at 02:38:09AM -0400, Paul Hilfinger wrote:
> The Ada language provides fixed-point types, defined to represent a set
> of rational numbers consisting of a lower bound added to multiples
> of some fixed real increment or delta.   They are sometimes called
> scaled integers, since their representation typically consists of an integer
> representing a multiple of the fixed delta.  
> It appears that at the moment, Dwarf provides no way to represent such
> types.  Ideally, we would like to propose the addition of a standard
> DW_AT_scaling attribute.  Failing that, we'd appreciate any advice on
> the right formulation for a vendor-supplied attribute.
> The tricky part is that this particular attribute does not lend itself to
> representation by a single integer.  A ratio of two integers would work, 
> but that would seem to require two attributes, which seems inelegant.  
> My only other thought is a string containing a fraction, as in
> "1/1024".  That does the job, although it seems kludgy.  

This issue was addressed recently by the Dwarf 3 Workgroup.  Although
the issue was titled "Cobol Data Types".  The COBOL additions were
augmented slightly with a DW_AT_small attribute to support Ada.  See
the following issue for details:


The CPQ's have been removed from all the attributes and definitions.
They were a remnant from when this was a Compaq specification.

The additions there don't really support a rational small.  At the time we
were working on the issue, the only Ada vendor involved was Concurrent, and
we didn't feel the need for it.  But if you do, I would suggest that you use
the DW_AT_small and then define something like a new DW_TAG_rational_constant
with DW_AT_numerator and DW_AT_denominator.

Also, I'd like to mention that we at Concurrent have a reasonably extensive
set of vendor extensions for Ada.  We proposed making it available for
inclusion into Dwarf 3 several years ago, but at that time, there were no
other Ada vendors involved in Dwarf 3, and so there was no interest.
Actually, we also made an early draft available to Gary Funck in '94, who I
believe was working on GNAT's debug facilities then.  He indicated that GNAT
was going a different route with separate debug tables outside the normal
debug formats.  Anyway, recently, we became aware that DDCI has a competing
set of vendor extensions.  If, from your recent involvement on the Dwarf
mailing lists, we can assume that GNAT has defined or is interested in
defining yet another set of extensions for Ada, perhaps it would be wise for
all of us to coordinate.

Todd Allen
Concurrent Computer Corporation

More information about the Dwarf-discuss mailing list