Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Tom Tromey <tromey@redhat.com>
Cc: Keith Seitz <keiths@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] Add method overload resolution to expression parser
Date: Wed, 14 Oct 2009 19:17:00 -0000	[thread overview]
Message-ID: <20091014191710.GA1785@caradoc.them.org> (raw)
In-Reply-To: <m3zl7tajs8.fsf@fleche.redhat.com>

On Wed, Oct 14, 2009 at 12:54:15PM -0600, Tom Tromey wrote:
> This implementation defers creation of the temporary function type to
> the point where it is used.  IIUC, which I hope I do :-), this temporary
> type can't really leak out of the TYPE_INSTANCE code.  That is, it is
> constructed and used to look up an actual function or method (which has
> its own type).
> 
> If we used UNOP_CAST then we would have to make a long-lived temporary
> type, not only because the type would have to live at least from parsing
> through the end of the life of the parsed expression, but also because
> the result of the cast would have that temporary type, and thus it would
> be capturable.
> 
> This would not be as big a deal if the type GC work were finished, but
> that is still pending.

Maybe we need to get that merged, then, instead of complicated
lifetime-confusing hacks around it :-)

We already have related bugs (and memory leaks).  Try:

(gdb) ptype (int (*) (int, int)) 0
type = int (*)()

We lose the arguments - but we still call make_function_type, and leak
the type.  So it's clear to me that we want a more general solution.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2009-10-14 19:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 18:06 Keith Seitz
2009-09-24 19:30 ` Keith Seitz
2009-10-13 21:24 ` Daniel Jacobowitz
2009-10-14 18:54   ` Tom Tromey
2009-10-14 19:17     ` Daniel Jacobowitz [this message]
2009-10-14 19:29       ` Tom Tromey
2009-10-13 21:24 ` Tom Tromey
2009-11-09 21:55   ` Keith Seitz
2009-11-09 22:22     ` Tom Tromey
2009-11-09 23:35       ` Keith Seitz
2009-11-10 19:14         ` Daniel Jacobowitz
2009-11-10 22:19           ` Keith Seitz

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=20091014191710.GA1785@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=tromey@redhat.com \
    /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