From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@efficios.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: remove uses of iterate_over_inferiors in remote-sim.c
Date: Tue, 21 Jan 2020 20:17:00 -0000 [thread overview]
Message-ID: <87v9p48tvz.fsf@tromey.com> (raw)
In-Reply-To: <20200121021306.19200-1-simon.marchi@efficios.com> (Simon Marchi's message of "Mon, 20 Jan 2020 21:13:06 -0500")
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
Simon> This removes the two uses of iterate_over_inferiors, in favor of
Simon> range-based loops.
Hah, I was writing the same patch :)
Simon> +static void
Simon> +gdbsim_interrupt_inferior (struct inferior *inf)
Simon> {
Simon> struct sim_inferior_data *sim_data
Simon> = get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED);
Simon> - if (sim_data)
Simon> + if (sim_data != nullptr)
Simon> {
Simon> if (!sim_stop (sim_data->gdbsim_desc))
This could be shortened to using an "&&" instead of a nested if. And, I
think it would be clearer still to remove gdbsim_interrupt_inferior and
just inline the body into gdbsim_target::interrupt.
Tom
next prev parent reply other threads:[~2020-01-21 19:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 2:14 Simon Marchi
2020-01-21 20:17 ` Tom Tromey [this message]
2020-01-21 21:09 ` Simon Marchi
2020-01-21 21:29 ` Tom Tromey
2020-01-21 22:28 ` Simon Marchi
2020-01-22 1:31 ` Tom Tromey
2020-01-22 1:56 ` Simon Marchi
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=87v9p48tvz.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.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