This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: Patch: handle N_MAIN stab


> 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.

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