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 for debug/6387


A testcase with a local class member function caused the compiler to abort
at -g1, because we didn't emit the class, so we didn't have any place to
attach the information for the member function.  I've changed dwarf2out to
put all function debug info at toplevel when compiling at -g1, since
scoping information is useless then.

Tested i686-pc-linux-gnu, applied to 3.3 and trunk.  Test in
g++.dg/debug/minimal1.C

2003-03-15  Jason Merrill  <jason at redhat dot com>

	PR debug/6387
	* dwarf2out.c (dwarf2out_decl): If we're at -g1, just stick nested
	function DIEs at toplevel.
	(decls_for_scope): At -g1, don't descend into subblocks.

*** dwarf2out.c.~1~	2003-03-11 17:56:47.000000000 -0500
--- dwarf2out.c	2003-03-14 20:06:13.000000000 -0500
*************** decls_for_scope (stmt, context_die, dept
*** 12018,12023 ****
--- 12018,12027 ----
  	gen_decl_die (decl, context_die);
      }
  
+   /* If we're at -g1, we're not interested in subblocks.  */
+   if (debug_info_level <= DINFO_LEVEL_TERSE)
+     return;
+ 
    /* Output the DIEs to represent all sub-blocks (and the items declared
       therein) of this block.  */
    for (subblocks = BLOCK_SUBBLOCKS (stmt);
*************** dwarf2out_decl (decl)
*** 12286,12292 ****
        /* If we're a nested function, initially use a parent of NULL; if we're
  	 a plain function, this will be fixed up in decls_for_scope.  If
  	 we're a method, it will be ignored, since we already have a DIE.  */
!       if (decl_function_context (decl))
  	context_die = NULL;
        break;
  
--- 12290,12298 ----
        /* If we're a nested function, initially use a parent of NULL; if we're
  	 a plain function, this will be fixed up in decls_for_scope.  If
  	 we're a method, it will be ignored, since we already have a DIE.  */
!       if (decl_function_context (decl)
! 	  /* But if we're in terse mode, we don't care about scope.  */
! 	  && debug_info_level > DINFO_LEVEL_TERSE)
  	context_die = NULL;
        break;
  

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