🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #419

gdb coredumps if bad object file

#419
From: Pierre Willard
Date: Fri, 04 Sep 1992 21:55
20 lines
1085 bytes
I recommend testing for (m) != NULL in the ALL_MSYMBOLS macro
in objfiles.h (gdb 4.5 at least). All other macros in objefiles.h
are safe except this one.

It happened to me that I had a bad object file and that an error
occured in reading in dbx_symfile_init() and then gdb would core dump
because objfile -> msymbol is NULL.

So, it is safer to replace ALL_MSYMBOLS by the following :

#define	ALL_MSYMBOLS(objfile, m) \
  ALL_OBJFILES (objfile)	 \
    for ((m) = (objfile) -> msymbols; ((m) != NULL) && ((m)->name != NULL); (m)++)

Maybe an additional fix would be to remove this object file from the
list.

Let me know your comments.
Regards
Pierre Willard
Technical Details
Message-ID: <9209042155.AA28088@_la.tce.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!la.tce.COM!pierre

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!la.tce.COM!pierre
From: pierre@la.tce.COM (Pierre Willard)
Subject: gdb coredumps if bad object file
Message-ID: <9209042155.AA28088@_la.tce.com>
Sender: gnulists@ai.mit.edu
Reply-To: pierre@la.tce.com
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 4 Sep 1992 21:55:11 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 22