This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Remove unecessary checks for macros in target.h
> However, I do wonder if it would make sense to remove the macros
> altogether, and just push the expansions down into the code. If we
> really don't want to be able to switch in different implementations of
> these things, what is the point of an added layer of abstraction?
Eventually, we'll want these macros to be functions, I think.
I'd personally like it if they all had the target_ops as the first
parameter, so that the target function can find the "target beneath"
and call its associated routine if needed. For instance:
static void
sol_thread_detach (struct target_ops *ops, char *args, int from_tty)
{
struct target_ops *beneath = find_target_beneath (ops);
sol_thread_active = 0;
inferior_ptid = pid_to_ptid (PIDGET (main_ph.ptid));
unpush_target (ops);
beneath->to_detach (beneath, args, from_tty);
}
--
Joel