+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.
}
static char *
-darwin_pid_to_exec_file (int pid)
+darwin_pid_to_exec_file (struct target_ops *self, int pid)
{
char *path;
int res;
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));
/* 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
}
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. */
/* 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);
\f
/* Convert wait status STATUS to a string. Used for printing debug
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;
}
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;
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));
/* 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 */
(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);
}
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);
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;
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) (¤t_target, pid)
/* See the to_thread_architecture description in struct target_ops. */
}
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__