support '# line "file" flags' and '# 0 "" 2'

Alexandre Oliva aoliva@redhat.com
Wed Mar 7 07:12:00 GMT 2007
Hi,

In http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00168.html, I proposed
a patch to enable GCC to let the assembler know about source line
numbers in asm statements.  It requires some syntax for the assembler
to return to the physical file and line number after temporarily
switching to a different file.

To this end, I've stopped breaking '# <line> "file"' up into separate
.appline and .appfile directives, which corrupted physical line
numbering, introducing .linefile (because .line was already taken in
some back ends).

I've also added support for preprocessor flags added after the
file name, although they aren't very used for much.

The only current use is to check that '# 0 "" 2' is to be interpreted
as returning to the physical file name and line number.

It doesn't check any inclusion stack to this end, although in theory
it could.  Messing with the actual inclusion stack wouldn't quite
work, because we'd lose track of physical line numbers.

Here's the patch.  No regressions on a x86_64-linux-gnu native.  Ok to
install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-line-0-empty-file.patch
Type: text/x-patch
Size: 8383 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070307/a5f450d6/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


More information about the Binutils mailing list