[RFA] Add language-dependent post-parser

Paul Hilfinger hilfingr@gnat.com
Fri Mar 19 00:09:00 GMT 2004


> Could you explain more about why you found this necessary?  It's hard
> to evaluate the patch without that.

Daniel,

Sure.  In Ada mode, we handle overloaded functions (not just those
that are the Ada equivalent of member functions).  More precisely, we
resolve overloading that can be resolved bottom-up, as C++ (almost
always) does.  The issue we encountered was the point at which GDB
discovers it cannot resolve the overloading.

With a command such as 

     print f(3)

there is no problem: you can resolve during execution, and print an error
message (or whatever) then.  But what about 

     cond 1 (f(3) > 12)

?  In similar C++ examples, such as

     cond 1 (A.f(3) > 12)

you'll find that resolution problems are reported when the breakpoint is 
hit, possibly long after the breakpoint is set.  This is safe (the program
stops), but we felt it was somewhat annoying that one didn't notice the 
problem earlier.  

We perform resolution in the obvious way, but that calls for
determining the static types of the arguments.  While it is possible
to do so during parsing, it would mean partially rebuilding the
existing infrastructure that allows GDB to compute types and expression
values.  We thought it would be easier to operate on the same prefix
form that is used for evaluation.  Unfortunately, this happens only AFTER 
the language-dependent parser returns.

Paul Hilfinger
Ada Core Technologies, Inc.



More information about the Gdb-patches mailing list