Same principle as the previous patches.
gdb/ChangeLog:
* target.h (target_is_pushed): Remove, update callers to use
inferior::target_is_pushed instead.
* target.c (target_is_pushed): Remove.
Change-Id: I9862e6205acc65672da807cbe4b46cde009e7b9d
+2021-03-23 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * target.h (target_is_pushed): Remove, update callers to use
+ inferior::target_is_pushed instead.
+ * target.c (target_is_pushed): Remove.
+
2021-03-23 Simon Marchi <simon.marchi@polymtl.ca>
* target.h (push_target): Remove, update callers to use
}
target_ops *darwin_ops = get_native_target ();
- if (!target_is_pushed (darwin_ops))
+ if (!inf->target_is_pushed (darwin_ops))
inf->push_target (darwin_ops);
}
int from_tty)
{
struct inf *inf = cur_inf ();
+ inferior *inferior = current_inferior ();
int pid;
inf_debug (inf, "creating inferior");
- if (!target_is_pushed (this))
- current_inferior ()->push_target (this);
+ if (!inf->target_is_pushed (this))
+ inf->push_target (this);
pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me,
NULL, NULL, NULL, NULL);
inf = current_inferior ();
inferior_appeared (inf, SOME_PID);
- if (!target_is_pushed (this))
+ if (!inf->target_is_pushed (this))
inf->push_target (this);
thread_info *thr = add_thread_silent (ptid_t (SOME_PID));
const std::string &allargs,
char **env, int from_tty)
{
+ inferior *inf = current_inferior ();
+
/* Do not change either targets above or the same target if already present.
The reason is the target stack is shared across multiple inferiors. */
- int ops_already_pushed = target_is_pushed (this);
+ int ops_already_pushed = inf->target_is_pushed (this);
target_unpush_up unpusher;
if (! ops_already_pushed)
{
/* Clear possible core file with its process_stratum. */
- current_inferior ()->push_target (this);
+ inf->push_target (this);
unpusher.reset (this);
}
void
inf_ptrace_target::attach (const char *args, int from_tty)
{
- pid_t pid;
- struct inferior *inf;
+ inferior *inf = current_inferior ();
/* Do not change either targets above or the same target if already present.
The reason is the target stack is shared across multiple inferiors. */
- int ops_already_pushed = target_is_pushed (this);
+ int ops_already_pushed = inf->target_is_pushed (this);
- pid = parse_pid_to_attach (args);
+ pid_t pid = parse_pid_to_attach (args);
if (pid == getpid ()) /* Trying to masturbate? */
error (_("I refuse to debug myself!"));
- inf = current_inferior ();
-
target_unpush_up unpusher;
if (! ops_already_pushed)
{
inferior_appeared (inf, pid);
inf->attach_flag = 1;
- if (!target_is_pushed (ops))
+ if (!inf->target_is_pushed (ops))
inf->push_target (ops);
update_thread_list ();
/* warning( "Failed to set Kill-on-Last-Close flag: errno = %d(%s)\n",
errn, safe_strerror(errn) ); */
}
- if (!target_is_pushed (ops))
+ if (!inf->target_is_pushed (ops))
inf->push_target (ops);
target_terminal::init ();
/* Push the target if needed, ensure it gets un-pushed it if attach fails. */
target_unpush_up unpusher;
- if (!target_is_pushed (this))
+ if (!inf->target_is_pushed (this))
{
current_inferior ()->push_target (this);
unpusher.reset (this);
shell_file = tryname;
}
- if (!target_is_pushed (this))
+ if (!inf->target_is_pushed (this))
current_inferior ()->push_target (this);
pid = fork_inferior (exec_file, allargs, env, procfs_set_exec_trap,
pop_all_targets_above (dummy_stratum);
}
-/* Return true if T is now pushed in the current inferior's target
- stack. Return false otherwise. */
-
-bool
-target_is_pushed (target_ops *t)
-{
- return current_inferior ()->target_is_pushed (t);
-}
-
void
target_unpusher::operator() (struct target_ops *ops) const
{
void
target_close (struct target_ops *targ)
{
- gdb_assert (!target_is_pushed (targ));
+ gdb_assert (!current_inferior ()->target_is_pushed (targ));
fileio_handles_invalidate_target (targ);
strictly above ABOVE_STRATUM. */
extern void pop_all_targets_above (enum strata above_stratum);
-extern bool target_is_pushed (target_ops *t);
-
extern CORE_ADDR target_translate_tls_address (struct objfile *objfile,
CORE_ADDR offset);
current_event.dwProcessId = pid;
memset (¤t_event, 0, sizeof (current_event));
inf = current_inferior ();
- if (!target_is_pushed (this))
+ if (!inf->target_is_pushed (this))
inf->push_target (this);
disable_breakpoints_in_shlibs ();
windows_clear_solib ();