public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Do not generate discriminator directive in strict mode
@ 2011-04-19 14:10 Eric Botcazou
  2011-04-20 18:22 ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2011-04-19 14:10 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]

Hi,

it appears that the (standard DWARF as of version 4) discriminator directive 
can confuse non-GDB DWARF 2/3 debuggers, so this patch changes the compiler 
to stop emitting it in strict mode.

Tested on i586-suse-linux, OK for the mainline?


2011-04-19  Eric Botcazou  <ebotcazou@adacore.com>

	* dwarf2out.c (dwarf2out_source_line): Emit "discriminator" directive
	only for version 4 or above, or else in non-strict mode.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-diff, Size: 645 bytes --]

Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 172693)
+++ dwarf2out.c	(working copy)
@@ -22232,7 +22240,9 @@ dwarf2out_source_line (unsigned int line
       fprintf (asm_out_file, "\t.loc %d %d 0", file_num, line);
       if (is_stmt != table->is_stmt)
 	fprintf (asm_out_file, " is_stmt %d", is_stmt ? 1 : 0);
-      if (SUPPORTS_DISCRIMINATOR && discriminator != 0)
+      if (SUPPORTS_DISCRIMINATOR
+	  && discriminator != 0
+	  && (dwarf_version >= 4 || !dwarf_strict))
 	fprintf (asm_out_file, " discriminator %d", discriminator);
       fputc ('\n', asm_out_file);
     }

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

end of thread, other threads:[~2011-04-20 20:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-19 14:10 [patch] Do not generate discriminator directive in strict mode Eric Botcazou
2011-04-20 18:22 ` Richard Henderson
2011-04-20 19:26   ` Eric Botcazou
2011-04-20 21:10     ` Richard Henderson

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).