This is the mail archive of the
mailing list for the GDB project.
Re: [rfa] ALL_OBJFILE_MSYMBOLS
On 31 Jan 2003 15:01:24 -0500, Jim Blandy <email@example.com> said:
> I think I'd prefer the patch below. Could you try it out and see if
> it works as well?
Yes, it also fixes the bug I'm seeing.
> This was messier than I had expected.
> (Which is a great example of one reason C macros suck and Lisp
> macros don't --- in case that's an emotionally charged issue for
> anyone else out there like it is for me. :) )
I thought for a while about good responses to this, but I think I'll
just leave it alone for now. :-)
> But it would be better anyway for an empty minsym table to have a
> single, consistent representation.
That was my first reaction, too. But while I was thinking about how
to do that, I noticed that ALL_MSYMBOLS already dealt with the
possibility of a NULL entry, so I just went with that out of laziness.
Like you, trusting the count sounds like a good idea. And, even if
you go with a terminating entry, having it be a fake symbol instead
of, say, a NULL pointer is pretty weird, too. But making either of
those changes sounds like too much (fallible) work for too little
> So here's a patch which simply ensures that every objfile's minsym
> table has a terminating entry, and makes some appropriate accompanying
> changes. The tests are still running, but I haven't noticed any
> regressions yet.
Seems sensible to me. I didn't do a full testsuite run, but I did
apply it to my branch and try to trigger the bug I'd been seeing
there, and your patch does protect against the bug.