🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #166

Re: Problem with -mapped option in gdb4.6

#166
From: Fred Fish
Date: Thu, 06 Aug 1992 15:37
48 lines
1993 bytes
> Gdb is dumping core when using a mapped symbol file that was created using
> the -mapped option (on both sun 4.1.1 and 4.1.2, sparc2 and sparc1). The
> following shows the problem:
> 
> % gdb -batch -nx -mapped -readnow foo
> % ls -l foo.syms
> -rw-rw-r--  1 otto     15392768 Aug  4 23:32 foo.syms
> % gdb foo
> GDB is free software and you are welcome to distribute copies of it
>  under certain conditions; type "show copying" to see the conditions.
> There is absolutely no warranty for GDB; type "show warranty" for details.
> GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
> (gdb) list
> Memory fault - core dumped

This should be fixed in the next release of gdb.  Below is a patch that
fixes the bug.

*** buildsym.c.old	Tue Aug  4 10:26:26 1992
--- buildsym.c	Thu Aug  6 07:30:29 1992
***************
*** 668,674 ****
  	    {
  	      symtab->linetable = NULL;
  	    }
! 	  symtab->dirname = subfile->dirname;
  	  symtab->free_code = free_linetable;
  	  symtab->free_ptr = NULL;
  
--- 668,685 ----
  	    {
  	      symtab->linetable = NULL;
  	    }
! 	  if (subfile->dirname)
! 	    {
! 	      /* Reallocate the dirname on the symbol obstack */
! 	      symtab->dirname = (char *)
! 		obstack_alloc (&objfile -> symbol_obstack,
! 			       strlen (subfile -> dirname) + 1);
! 	      strcpy (symtab->dirname, subfile->dirname);
! 	    }
! 	  else
! 	    {
! 	      symtab->dirname = NULL;
! 	    }
  	  symtab->free_code = free_linetable;
  	  symtab->free_ptr = NULL;
  
Technical Details
Message-ID: <713115462.AA24583@fishpond.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!fishpond.UUCP!fnf
References: <21990@sybase.sybase.com>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!fishpond.UUCP!fnf
From: fnf@fishpond.UUCP (Fred Fish)
Subject: Re: Problem with -mapped option in gdb4.6
Message-ID: <713115462.AA24583@fishpond.uucp>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: <21990@sybase.sybase.com>
Distribution: gnu
Date: Thu, 6 Aug 1992 15:37:41 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 49