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, 05 Jun 2008 15:41:00 -0000 [thread overview]
Message-ID: <20080605154111.GA29085@caradoc.them.org> (raw)
In-Reply-To: <200805041225.54416.vladimir@codesourcery.com>
On Sun, May 04, 2008 at 12:25:54PM +0400, Vladimir Prus wrote:
> Are those two new patches, together with the previously posted one
> (changing stop_observer not to always fire) OK?
For this patch, if an error occurs during proceed (i.e. if the
cleanup restoring suppress_normal_stop_observer is run), will the
normal_stop observer ever be called? Is that a problem?
> + If the argument is pointer to allocated memory, then you need to
is a pointer
> struct cleanup *
> -make_my_cleanup (struct cleanup **pmy_chain, make_cleanup_ftype *function,
> - void *arg)
> +make_cleanup_restore_integer (int *variable, int value)
> +{
> + struct restore_integer_closure *c =
> + xmalloc (sizeof (struct restore_integer_closure));
> + struct cleanup *cleanup = make_cleanup (restore_integer, (void *) c);
> + c->variable = variable;
> + c->value = *variable;
> + *variable = value;
> + cleanup_chain->free_arg = xfree;
> + return cleanup;
> +}
Could you use make_my_cleanup2 here to avoid poking around in
cleanup_chain, please?
Also, the only thing value is used for is to set *variable. I
suggest not setting the variable in a function named
"make_cleanup_restore_integer", which doesn't say anything about
setting. So I would prefer this:
old_cleanup = make_cleanup_restore_integer (some_var);
some_var = 0;
> * infrun.c (finish_command): Don't pass cleanup
> to continuation.
> (finish_command_continuation): Don't grab cleanup from
> the passed data, as we don't use, and cannot, use it anyway.
OK.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-06-05 15:41 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
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 [this message]
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=20080605154111.GA29085@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