This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Do not generate discriminator directive in strict mode


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
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);
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]