public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: schwab@suse.de,  ghost@cs.msu.su,  gdb@sources.redhat.com
Subject: Re: Multiple breakpoint locations
Date: Thu, 15 Nov 2007 16:50:00 -0000	[thread overview]
Message-ID: <m3oddv8nd3.fsf@codesourcery.com> (raw)
In-Reply-To: <uwsskcfrr.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 15 Nov 2007 06:08:08 +0200")

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.

  parent reply	other threads:[~2007-11-15 16:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13 19:15 Nick Roberts
2007-11-13 19:28 ` Vladimir Prus
2007-11-13 19:59   ` Daniel Jacobowitz
2007-11-13 20:09   ` Nick Roberts
2007-11-13 20:14     ` Daniel Jacobowitz
2007-11-13 20:18     ` Bob Rossi
2007-11-13 20:19     ` Vladimir Prus
2007-11-13 22:03     ` Andreas Schwab
2007-11-14  6:20       ` Vladimir Prus
2007-11-14 10:12         ` Andreas Schwab
2007-11-14 21:26           ` Jim Blandy
2007-11-14 21:34             ` Vladimir Prus
2007-11-14 22:08             ` Andreas Schwab
2007-11-15  4:08             ` Eli Zaretskii
2007-11-15 13:37               ` Daniel Jacobowitz
2007-11-15 16:50               ` Jim Blandy [this message]
2007-11-13 22:18   ` Eli Zaretskii
2007-11-13 23:39     ` Douglas Evans
2007-11-14  4:17       ` Eli Zaretskii
2007-11-14  5:02         ` Joel Brobecker
2007-11-14  6:13         ` Vladimir Prus
2007-11-14 18:54           ` Eli Zaretskii
2007-11-14 19:00             ` Vladimir Prus
2007-11-17 11:55 ` Eli Zaretskii
2007-11-17 12:07 ` Eli Zaretskii
2007-11-17 14:14   ` Vladimir Prus
2007-11-17 15:36     ` Eli Zaretskii
2007-11-18  1:32       ` Nick Roberts
2007-11-18  2:26         ` Daniel Jacobowitz
2007-11-18  8:47           ` Nick Roberts
2007-11-19 12:57             ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3oddv8nd3.fsf@codesourcery.com \
    --to=jimb@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).