This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

Re: [rfa] function overloading and namespaces


On Fri, Jan 30, 2004 at 09:58:13AM -0800, David Carlton wrote:
> This teaches GDB's function overloading code about namespaces.  It
> also tries to clean up the existing code a bit, primarily by breaking
> up largish, messy functions into smaller, messy functions. :-( There's
> still a lot of cruft there, and it's by no means a perfect
> implementation of C++'s overloading rules (Koening lookup?  Template
> deduction?  Hah!), but it's an improvement over what we've got.

I have some deep reservations about this overload resolution code.  It
is, as you say, wildly inaccurate at its best.  It would be nice to
punt more reliably when it gets confused.  If we get an efficient
search-symbol-table-by-basename mechanism we may be able to do this.

However, before any of that can be a reality, the existing code needs
to be cleaned up.

> Tested on i686-pc-linux-gnu, four different GCC version/options; no
> regressions, the new tests pass on all of them (even stabs, since the
> information that we need is generated by buildsym.c).  OK to commit?

OK.  A couple of general comments:

> 	* cp-support.c (cp_func_name): New.

I am really sick of the number of variants of this C++ name parsing we
are spawning.  While the rest of the branch will be some time yet
maturing, I will try to merge the relevant pieces of drow-cplus-branch
in the very near future.  Then we can dispense with this function.

I'm also pretty tired of the growth of functions which concatenate
names with "::", or tear them apart with cp_find_next_component.  We
need to use some more efficient structure for describing namespaces
than this.  My personal hope is that we can un-flatten the symbol table
eventually, and have dictionaries per scope.

Do I sound bitter?  I blame the C++ language.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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