From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [patch 2/2] Do not bpstat_clear_actions on throw_exception #3
Date: Mon, 22 Aug 2011 17:06:00 -0000 [thread overview]
Message-ID: <201108221806.15757.pedro@codesourcery.com> (raw)
In-Reply-To: <20110822145150.GB11817@host1.jankratochvil.net>
On Monday 22 August 2011 15:51:50, Jan Kratochvil wrote:
> On Thu, 18 Aug 2011 18:42:19 +0200, Pedro Alves wrote:
> > Unfortunately, the hook-stop handling is in normal_stop.
> > Your patch clears the breakpoint commands before get get a chance
> > to run if the user installs a hook-stop. E.g., before:
>
> OK, I agree, I have made a new testcase.
Thanks.
> > This looks tricky to get right without changing gdb's behavior :-(
>
> The question is how big changed you were thinking about.
>
> One problem I find one cannot use "step" and other such commands in the
> breakpoints commands lists. This may be due to GDB trying not to overflow its
> stack. I gues with async mode it could be implementable as some
> stack-in-data-structure.
Yes, I going in that direction with
<http://sourceware.org/ml/gdb-patches/2011-06/msg00158.html>,
but there are other places I hadn't made fully state-machined
on that patch. Unfortunately, I can't afford finishing
that one now, and I flipped to a plan B.
> But that seems to be out of scope of this patch.
For sure.
> > We could try pushing bpstat_do_actions to the end of an execution
> > command's run, but e.g., that would change the behavior of
> > breakpoint commands in command lists, and things like "step N".
> > OTOH, maybe that'd be the right thing to do (the current
> > behavior could be seen as buggy --- more thought is needed).
>
> I was playing with various changes but it had various side-effects.
>
> Do you have anything against this patch?
No, looks almost good enough. I like that it's simple.
> I hope I have caught all the cases
> where exceptions can be thrown. Otherwise IMO everything is caught by
> execute_command anyway.
Not all cases. In async mode, handle_inferior_event is called
_outside_ of execute_command, directly by the event loop (well, almost
directly). Thus any exception thrown between bpstat_stop_status is called,
and the bpstat_do_actions call in inf-loop.c, will leave the thread
with a dangling bpstat too. Might be good enough to wrap
handle_inferior_event with a similar cleanup?
--
Pedro Alves
next prev parent reply other threads:[~2011-08-22 17:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 14:52 Jan Kratochvil
2011-08-22 17:06 ` Pedro Alves [this message]
2011-08-23 20:33 ` Jan Kratochvil
2011-08-24 10:19 ` Pedro Alves
2011-08-26 10:14 ` Jan Kratochvil
2011-08-26 11:45 ` Pedro Alves
2011-08-26 13:17 ` Jan Kratochvil
2011-08-26 13:51 ` Pedro Alves
2011-08-26 17:38 ` Tom Tromey
2011-08-26 21:04 ` Jan Kratochvil
2011-08-26 21:36 ` Pedro Alves
2011-08-26 21:46 ` Jan Kratochvil
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=201108221806.15757.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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