From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "Ulrich Weigand" <uweigand@de.ibm.com>, drow@false.org
Subject: Re: [rfc] [0/7] infrun cleanup
Date: Sun, 07 Dec 2008 19:16:00 -0000 [thread overview]
Message-ID: <200812071915.46858.pedro@codesourcery.com> (raw)
In-Reply-To: <200812071819.mB7IJnUh004717@d12av02.megacenter.de.ibm.com>
On Sunday 07 December 2008 18:19:49, Ulrich Weigand wrote:
> In the context of some further cleanup and splitting handle_inferior_event
> into multiple more independent parts, I had been wondering whether it
> might be a good idea to use a enum (like enum inferior_stop_reason)
> instead of the boolean: handle_inferior_event (and its hypothetical
> subroutines) would return enum values to indicate *why* the inferior
> stopped, including a new STILL_RUNNING value to indicate that it
> in fact hasn't yet stopped.
>
> In this set-up you'd have statements like
>
> return STILL_RUNNING;
'return WAIT_SOME_MORE;' would be historically more appropriate. :-)
>
> or
>
> return END_STEPPING_RANGE;
>
> or (another potential new value)
>
> return HIT_BREAKPOINT;
>
> within handle_inferior_event; and its caller would be rewritten like
>
> do
> {
> ptid = target_wait (...);
> stop_reason = handle_inferior_event (ptid, ...);
> }
> while (stop_reason == STILL_RUNNING);
>
> It might be feasible to use the stop_reason in the future to merge
> some of the print_stop_reason stuff into normal_stop and reduce the
> amount of duplicate checks; or even to replace some of the "global"
> output variables like stopped_by_random_signal or tp->stop_step.
Sounds good to me.
> I thought I had updated that one?
Oh, you did. I missed it, sorry.
>
> > /* Refresh prev_pc value just prior to resuming. This used to be
> > done in stop_stepping, however, setting prev_pc there did not handle
> > scenarios such as inferior function calls or returning from
> > a function via the return command. In those cases, the prev_pc
> > ...
>
> I left that because it specifically refers to how things were done
> in the past, when we still had that function ... Maybe it could be
> marked as "the former stop_stepping" or so.
Well, that whole comment becomes mostly useless after these cleanups.
It refers to stop_stepping, ecs, init_execution_control_state, all things
that are gone, which seems to leave more confusion than clarify things.
I wonder if we should just remove most of it, and just comment why we
set prev_pc there...
--
Pedro Alves
prev parent reply other threads:[~2008-12-07 19:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-15 16:42 [rfc] Fix PR 2250 - multithreaded single-step problems in all-stop mode Ulrich Weigand
2008-11-15 21:30 ` Pedro Alves
2008-11-17 22:19 ` Ulrich Weigand
2008-11-17 23:36 ` Pedro Alves
2008-11-18 1:43 ` Ulrich Weigand
2008-11-18 3:36 ` Pedro Alves
2008-12-07 0:16 ` [rfc] [0/7] infrun cleanup Ulrich Weigand
2008-12-07 1:29 ` Pedro Alves
2008-12-07 17:12 ` Pedro Alves
2008-12-07 18:20 ` Ulrich Weigand
2008-12-07 19:16 ` Pedro Alves [this message]
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=200812071915.46858.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.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