This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] Pass inferior to terminal_save_inferior
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>, gdb-patches at sourceware dot org
- Date: Mon, 22 Oct 2018 21:54:43 +0100
- Subject: Re: [PATCH 1/3] Pass inferior to terminal_save_inferior
- References: <20181016033835.17594-1-simon.marchi@polymtl.ca>
On 10/16/2018 04:38 AM, Simon Marchi wrote:
> Instead of relying on the current inferior, pass an inferior pointer to
> the target implementing terminal_save_inferior. There should be no
> change in behavior.
>
Your original patch 3/3 ended up not using the inferior pointer. :-)
I suppose that this doesn't hurt, like the equivalent target_detach
change.
> I added documentation to terminal_save_inferior, as I understand it
> (maybe I understood it wrong, so please take a look).
That looks good. (please recall to update commit log.)
> diff --git a/gdb/target.c b/gdb/target.c
> index 2d98954b54ac..93d16b90f179 100644
> --- a/gdb/target.c
> +++ b/gdb/target.c
> @@ -511,10 +511,7 @@ target_terminal_is_ours_kind (target_terminal_state desired_state)
> ALL_INFERIORS (inf)
> {
> if (inf->terminal_state == target_terminal_state::is_inferior)
> - {
> - set_current_inferior (inf);
> - current_top_target ()->terminal_save_inferior ();
> - }
> + current_top_target ()->terminal_save_inferior (inf);
> }
With multi-target, current_top_target() will depend on
the current inferior, so I'll need to put that
set_current_inferior call back.
Thanks,
Pedro Alves