[Dwarf-Discuss] Resend Encoding large constant values - Conclusion

Tommy Hoffner thoffner at ca.ibm.com
Tue Sep 18 07:04:54 PDT 2012


Thanks,
Got some more arguments for convincing the consumer to handle what I 
already produce :-)

Summary: 
There is no support for assuming expressions for DW_FORM_blockX in the 
standard."dwarf-discuss at lists.dwarfstd.org" 
<dwarf-discuss at lists.dwarfstd.org>, 
And since use of DW_FORM_blockX  for expressions is deprecated in Dwarf4 
by DW_FORM_exprloc, 
there shouldn't be any ambiguity any more.
As for introducing new DW_FORM_data16; with the above conclusion it would 
only be needed as an optimization,
(not having to read the size field), but as long as they are infrequent I 
can't motivate adding more sizes to the standard.
So I will not suggest any changes to the standard for this for now.

Tommy Hoffner

Compiler Backend Development
IBM Toronto Laboratory, 8200 Warden Ave, Markham, Ontario, Canada, L6G 1C7
Tel:  905-413-2036    Tie:  313-2036    Internet:  thoffner at ca.ibm.com

John DelSignore <John.DelSignore at roguewave.com> wrote on 2012/09/17 
05:21:44 PM:

> From: John DelSignore <John.DelSignore at roguewave.com>
> To: Cary Coutant <ccoutant at google.com>
> Cc: Tommy Hoffner/Toronto/IBM at IBMCA, "dwarf-
> discuss at lists.dwarfstd.org" <dwarf-discuss at lists.dwarfstd.org>
> Date: 2012/09/17 05:25 PM
> Subject: Re: [Dwarf-Discuss] Resend Encoding large constant values
> 
> Hi Cary,
> 
> In a previous message, you asked:
> 
> > Isn't DW_FORM_block* the form you're looking for?
> 
> And in the message below, you identified that the standard already 
> allows the block forms for constants, and the values are represented
> in "target architecture" format. So yes, this is exactly what I was 
> looking for.
> 
> I dug through the TotalView sources and it already treats 
> DW_FORM_block* this way, so if a compiler were to produce it, we'd 
> do the "right thing". The sad thing is that I probably knew all of 
> this at one point, and just forgot about it.
> 
> Cheers, John D.
> 
> 
> Cary Coutant wrote:
> > Sorry, forgot to reply-all...
> > 
> > 
> > ---------- Forwarded message ----------
> > From: Cary Coutant <ccoutant at google.com>
> > Date: Mon, Sep 17, 2012 at 1:36 PM
> > Subject: Re: [Dwarf-Discuss] Resend Encoding large constant values
> > To: Tommy Hoffner <thoffner at ca.ibm.com>
> > 
> > 
> >> Giving me a 16 byte conhstant. My attempt on encoding this was
> >>
> >> < 6>< 69><code: 6> DW_TAG_constant DW_CHILDREN_no
> >> < 72> DW_AT_name DW_FORM_string
> >> < 74> DW_AT_const_value DW_FORM_block1
> >>
> >> < 76> DW_AT_decl_file DW_FORM_data1
> >> < 78> DW_AT_decl_line DW_FORM_data1
> >> < 80> DW_AT_type DW_FORM_ref4
> >>
> >> The problem is that the standard section above doesn't mention
> >> DW_FORM_block1 as something that can contain a constant.
> > 
> > Sure it does. Section 4.1:
> > 
> > 10. A DW_AT_const_value attribute for an entry describing a variable
> > or formal parameter whose value is constant and not represented by an
> > object in the address space of the program, or an entry describing a
> > named constant. (Note that such an entry does not have a location
> > attribute.) The value of this attribute may be a string or any of the
> > constant data or data block forms, as appropriate for the
> > representation of the variable’s value. The value is the actual
> > constant value of the variable, represented as it would be on the
> > target architecture.
> > 
> > This explicitly mentions the block forms as appropriate for 
> DW_AT_const_value.
> > 
> >> It does however
> >> say:
> >>
> >> "In all forms, the length is the number of information bytes that 
follow.
> >> The information bytes may contain any mixture of relocated (or 
relocatable)
> >> addresses, references to other debugging information entries or 
> data bytes."
> >>
> >> However since all the data types above can be expressed as 
expressions, I
> >> seen tools assuming that DW_FORM_block always contains an expression.
> > 
> > Bad tools. Before version 4, DWARF encoded location expressions in
> > DW_FORM_block, but only in contexts where a location was expected. For
> > DW_AT_const_value, the contents of a DW_FORM_block should be
> > interpreted as the constant value itself. In DWARF-4, we now have
> > DW_FORM_exprloc for that purpose, and the use of DW_FORM_block for a
> > location expression is deprecated.
> > 
> >> So I think the DW_FORM_block1 above should contain the raw floating 
point
> >> data (apart from the size field). While a number of tools expect an
> >> expression evaluating to the raw bit pattern (?) for the 16 byte data 
we
> >> want.
> > 
> > Yes, you have it right. The tools you refer to are wrong, if, in fact,
> > they're applying that interpretation to DW_FORM_block* for a
> > DW_AT_const_value attribute.
> > 
> > -cary
> > _______________________________________________
> > Dwarf-Discuss mailing list
> > Dwarf-Discuss at lists.dwarfstd.org
> > http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org
> > 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/attachments/20120918/62d01a19/attachment-0002.htm>


More information about the Dwarf-Discuss mailing list