From paul.robinson  Thu Jun 14 22:40:23 2018
From: paul.robinson (paul.robinson@sony.com)
Date: Thu, 14 Jun 2018 22:40:23 +0000
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
Message-ID: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>

I have been working on adding DWARF 5 support to LLVM, and some of
that support requires some assembler syntax tweaks.  It has been
suggested that I publicize those tweaks outside of the LLVM world, 
and this list seems like the most likely place to find the people 
who would be most interested in agreeing on a common syntax.  I'll
assume people know or can easily look up the DWARF features I'm
talking about.

The two line-table features that require assembler syntax tweaks are:
(a) in the file table, adding the MD5 checksum of the source file;
(b) adding the "root" file explicitly to the file table (aka "file 0").

The LLVM assembler believes that the existing syntax for the DWARF form
of the .file directive is:
    .file filenumber [ "directory" ] "path"
where filenumber is a positive number >= 1 to be used by the .loc
directives to identify the source file for instructions.

I propose to add a new optional clause to the .file directive, like so:

    .file filenumber [ "directory" ] "path" [ md5 checksum ]

where md5 is a keyword and checksum is the integer checksum,
typically expressed as a hex 128-bit value.

If all .file directives provide an md5 checksum, then the assembler
will put that checksum into the DWARF 5 file table.  (If the 
compiler is compiling a preprocessed file, it won't necessarily be
able to provide an MD5 checksum of the original file. This is much
the same argument against having the assembler compute the MD5
checksum itself; it doesn't know that it's actually the same file.)

As a second tweak, I propose that the filenumber may be 0, in which
case the directive specifies the root file and those parameters are 
used for file entry #0.  If no ".file 0" is seen, then the assembler 
will use file #1 as the zeroth file-table entry (so that file will 
be described twice, using both file #0 and file #1).

This is all implemented in LLVM trunk currently, so there are two
questions to ask:
(1) Has your assembler implemented the necessary features differently?
(2) If not, are you okay with the changes I described above?

Thanks,
--paulr



From nickc@redhat.com  Fri Jun 15 10:17:47 2018
From: nickc@redhat.com (Nick Clifton)
Date: Fri, 15 Jun 2018 11:17:47 +0100
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
In-Reply-To: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>
References: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>
Message-ID: <ea5a8824-5af6-91c6-b6ad-655b8c3cbeda@redhat.com>

Hi Paul,

> I have been working on adding DWARF 5 support to LLVM, and some of
> that support requires some assembler syntax tweaks.  It has been
> suggested that I publicize those tweaks outside of the LLVM world, 
> and this list seems like the most likely place to find the people 
> who would be most interested in agreeing on a common syntax.

I think that it would also be wise to include the binutils project
(binutils at sourceware.org) as they are responsible for the GNU 
Assembler (gas). 

> I propose to add a new optional clause to the .file directive, like so:
> 
>     .file filenumber [ "directory" ] "path" [ md5 checksum ]
> 
> where md5 is a keyword and checksum is the integer checksum,
> typically expressed as a hex 128-bit value.
> 
> If all .file directives provide an md5 checksum, then the assembler
> will put that checksum into the DWARF 5 file table.

If there are discrepancies in the md5 checksums, what should the assembler do ?

Cheers
  Nick




From paul.robinson  Fri Jun 15 11:57:41 2018
From: paul.robinson (paul.robinson@sony.com)
Date: Fri, 15 Jun 2018 11:57:41 +0000
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
In-Reply-To: <ea5a8824-5af6-91c6-b6ad-655b8c3cbeda@redhat.com>
References: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>
 <ea5a8824-5af6-91c6-b6ad-655b8c3cbeda@redhat.com>
Message-ID: <E3B07FDB86BFF041819DC057DEED8FEA0134156632@USCULXMSG13.am.sony.com>

cc binutils

> -----Original Message-----
> From: Nick Clifton [mailto:nickc at redhat.com]
> Sent: Friday, June 15, 2018 6:18 AM
> To: Robinson, Paul; dwarf-discuss at lists.dwarfstd.org
> Subject: Re: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
> 
> Hi Paul,
> 
> > I have been working on adding DWARF 5 support to LLVM, and some of
> > that support requires some assembler syntax tweaks.  It has been
> > suggested that I publicize those tweaks outside of the LLVM world,
> > and this list seems like the most likely place to find the people
> > who would be most interested in agreeing on a common syntax.
> 
> I think that it would also be wise to include the binutils project
> (binutils at sourceware.org) as they are responsible for the GNU
> Assembler (gas).
> 
> > I propose to add a new optional clause to the .file directive, like so:
> >
> >     .file filenumber [ "directory" ] "path" [ md5 checksum ]
> >
> > where md5 is a keyword and checksum is the integer checksum,
> > typically expressed as a hex 128-bit value.
> >
> > If all .file directives provide an md5 checksum, then the assembler
> > will put that checksum into the DWARF 5 file table.
> 
> If there are discrepancies in the md5 checksums, what should the assembler
> do ?

