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] Conditionalize maybe_suppress_debug_info in gcc/cp/search.c


This patch adds the flag "-femit-class-debug-always" which causes all
the C++ class debug information to be emitted. Even if the vtable is not
being emitted.

The documentation is perhaps the best description of this patch.
~~~
This is indirectly used by the dwarf2 backend to determine wether class
debug information should be suppressed. Using this flag can increase the
debug information output size by a factor of 2. It can provide class
debug information in the file that the class was defined, instead of
just the location where the class is used. This is usefull for debug
information consumers that lack the ability, or do so poorly, to unify
program debug information.
~~~

Tested with no regressions on i686-pc-linux-gnu.
Tested with no regressions on powerpc-none-eabi.

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

gcc/

2006-03-16  Carlos O'Donell  <carlos@codesourcery.com>

	* doc/invoke.texi: Add and document 
	-femit-class-debug-always
	* common.opts: Add -femit-class-debug-always.

gcc/cp

2006-03-16  Carlos O'Donell  <carlos@codesourcery.com>

	* search.c (maybe_suppress_debug_info): If
	flag_emit_class_debug_always then don't suppress.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 112026)
+++ gcc/doc/invoke.texi	(working copy)
@@ -287,7 +287,8 @@ Objective-C and Objective-C++ Dialects}.
 -ftree-vectorizer-verbose=@var{n} @gol
 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
--feliminate-unused-debug-symbols -fmem-report -fprofile-arcs @gol
+-feliminate-unused-debug-symbols -femit-class-debug-always @gol
+-fmem-report -fprofile-arcs @gol
 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
 -ftest-coverage  -ftime-report -fvar-tracking @gol
 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
@@ -3514,6 +3515,16 @@ On System V Release 4 systems this optio
 Produce debugging information in stabs format (if that is supported),
 for only symbols that are actually used.
 
+@item -femit-class-debug-always
+Do not suppress C++ class debug information.
+This is indirectly used by the dwarf2 backend to determine wether 
+class debug information should be suppressed. Using this flag can 
+increase the debug information output size by a factor of 2. It can 
+provide class debug information in the file that the class was 
+defined, instead of just the location where the class is used. 
+This is usefull for debug information consumers that lack the 
+ability, or do so poorly, to unify program debug information.
+
 @item -gstabs+
 @opindex gstabs+
 Produce debugging information in stabs format (if that is supported),
Index: gcc/cp/search.c
===================================================================
--- gcc/cp/search.c	(revision 112026)
+++ gcc/cp/search.c	(working copy)
@@ -2042,6 +2042,10 @@ maybe_suppress_debug_info (tree t)
   /* We might have set this earlier in cp_finish_decl.  */
   TYPE_DECL_SUPPRESS_DEBUG (TYPE_MAIN_DECL (t)) = 0;
 
+  /* Always emit the information for each class every time. */
+  if (flag_emit_class_debug_always)
+    return;
+
   /* If we already know how we're handling this class, handle debug info
      the same way.  */
   if (CLASSTYPE_INTERFACE_KNOWN (t))
Index: gcc/common.opt
===================================================================
--- gcc/common.opt	(revision 112026)
+++ gcc/common.opt	(working copy)
@@ -391,6 +391,10 @@ feliminate-unused-debug-types
 Common Report Var(flag_eliminate_unused_debug_types) Init(1)
 Perform unused type elimination in debug info
 
+femit-class-debug-always
+Common Report Var(flag_emit_class_debug_always) Init(1)
+Do not suppress C++ class debug information.
+
 fexceptions
 Common Report Var(flag_exceptions)
 Enable exception handling


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