public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] gas: Don't error when .debug_line already exists, unless .loc was used
@ 2020-09-11 12:47 Nick Clifton
  2020-09-11 13:51 ` H.J. Lu
  0 siblings, 1 reply; 20+ messages in thread
From: Nick Clifton @ 2020-09-11 12:47 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: binutils

Hi Mark,

> The tests are unfortunately arch specific because the line table is only
> generated when actual instructions have been emitted.

Are you sure about that ?  How about using the NOP instruction ?

I admit that some architectures do need special syntax for their
nop instructions, but there is already a test in gas testsuite
that handles this (see gas/testsuite/gas/all/gas.exp:org-1).  The
nop-selecting code there could probably be extracted into a library
function then used in lots of places...

Cheers
  Nick


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [PATCH] gas: Don't error when .debug_line already exists, unless .loc was used
@ 2020-09-11 15:45 Nick Clifton
  2020-09-11 18:34 ` Mark Wielaard
  0 siblings, 1 reply; 20+ messages in thread
From: Nick Clifton @ 2020-09-11 15:45 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: binutils

Hi Mark,

> gas/ChangeLog:
> 
>     * as.texi (-g): Explicitly mention when .debug_info and .debug_line
>     are generated for the DWARF format.
>     (Loc): Add that it is an error to both use a .loc directive and
>     generate a .debug_line yourself.
>     * dwarf2dbg.c (dwarf2_any_loc_directive_seen): New static variable.
>     (dwarf2_directive_loc): Set dwarf2_any_loc_directive_seen to TRUE.
>     (dwarf2_finish): Check dwarf2_any_loc_directive_seen before emitting
>     an error. Only create .debug_line if it is empty (or doesn't exist).
>     * testsuite/gas/i386/i386.exp: Add dwarf2-line-{1,2,3,4} when testing
>     an elf target.
>     * testsuite/gas/i386/dwarf2-line-{1,2,3,4}.{s,d,l}: New test files.

Approved - please apply.

If you are feeling keen, then do please have a go at creating a generic
testcase.  If not, then I will make one myself soon.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-09-14 22:44 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200824125658.22526-1-mark@klomp.org>
     [not found] ` <20200824125658.22526-6-mark@klomp.org>
2020-08-26 21:37   ` Duplicate .debug_lines (Was: [PATCH 5/5] Add --gdwarf-5 to ASM_SPEC) Mark Wielaard
2020-08-26 23:38     ` H.J. Lu
2020-08-29 12:23       ` Mark Wielaard
2020-08-29 14:34         ` H.J. Lu
2020-08-29 15:23           ` Mark Wielaard
2020-08-29 15:43             ` H.J. Lu
2020-08-29 16:32               ` Mark Wielaard
2020-08-29 16:44                 ` H.J. Lu
2020-08-29 17:32                   ` Mark Wielaard
2020-09-07 12:37     ` [PATCH] gas: Don't error when .debug_line already exists, unless .loc was used Mark Wielaard
2020-09-11 12:47 Nick Clifton
2020-09-11 13:51 ` H.J. Lu
2020-09-11 15:40   ` Nick Clifton
2020-09-11 15:46   ` Mark Wielaard
2020-09-11 15:56     ` Nick Clifton
2020-09-14 15:17     ` Nick Clifton
2020-09-11 15:45 Nick Clifton
2020-09-11 18:34 ` Mark Wielaard
2020-09-14  9:45   ` Nick Clifton
2020-09-14 22:43     ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).