In LLVM, I have the assembler issue a warning if it sees inconsistent use
of the md5 clause.  It's not an error, because I do see it happen when
the compiler is reading a preprocessed file, and the assembler can't tell
the difference between something the compiler produced and a mistake made
by human coding.

Thanks,
--paulr

> 
> Cheers
>   Nick
> 
> 



From dblaikie@gmail.com  Fri Jun 15 19:25:23 2018
From: dblaikie@gmail.com (David Blaikie)
Date: Fri, 15 Jun 2018 12:25:23 -0700
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
In-Reply-To: <E3B07FDB86BFF041819DC057DEED8FEA0134156632@USCULXMSG13.am.sony.com>
References: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>
 <ea5a8824-5af6-91c6-b6ad-655b8c3cbeda@redhat.com>
 <E3B07FDB86BFF041819DC057DEED8FEA0134156632@USCULXMSG13.am.sony.com>
Message-ID: <CAENS6Euh+ibWW90qPv5z2cBn+c1+6G9akQH--iTOJJWfeoUrUQ@mail.gmail.com>

FWIW - if we're talking about assembly extensions, another one LLVM could
use (it currently is one of the few things where Clang's integrated
assembler can emit object code that can't be represented via textual
assembly output) is the ability to express multiple line tables in a single
assembly file. LLVM uses this in LTO situations, where a single object file
contains the code to more than one source file.

On Fri, Jun 15, 2018 at 4:57 AM Paul Robinson via Dwarf-Discuss <
dwarf-discuss at lists.dwarfstd.org> wrote:

> cc binutils
>
> > -----Original Message-----
> > From: Nick Clifton [mailto:nickc at redhat.com]
> > Sent: Friday, June 15, 2018 6:18 AM
> > To: Robinson, Paul; dwarf-discuss at lists.dwarfstd.org
> > Subject: Re: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
> >
> > Hi Paul,
> >
> > > I have been working on adding DWARF 5 support to LLVM, and some of
> > > that support requires some assembler syntax tweaks.  It has been
> > > suggested that I publicize those tweaks outside of the LLVM world,
> > > and this list seems like the most likely place to find the people
> > > who would be most interested in agreeing on a common syntax.
> >
> > I think that it would also be wise to include the binutils project
> > (binutils at sourceware.org) as they are responsible for the GNU
> > Assembler (gas).
> >
> > > I propose to add a new optional clause to the .file directive, like so:
> > >
> > >     .file filenumber [ "directory" ] "path" [ md5 checksum ]
> > >
> > > where md5 is a keyword and checksum is the integer checksum,
> > > typically expressed as a hex 128-bit value.
> > >
> > > If all .file directives provide an md5 checksum, then the assembler
> > > will put that checksum into the DWARF 5 file table.
> >
> > If there are discrepancies in the md5 checksums, what should the
> assembler
> > do ?
>
> In LLVM, I have the assembler issue a warning if it sees inconsistent use
> of the md5 clause.  It's not an error, because I do see it happen when
> the compiler is reading a preprocessed file, and the assembler can't tell
> the difference between something the compiler produced and a mistake made
> by human coding.
>
> Thanks,
> --paulr
>
> >
> > Cheers
> >   Nick
> >
> >
>
> _______________________________________________
> 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/pipermail/dwarf-discuss-dwarfstd.org/attachments/20180615/f3fa5804/attachment.html>


From nickc@redhat.com  Mon Jun 18 14:00:51 2018
From: nickc@redhat.com (Nick Clifton)
Date: Mon, 18 Jun 2018 15:00:51 +0100
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
In-Reply-To: <E3B07FDB86BFF041819DC057DEED8FEA0134156632@USCULXMSG13.am.sony.com>
References: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>
 <ea5a8824-5af6-91c6-b6ad-655b8c3cbeda@redhat.com>
 <E3B07FDB86BFF041819DC057DEED8FEA0134156632@USCULXMSG13.am.sony.com>
Message-ID: <b8691b16-9380-7860-ec58-2e1a2a8b32dc@redhat.com>

Hi Paul,

>>> I propose to add a new optional clause to the .file directive, like so:
>>>
>>>     .file filenumber [ "directory" ] "path" [ md5 checksum ]

This suggestion is fine with me.  (And the file 0 enhancement).

Are you offering to provide an implementation ?

It would help if you could file an enhancement request in the FSF binutils
bugzilla system, so that we can track any further correspondence on this
issue.

Cheers
  Nick



From paul.robinson  Mon Jun 18 17:05:30 2018
From: paul.robinson (paul.robinson@sony.com)
Date: Mon, 18 Jun 2018 17:05:30 +0000
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
In-Reply-To: <b8691b16-9380-7860-ec58-2e1a2a8b32dc@redhat.com>
References: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>
 <ea5a8824-5af6-91c6-b6ad-655b8c3cbeda@redhat.com>
 <E3B07FDB86BFF041819DC057DEED8FEA0134156632@USCULXMSG13.am.sony.com>
 <b8691b16-9380-7860-ec58-2e1a2a8b32dc@redhat.com>
Message-ID: <E3B07FDB86BFF041819DC057DEED8FEA0134169346@USCULXMSG13.am.sony.com>



> -----Original Message-----
> From: Nick Clifton [mailto:nickc at redhat.com]
> Sent: Monday, June 18, 2018 10:01 AM
> To: Robinson, Paul; dwarf-discuss at lists.dwarfstd.org
> Cc: binutils at sourceware.org
> Subject: Re: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
> 
> Hi Paul,
> 
> >>> I propose to add a new optional clause to the .file directive, like
> so:
> >>>
> >>>     .file filenumber [ "directory" ] "path" [ md5 checksum ]
> 
> This suggestion is fine with me.  (And the file 0 enhancement).

Thanks!

> Are you offering to provide an implementation ?

I implemented it in LLVM.  I am not offering to implement it in GNU binutils
as I can't say I know my way around there, or know the current state of
gcc/binutils support for DWARF v5 in general.

> It would help if you could file an enhancement request in the FSF binutils
> bugzilla system, so that we can track any further correspondence on this
> issue.

Sure.  Is that sourceware.org/bugzilla?  It doesn't seem to like the
account I created for gcc.gnu.org/bugzilla a few years ago, but maybe they 
are separate?  Private reply is fine.
Thanks,
--paulr

> 
> Cheers
>   Nick
> 



From paul.robinson  Mon Jun 18 17:29:06 2018
From: paul.robinson (paul.robinson@sony.com)
Date: Mon, 18 Jun 2018 17:29:06 +0000
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
In-Reply-To: <E3B07FDB86BFF041819DC057DEED8FEA0134169346@USCULXMSG13.am.sony.com>
References: <E3B07FDB86BFF041819DC057DEED8FEA0134155D47@USCULXMSG13.am.sony.com>
 <ea5a8824-5af6-91c6-b6ad-655b8c3cbeda@redhat.com>
 <E3B07FDB86BFF041819DC057DEED8FEA0134156632@USCULXMSG13.am.sony.com>
 <b8691b16-9380-7860-ec58-2e1a2a8b32dc@redhat.com>
 <E3B07FDB86BFF041819DC057DEED8FEA0134169346@USCULXMSG13.am.sony.com>
Message-ID: <E3B07FDB86BFF041819DC057DEED8FEA01341693DC@USCULXMSG13.am.sony.com>

Filed as bug #23310 at sourceware.org/bugzilla.
--paulr

> -----Original Message-----
> From: Dwarf-Discuss [mailto:dwarf-discuss-bounces at lists.dwarfstd.org] On
> Behalf Of Paul Robinson via Dwarf-Discuss
> Sent: Monday, June 18, 2018 1:06 PM
> To: nickc at redhat.com; dwarf-discuss at lists.dwarfstd.org
> Cc: binutils at sourceware.org
> Subject: Re: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
> 
> 
> 
> > -----Original Message-----
> > From: Nick Clifton [mailto:nickc at redhat.com]
> > Sent: Monday, June 18, 2018 10:01 AM
> > To: Robinson, Paul; dwarf-discuss at lists.dwarfstd.org
> > Cc: binutils at sourceware.org
> > Subject: Re: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
> >
> > Hi Paul,
> >
> > >>> I propose to add a new optional clause to the .file directive, like
> > so:
> > >>>
> > >>>     .file filenumber [ "directory" ] "path" [ md5 checksum ]
> >
> > This suggestion is fine with me.  (And the file 0 enhancement).
> 
> Thanks!
> 
> > Are you offering to provide an implementation ?
> 
> I implemented it in LLVM.  I am not offering to implement it in GNU
> binutils
> as I can't say I know my way around there, or know the current state of
> gcc/binutils support for DWARF v5 in general.
> 
> > It would help if you could file an enhancement request in the FSF
> binutils
> > bugzilla system, so that we can track any further correspondence on this
> > issue.
> 
> Sure.  Is that sourceware.org/bugzilla?  It doesn't seem to like the
> account I created for gcc.gnu.org/bugzilla a few years ago, but maybe they
> are separate?  Private reply is fine.
> Thanks,
> --paulr
> 
> >
> > Cheers
> >   Nick
> >
> 
> _______________________________________________
> Dwarf-Discuss mailing list
> Dwarf-Discuss at lists.dwarfstd.org
> http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org


From apovalyaev@gmail.com  Mon Jun 18 17:37:05 2018
From: apovalyaev@gmail.com (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstCw0LvRj9C10LI=?=)
Date: Mon, 18 Jun 2018 17:37:05 +0000
Subject: [Dwarf-Discuss] Asm syntax for DWARF 5 line table info
Message-ID: <CAGT+J5xMjd+Tb=rgg-qG9KGxYmOUOsQcKUmaKkOFDP7rMcetpA@mail.gmail.com>

Hi Guys,

I can see there is a discussion to add/or not a MD5 checksum attribute.

Please take a look at
http://dwarfstd.org/ShowIssue.php?issue=171216.1

It might add some value to the discussion also.

Respectfully,
Aleksandr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/attachments/20180618/65b9df6c/attachment.html>


