From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove reset_ecs
Date: Mon, 21 Nov 2022 13:14:18 -0500 [thread overview]
Message-ID: <102b6335-e33d-ffc0-b7a5-fd79d4cf26af@simark.ca> (raw)
In-Reply-To: <20221121175830.3585569-1-tom@tromey.com>
On 11/21/22 12:58, Tom Tromey wrote:
> I noticed that execution_control_state has a 'reset' method, and
> there's also a 'reset_ecs' function that calls it. This patch cleans
> this area up a little by adding a parameter to the constructor and the
> reset method. Some extraneous variables are also removed, like here:
>
> - struct execution_control_state ecss;
> - struct execution_control_state *ecs = &ecss;
>
> Here 'ecs' is never changed, so this patch removes it entirely in
> favor of just using the object everywhere.
I think we could get rid of the reset method as well, it's not used
outside of the constructor. Like this:
struct execution_control_state
{
explicit execution_control_state (thread_info *thr = nullptr)
: ptid (thr != nullptr ? thr->ptid : null_ptid), event_thread (thr)
{}
process_stratum_target *target = nullptr;
ptid_t ptid;
/* The thread that got the event, if this was a thread event; NULL
otherwise. */
struct thread_info *event_thread;
target_waitstatus ws;
int stop_func_filled_in = 0;
CORE_ADDR stop_func_start = 0;
CORE_ADDR stop_func_end = 0;
const char *stop_func_name = nullptr;
int wait_some_more = 0;
/* True if the event thread hit the single-step breakpoint of
another thread. Thus the event doesn't cause a stop, the thread
needs to be single-stepped past the single-step breakpoint before
we can switch back to the original stepping thread. */
int hit_singlestep_breakpoint = 0;
};
Simon
next prev parent reply other threads:[~2022-11-21 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 17:58 Tom Tromey
2022-11-21 18:14 ` Simon Marchi [this message]
2022-11-26 1:53 ` Tom Tromey
2022-11-26 20:32 ` Simon Marchi
2022-11-28 19:19 ` Tom Tromey
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=102b6335-e33d-ffc0-b7a5-fd79d4cf26af@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).