Add target_ops argument to to_pid_to_exec_file

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

	* windows-nat.c (windows_pid_to_exec_file): Add 'self' argument.
	* target.h (struct target_ops) <to_pid_to_exec_file>: Add
	argument.
	(target_pid_to_exec_file): Add argument.
	* target.c (debug_to_pid_to_exec_file): Add argument.
	(update_current_target): Update.
	* nbsd-nat.h (nbsd_pid_to_exec_file): Add 'self' argument.
	* nbsd-nat.c (nbsd_pid_to_exec_file): Add 'self' argument.
	* linux-nat.c (linux_child_pid_to_exec_file): Add 'self' argument.
	(linux_handle_extended_wait): Update.
	* inf-child.c (inf_child_pid_to_exec_file): Add 'self' argument.
	* fbsd-nat.h (fbsd_pid_to_exec_file): Add 'self' argument.
	* fbsd-nat.c (fbsd_pid_to_exec_file): Add 'self' argument.
	* darwin-nat.c (darwin_pid_to_exec_file): Add 'self' argument.
This commit is contained in:
Tom Tromey 2013-12-17 21:35:01 -07:00
parent 1aac633be6
commit 8dd27370eb
11 changed files with 32 additions and 15 deletions

View File

@ -1,3 +1,20 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_pid_to_exec_file): Add 'self' argument.
* target.h (struct target_ops) <to_pid_to_exec_file>: Add
argument.
(target_pid_to_exec_file): Add argument.
* target.c (debug_to_pid_to_exec_file): Add argument.
(update_current_target): Update.
* nbsd-nat.h (nbsd_pid_to_exec_file): Add 'self' argument.
* nbsd-nat.c (nbsd_pid_to_exec_file): Add 'self' argument.
* linux-nat.c (linux_child_pid_to_exec_file): Add 'self' argument.
(linux_handle_extended_wait): Update.
* inf-child.c (inf_child_pid_to_exec_file): Add 'self' argument.
* fbsd-nat.h (fbsd_pid_to_exec_file): Add 'self' argument.
* fbsd-nat.c (fbsd_pid_to_exec_file): Add 'self' argument.
* darwin-nat.c (darwin_pid_to_exec_file): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_rcmd>: Add argument.

View File

@ -1989,7 +1989,7 @@ set_enable_mach_exceptions (char *args, int from_tty,
}
static char *
darwin_pid_to_exec_file (int pid)
darwin_pid_to_exec_file (struct target_ops *self, int pid)
{
char *path;
int res;

View File

@ -37,7 +37,7 @@
the child process identified by PID. */
char *
fbsd_pid_to_exec_file (int pid)
fbsd_pid_to_exec_file (struct target_ops *self, int pid)
{
size_t len = PATH_MAX;
char *buf = xcalloc (len, sizeof (char));

View File

@ -23,7 +23,7 @@
/* Return the name of a file that can be opened to get the symbols for
the child process identified by PID. */
extern char *fbsd_pid_to_exec_file (int pid);
extern char *fbsd_pid_to_exec_file (struct target_ops *self, int pid);
/* Iterate over all the memory regions in the current inferior,
calling FUNC for each memory region. OBFD is passed as the last

View File

@ -134,7 +134,7 @@ inf_child_can_run (struct target_ops *self)
}
static char *
inf_child_pid_to_exec_file (int pid)
inf_child_pid_to_exec_file (struct target_ops *self, int pid)
{
/* This version of Unix doesn't support translation of a process ID
to the filename of the executable file. */

View File

@ -844,7 +844,7 @@ linux_nat_pass_signals (struct target_ops *self,
/* Prototypes for local functions. */
static int stop_wait_callback (struct lwp_info *lp, void *data);
static int linux_thread_alive (ptid_t ptid);
static char *linux_child_pid_to_exec_file (int pid);
static char *linux_child_pid_to_exec_file (struct target_ops *self, int pid);
/* Convert wait status STATUS to a string. Used for printing debug
@ -2193,7 +2193,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
ourstatus->kind = TARGET_WAITKIND_EXECD;
ourstatus->value.execd_pathname
= xstrdup (linux_child_pid_to_exec_file (pid));
= xstrdup (linux_child_pid_to_exec_file (NULL, pid));
return 0;
}
@ -4033,7 +4033,7 @@ linux_nat_thread_name (struct target_ops *self, struct thread_info *thr)
can be opened to get the symbols for the child process. */
static char *
linux_child_pid_to_exec_file (int pid)
linux_child_pid_to_exec_file (struct target_ops *self, int pid)
{
char *name1, *name2;

View File

@ -25,7 +25,7 @@
the child process identified by PID. */
char *
nbsd_pid_to_exec_file (int pid)
nbsd_pid_to_exec_file (struct target_ops *self, int pid)
{
size_t len = PATH_MAX;
char *buf = xcalloc (len, sizeof (char));

View File

@ -23,6 +23,6 @@
/* Return the name of a file that can be opened to get the symbols for
the child process identified by PID. */
extern char *nbsd_pid_to_exec_file (int pid);
extern char *nbsd_pid_to_exec_file (struct target_ops *self, int pid);
#endif /* nbsd-nat.h */

View File

@ -831,7 +831,7 @@ update_current_target (void)
(void (*) (struct target_ops *, char *, struct ui_file *))
tcomplain);
de_fault (to_pid_to_exec_file,
(char *(*) (int))
(char *(*) (struct target_ops *, int))
return_null);
de_fault (to_thread_architecture,
default_thread_architecture);
@ -5004,11 +5004,11 @@ debug_to_rcmd (struct target_ops *self, char *command,
}
static char *
debug_to_pid_to_exec_file (int pid)
debug_to_pid_to_exec_file (struct target_ops *self, int pid)
{
char *exec_file;
exec_file = debug_target.to_pid_to_exec_file (pid);
exec_file = debug_target.to_pid_to_exec_file (&debug_target, pid);
fprintf_unfiltered (gdb_stdlog, "target_pid_to_exec_file (%d) = %s\n",
pid, exec_file);

View File

@ -527,7 +527,7 @@ struct target_ops
void (*to_stop) (struct target_ops *, ptid_t);
void (*to_rcmd) (struct target_ops *,
char *command, struct ui_file *output);
char *(*to_pid_to_exec_file) (int pid);
char *(*to_pid_to_exec_file) (struct target_ops *, int pid);
void (*to_log_command) (const char *);
struct target_section_table *(*to_get_section_table) (struct target_ops *);
enum strata to_stratum;
@ -1545,7 +1545,7 @@ extern char *target_thread_name (struct thread_info *);
it must persist. */
#define target_pid_to_exec_file(pid) \
(current_target.to_pid_to_exec_file) (pid)
(current_target.to_pid_to_exec_file) (&current_target, pid)
/* See the to_thread_architecture description in struct target_ops. */

View File

@ -1994,7 +1994,7 @@ windows_detach (struct target_ops *ops, const char *args, int from_tty)
}
static char *
windows_pid_to_exec_file (int pid)
windows_pid_to_exec_file (struct target_ops *self, int pid)
{
static char path[__PMAX];
#ifdef __CYGWIN__