Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Use observers to report stop events.
Date: Thu, 01 May 2008 19:58:00 -0000	[thread overview]
Message-ID: <20080501195758.GL22218@caradoc.them.org> (raw)
In-Reply-To: <200804292210.31614.vladimir@codesourcery.com>

On Tue, Apr 29, 2008 at 10:10:30PM +0400, Vladimir Prus wrote:
> Here are 3 independent bits.
> 
> 1. Introduce the make_cleanup_restore_integer function. You're right
> that it can lead to bad results if one discards this cleanup, but then
> one should be careful with discarding cleanups anyway.

This patch looks fine except that ...

> 2. Modify the normal_stop observer not to fire in some cases. One
> case is when doing function call -- we don't announce the stop in CLI
> and for similar reason we don't have observer to be called. Also,
> for the benefit of next patch, we want the call to observer to
> be delayed until we print function return value, if we're doing finish.

... unless I'm mistaken you have exactly the memory leak Joel warned
about, since finish_command discards continuations.

Am I correct that the cleanup for finish_command is never supposed to
survive the function returning?  It's run on error and discarded on
normal return.  So you could put the closure in a local variable,
maybe.

  struct foo_closure my_closure = { &my_global, my_global };
  make_cleanup (restore_integer, &my_closure); 

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2008-05-01 19:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-11 20:05 Vladimir Prus
2008-04-24 13:47 ` Vladimir Prus
2008-04-29  8:03 ` Joel Brobecker
2008-04-29 18:30   ` Vladimir Prus
2008-05-01 19:58     ` Daniel Jacobowitz [this message]
2008-05-01 20:11       ` Pedro Alves
2008-05-01 20:17         ` Vladimir Prus
2008-05-04  9:05       ` Vladimir Prus
2008-05-28 18:30         ` Vladimir Prus
2008-06-05 15:41         ` Daniel Jacobowitz
2008-06-10 11:58           ` Vladimir Prus
2008-06-10 13:21             ` Daniel Jacobowitz
2008-06-10 13:25               ` Vladimir Prus
2008-06-10 13:51                 ` 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=20080501195758.GL22218@caradoc.them.org \
    --to=drow@false.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=vladimir@codesourcery.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