Re: partial-symtab symbol sorting

Tom Tromey
2011-11-29T14:51:29Z

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> I just realized that partial symbols are sorted using strcmp_iw_ordered.
Joel> This works great for C++, for instance, but only works OK for Ada.

Joel> I am wondering if we shouldn't be sorting the partial symbols
Joel> using a language-specific sorting routine instead.

FWIW, I think it would probably be fine. It is hard to know for certain
without actually trying it, though.

Joel> The thing is, when I looked at it, it's not easy just looking at
Joel> the partial symtab what language it is. The language seems to be
Joel> embedded in the symbols themselves.

This is easy to add, though.

We could also add more function pointers so that the behavior is
method-based instead of switch-based.

Joel> But, without even thinking about performance issues at startup, this
Joel> approach suffers from the same problem as storing the natural name does:
Joel> For certain large applications, we would exceed the maximum amount of
Joel> memory a process can hold. This is not necessarily on GNU/Linux, but
Joel> the problem is there. I think we'll have better luck we are capable of
Joel> merging a bit the massive duplication in the debug info.

I'm curious to know what massive duplication you mean.

In my local builds I'm using -gdwarf-4 and seeing big space wins.
These also translate to runtime space wins for gdb; the effect is
basically like a bcache for types.

This is for C, I don't know about Ada.

Tom