This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[wilson@cygnus.com: Re: Patch to gcc/dwarf2out.c]
- To: egcs-patches at cygnus dot com
- Subject: [wilson@cygnus.com: Re: Patch to gcc/dwarf2out.c]
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Fri, 2 Oct 1998 17:05:13 -0700
Hi,
I would like to submit the following patch, generated by Jim Wilson,
which prevents a misleading abort when generating dwarf2 debug
information for an erroneous piece of code.
Cheers
Nick
Fri Oct 2 16:35:37 1998 Jim Wilson <wilson@cygnus.com>
* dwarf2out.c (gen_subprogram_die): If errorcount nonzero, don't
call abort if the function is already defined.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/dwarf2out.c,v
retrieving revision 1.97
diff -p -r1.97 dwarf2out.c
*** dwarf2out.c 1998/08/21 07:29:35 1.97
- --- dwarf2out.c 1998/10/02 23:34:58
*************** gen_subprogram_die (decl, context_die)
*** 8173,8179 ****
= lookup_filename (DECL_SOURCE_FILE (decl));
if (get_AT_flag (old_die, DW_AT_declaration) != 1)
! abort ();
/* If the definition comes from the same place as the declaration,
maybe use the old DIE. We always want the DIE for this function
- --- 8173,8189 ----
= lookup_filename (DECL_SOURCE_FILE (decl));
if (get_AT_flag (old_die, DW_AT_declaration) != 1)
! {
! /* ??? This can happen if there is a bug in the program, for
! instance, if it has duplicate function definitions. Ideally,
! we should detect this case and ignore it. For now, if we have
! already reported an error, any error at all, then assume that
! we got here because of a input error, not a dwarf2 bug. */
! extern int errorcount;
! if (errorcount)
! return;
! abort ();
! }
/* If the definition comes from the same place as the declaration,
maybe use the old DIE. We always want the DIE for this function
------- End of forwarded message -------