[Bug gas/19499] New: as ignores .file directives when generating error messages

2016-01-20 Thread ruperts at broadcom dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19499

Bug ID: 19499
   Summary: as ignores .file directives when generating error
messages
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: ruperts at broadcom dot com
  Target Milestone: ---

The documentation at
https://sourceware.org/binutils/docs/as/Errors.html says:

  If a logical file name has been given (see .file) it is used for the
  filename, otherwise the name of the current input file is used. If a
  logical line number was given (see .line) then it is used to
  calculate the number printed, otherwise the actual line in the
  current source file is printed.

However, consider this transcript:

  ~ $ as --version
  GNU assembler (GNU Binutils for Debian) 2.25.90.20160101
  Copyright (C) 2015 Free Software Foundation, Inc.
  This program is free software; you may redistribute it under the terms of
  the GNU General Public License version 3 or later.
  This program has absolutely no warranty.
  This assembler was configured for a target of `x86_64-linux-gnu'.
  ~ $ cat test.s
  .file 1 "test.c"
  some_nonsense_insn 1 2 3
  ~ $ as test.s -o test.o
  test.s: Assembler messages:
  test.s:2: Error: no such instruction: `some_nonsense_insn 1 2 3'

I would expect the last two lines to begin with "test.c" rather than
"test.s".

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/19499] as ignores .file directives when generating error messages

2016-01-20 Thread ruperts at broadcom dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19499

--- Comment #2 from Rupert Swarbrick (Broadcom)  
---
Brilliant! I hadn't thought to pass in line information too. I don't have
strong feelings about what should be updated: probably I agree that the best
thing is to update the documentation to match the current state of affairs.

Either way, it's good to have the possibility of getting the assembler to refer
to a named file. I'm working on an assembly-language pre-processor, so would
like error messages to refer to the user's code, rather than
/tmp/some-mangled-version.s ...

Thanks for the quick response.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/19499] as ignores .file directives when generating error messages

2016-01-20 Thread ruperts at broadcom dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19499

--- Comment #5 from Rupert Swarbrick (Broadcom)  
---
Looks good to me. Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils