[Dwarf-discuss] Referring to the stdin 'file' in .debug_macinfo sections

Matthew Gretton-Dann Matthew.Gretton-Dann
Thu Apr 21 13:23:55 GMT 2005


Hi,

(In the following discussion stdin should be taken to mean any means of
specifying input to the compiler other than via a named disk file).

Section 6.3.2 of the DWARF3 standard states:

        ...If the base source file for a compilation is submitted to the
        compiler via some means other than via a named disk file (e.g.
        via the standard input stream on a UNIX system) the the compiler
        should still produce this matched pair of DW_MACINFO_start_file
        and DW_MACINFO_end_file entries for the base source file,
        however, the file name indicated (indirectly) by the
        DW_MACINFO_start_file entry of the pair should designate a line
        number information file name entry consisting of a null string.

What does the DWARF standard mean by the phrase 'a null string'?

My initial interpretation is that this means a string of length zero. 
However, section 6.2.4 item 11 (file_names) indicates that
for the table of files:
        
        ...The last entry is followed by a single byte.

This means that my interpretation of 'a null string' means that the
file_names entry will get misinterpreted as the end of the file_names
array and confuse the .debug_line state machine.

If my understanding is correct above then there are three options open
to us:

     1. Use File ID 0 as a 'special' ID representing stdin
     2. Use File ID (last + 1) as a 'special' ID representing stdin
     3. Use DW_LNE_define_file to define a file with a zero-length null
        name.

Of these the third option is (the only?) one which meets with the
current specification's requirements.

Have I interpreted the standard correctly?  If so should option 1 or 2
be made legal (I would suggest not)?  In any event does the standard
need some clarification?

Thanks,

Matt

-- 
Matthew Gretton-Dann - Software Engineer
Compiler Tools Group - Development Systems
ARM Ltd
110 Fulbourn Rd
Cambridge
CB1 9NJ
UK
Phone: +44 1223 406103

This e-mail message is intended for the addressee(s) only and may
contain information that is the property of, and/or subject to a
confidentiality agreement between the intended recipient(s), their
organisation and/or the ARM Group of Companies. If you are not an
intended recipient of this e-mail message, you should not read, copy,
forward or otherwise distribute or further disclose the information in
it; misuse of the contents of this e-mail message may violate various
laws in your state, country or jurisdiction. If you have received this
e-mail message in error, please contact the originator of this e-mail
message via e-mail and delete all copies of this message from your
computer or network. Thank you




More information about the Dwarf-discuss mailing list