Add target_ops argument to to_post_attach

2014-02-19  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_post_attach>: Add argument.
	(target_post_attach): Add argument.
	* target.c (debug_to_post_attach): Add argument.
	(update_current_target): Update.
	* spu-linux-nat.c (spu_child_post_attach): Add 'self' argument.
	* nto-procfs.c (procfs_post_attach): Add 'self' argument.
	* linux-nat.c (linux_child_post_attach): Add 'self' argument.
	* inf-ptrace.c (inf_ptrace_post_attach): Add 'self' argument.
	* inf-child.c (inf_child_post_attach): Add 'self' argument.
This commit is contained in:
Tom Tromey 2013-12-17 21:28:08 -07:00
parent de90e03d4c
commit f045800c90
8 changed files with 22 additions and 10 deletions

View File

@ -1,3 +1,15 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_post_attach>: Add argument.
(target_post_attach): Add argument.
* target.c (debug_to_post_attach): Add argument.
(update_current_target): Update.
* spu-linux-nat.c (spu_child_post_attach): Add 'self' argument.
* nto-procfs.c (procfs_post_attach): Add 'self' argument.
* linux-nat.c (linux_child_post_attach): Add 'self' argument.
* inf-ptrace.c (inf_ptrace_post_attach): Add 'self' argument.
* inf-child.c (inf_child_post_attach): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_close): Add 'self' argument.

View File

@ -87,7 +87,7 @@ inf_child_store_inferior_registers (struct target_ops *ops,
}
static void
inf_child_post_attach (int pid)
inf_child_post_attach (struct target_ops *self, int pid)
{
/* This version of Unix doesn't require a meaningful "post attach"
operation by a debugger. */

View File

@ -246,7 +246,7 @@ inf_ptrace_attach (struct target_ops *ops, char *args, int from_tty)
#ifdef PT_GET_PROCESS_STATE
static void
inf_ptrace_post_attach (int pid)
inf_ptrace_post_attach (struct target_ops *self, int pid)
{
ptrace_event_t pe;

View File

@ -329,7 +329,7 @@ linux_init_ptrace (pid_t pid)
}
static void
linux_child_post_attach (int pid)
linux_child_post_attach (struct target_ops *self, int pid)
{
linux_init_ptrace (pid);
}

View File

@ -648,7 +648,7 @@ procfs_attach (struct target_ops *ops, char *args, int from_tty)
}
static void
procfs_post_attach (pid_t pid)
procfs_post_attach (struct target_ops *self, pid_t pid)
{
if (exec_bfd)
solib_create_inferior_hook (0);

View File

@ -420,7 +420,7 @@ spu_child_post_startup_inferior (ptid_t ptid)
/* Override the post_attach routine to try load the SPE executable
file image from its copy inside the target process. */
static void
spu_child_post_attach (int pid)
spu_child_post_attach (struct target_ops *self, int pid)
{
int fd;
ULONGEST addr;

View File

@ -721,7 +721,7 @@ update_current_target (void)
(void (*) (struct target_ops *))
target_ignore);
de_fault (to_post_attach,
(void (*) (int))
(void (*) (struct target_ops *, int))
target_ignore);
de_fault (to_prepare_to_store,
(void (*) (struct target_ops *, struct regcache *))
@ -3914,9 +3914,9 @@ target_stop (ptid_t ptid)
}
static void
debug_to_post_attach (int pid)
debug_to_post_attach (struct target_ops *self, int pid)
{
debug_target.to_post_attach (pid);
debug_target.to_post_attach (&debug_target, pid);
fprintf_unfiltered (gdb_stdlog, "target_post_attach (%d)\n", pid);
}

View File

@ -404,7 +404,7 @@ struct target_ops
void (*to_xclose) (struct target_ops *targ);
void (*to_close) (struct target_ops *);
void (*to_attach) (struct target_ops *ops, char *, int);
void (*to_post_attach) (int);
void (*to_post_attach) (struct target_ops *, int);
void (*to_detach) (struct target_ops *ops, const char *, int);
void (*to_disconnect) (struct target_ops *, char *, int);
void (*to_resume) (struct target_ops *, ptid_t, int, enum gdb_signal)
@ -1019,7 +1019,7 @@ void target_attach (char *, int);
This operation provides a target-specific hook that allows the
necessary bookkeeping to be performed after an attach completes. */
#define target_post_attach(pid) \
(*current_target.to_post_attach) (pid)
(*current_target.to_post_attach) (&current_target, pid)
/* Takes a program previously attached to and detaches it.
The program may resume execution (some targets do, some don't) and will