This is the mail archive of the gdb@sourceware.org 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: Multiple breakpoint locations


Eli Zaretskii <eliz at gnu.org> writes:

>> Cc: Vladimir Prus <ghost@cs.msu.su>,  gdb@sources.redhat.com
>> From: Jim Blandy <jimb@codesourcery.com>
>> Date: Wed, 14 Nov 2007 13:26:26 -0800
>> 
>> Following that link, I think I now better appreciate why full C++
>> support in GDB is basically impossible: in order to decide which 'fun'
>> template the call in 'main' refers to, one must try to instantiate
>> each template and type-check the resulting code.  So GDB would need to
>> essentially incorporate a full C++ front end.
>
> The information emitted by the compiler (which already has a full C++
> implementation) could help, couldn't it?

Actually, it doesn't.  Did you follow the link Andreas posted?

When the user enters a source expression referring to some function,
and we have several function templates in scope under the given name,
the process of deciding which function template's instantiation the
user's expression actually refers to involves essentially trying out
each template, typechecking its entire body, and rejecting the
template if a problem arises.

The debugging information could carry the templates' definitions to
us, giving us enough information to do the work --- but the work
itself is not much less complicated than a C++ front end.

In practice, the debugging information does not carry the definitions
of all the templates in scope, because it would often be huge.  You
will often have many templates in scope that you never used --- from
header files, say.  In order to carry out the process described above,
the debugging information would need to carry the templates' complete
definitions, including statements and expressions, not just summary
information like what a C declaration carries.  And those full
definitions can be substantial.

Restricting yourself to templates actually instantiated in the program
would bring the size issue under control, but it doesn't address the
'complete C++ front end' issue.


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