This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: Patch: handle N_MAIN stab
- To: green at redhat dot com
- Subject: Re: Patch: handle N_MAIN stab
- From: Jim Kingdon <kingdon at redhat dot com>
- Date: 06 Mar 2000 08:36:44 -0800
- CC: gdb-patches at sourceware dot cygnus dot com
- CC: jimb at cygnus dot com, tromey at cygnus dot com
- References: <200003051039.CAA04980@hoser.cygnus.com>
> Gdb currently ignores N_MAIN. The following patch is an attempt to
> make it understand N_MAIN.
I looked over that patch and the basic concept looks fine. N_MAIN is
already documented in doc/stabs.texinfo.
The patch does leak memory every time symbols are reloaded, though (a
bad thing in and of itself and also a hassle is using memory leak
detecting programs). And probably has subtler bugs if one has a
symbol file with N_MAIN and then replaces it with a symbol file with
"main" and without N_MAIN. I'm not sure exactly what rule to follow
but probably something like:
* N_MAIN takes precedence over "main" no matter what objfile it is in
* If there is more than one N_MAIN, choose the one in the
symfile_objfile
* If there is more than one N_MAIN within a given objfile, complain()
and choose arbitrarily.
I have no particularly strong objection if the maintainer (JimB, looks
like) wants to relegate the above to FIXME comments or something, but
I guess if you want my advice, it should be fairly easy to fix at
least the memory leak now.