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.