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: print-tree and column numbers


This patch changes print-tree.c to emit column numbers when mapped
locations are enabled.  This makes the debugging output a bit nicer
and makes it simpler to debug column number location bugs.

Bootstrapped and regtested on x86 FC-6.  Ok?

Tom

2007-10-30  Tom Tromey  <tromey@redhat.com>

	* print-tree.c (print_node): Print column number.

Index: print-tree.c
===================================================================
--- print-tree.c	(revision 129492)
+++ print-tree.c	(working copy)
@@ -443,6 +443,9 @@
 
       xloc = expand_location (DECL_SOURCE_LOCATION (node));
       fprintf (file, " file %s line %d", xloc.file, xloc.line);
+#ifdef USE_MAPPED_LOCATION
+      fprintf (file, " col %d", xloc.column);
+#endif
 
       if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
 	{	  
@@ -932,6 +935,9 @@
       expanded_location xloc = expand_location (EXPR_LOCATION (node));
       indent_to (file, indent+4);
       fprintf (file, "%s:%d", xloc.file, xloc.line);
+#ifdef USE_MAPPED_LOCATION
+      fprintf (file, ":%d", xloc.column);
+#endif
     }
 
   fprintf (file, ">");


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