/* Default child (native) target interface, for GDB when running under
Unix.
- Copyright (C) 1988-2013 Free Software Foundation, Inc.
+ Copyright (C) 1988-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "symtab.h"
#include "target.h"
#include "inferior.h"
-#include "gdb_string.h"
-#include "gdb_stat.h"
+#include <string.h>
+#include <sys/stat.h>
#include "inf-child.h"
#include "gdb/fileio.h"
#include "agent.h"
}
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. */
program being debugged. */
static void
-inf_child_prepare_to_store (struct regcache *regcache)
+inf_child_prepare_to_store (struct target_ops *self,
+ struct regcache *regcache)
{
}
}
static void
-inf_child_post_startup_inferior (ptid_t ptid)
+inf_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
{
/* This version of Unix doesn't require a meaningful "post startup
inferior" operation by a debugger. */
}
static int
-inf_child_can_run (void)
+inf_child_can_run (struct target_ops *self)
{
return 1;
}
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. */
target file descriptor, or -1 if an error occurs (and set
*TARGET_ERRNO). */
static int
-inf_child_fileio_open (const char *filename, int flags, int mode,
+inf_child_fileio_open (struct target_ops *self,
+ const char *filename, int flags, int mode,
int *target_errno)
{
int nat_flags;
Return the number of bytes written, or -1 if an error occurs
(and set *TARGET_ERRNO). */
static int
-inf_child_fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
+inf_child_fileio_pwrite (struct target_ops *self,
+ int fd, const gdb_byte *write_buf, int len,
ULONGEST offset, int *target_errno)
{
int ret;
Return the number of bytes read, or -1 if an error occurs
(and set *TARGET_ERRNO). */
static int
-inf_child_fileio_pread (int fd, gdb_byte *read_buf, int len,
+inf_child_fileio_pread (struct target_ops *self,
+ int fd, gdb_byte *read_buf, int len,
ULONGEST offset, int *target_errno)
{
int ret;
/* Close FD on the target. Return 0, or -1 if an error occurs
(and set *TARGET_ERRNO). */
static int
-inf_child_fileio_close (int fd, int *target_errno)
+inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno)
{
int ret;
/* Unlink FILENAME on the target. Return 0, or -1 if an error
occurs (and set *TARGET_ERRNO). */
static int
-inf_child_fileio_unlink (const char *filename, int *target_errno)
+inf_child_fileio_unlink (struct target_ops *self,
+ const char *filename, int *target_errno)
{
int ret;
struct target_ops *
inf_child_target (void)
{
- struct target_ops *t = XZALLOC (struct target_ops);
+ struct target_ops *t = XCNEW (struct target_ops);
t->to_shortname = "child";
t->to_longname = "Unix child process";