[RFA] Kill ptrace_ops_hack

Joel Brobecker brobecker@adacore.com
Thu Sep 18 00:57:00 GMT 2008


Looks like the following patch was approved, but hasn't been checked in.
> 
> 	* target.h (struct target_ops): Make to_attach, to_detach,
> 	to_create_inferior and to_mourn_inferior accept a pointer
> 	to struct target_ops.
> 	(target_attach, target_create_inferior, target_create_inferior):
> 	Convert from macros to function.  Find the right target to
> 	invoke a method of.
> 	(find_default_attach, find_default_create_inferior): New parameter
> 	ops.
> 	* corefile.c (core_file_command): Pass target to to_detach.
> 	* corelow.c (core_detach): Add 'ops' parameter.
> 	* fork-child.c (fork_inferior): Return the pid.  Allow
> 	init_trace_fun to be NULL.
> 	* inf-ptrace (ptrace_ops_hack): Remove.
> 	(inf_ptrace_him): Remove, moving all logic into....
> 	(inf_ptrace_create_inferior): ... here.  Push the target
> 	passed as parameter.

Just noticed a minor thing:

  -  push_target (ptrace_ops_hack);
  +  int pid = fork_inferior (exec_file, allargs, env, inf_ptrace_me, NULL,
  +                          NULL, NULL);
  +
  +  push_target (ops);

Mark mentioned that he would prefer to have:

   int pid;

   pid = fork_inferior (...)

I have been hoping to contribute a couple of things, which include
thread support on Tru64. Hopefully I will get to that soon, and if
I beat to checking my patch in, you'll have to fix one extra file
(just teasing you :-).

-- 
Joel



More information about the Gdb-patches mailing list