GDB (xrefs)

Functions | Variables
/tmp/gdb-8.1/gdb/inf-child.c File Reference
`#include "defs.h"`
`#include "regcache.h"`
`#include "memattr.h"`
`#include "symtab.h"`
`#include "target.h"`
`#include "inferior.h"`
`#include <sys/stat.h>`
`#include "inf-child.h"`
`#include "fileio.h"`
`#include "agent.h"`
`#include "gdb_wait.h"`
`#include "filestuff.h"`
`#include <sys/types.h>`
`#include <fcntl.h>`
`#include <unistd.h>`

Go to the source code of this file.

## Functions
void | store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus)
static void | inf_child_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
static void | inf_child_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
static void | inf_child_post_attach (struct target_ops *self, int pid)
static void | inf_child_prepare_to_store (struct target_ops *self, struct regcache *regcache)
void | inf_child_open_target (struct target_ops *target, const char *arg, int from_tty)
static void | inf_child_open (const char *arg, int from_tty)
static void | inf_child_disconnect (struct target_ops *target, const char *args, int from_tty)
static void | inf_child_close (struct target_ops *target)
void | inf_child_mourn_inferior (struct target_ops *ops)
void | inf_child_maybe_unpush_target (struct target_ops *ops)
static void | inf_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
static int | inf_child_follow_fork (struct target_ops *ops, int follow_child, int detach_fork)
static int | inf_child_can_run (struct target_ops *self)
static char * | inf_child_pid_to_exec_file (struct target_ops *self, int pid)
static int | inf_child_fileio_open (struct target_ops *self, struct inferior *inf, const char *filename, int flags, int mode, int warn_if_slow, int *target_errno)
static int | inf_child_fileio_pwrite (struct target_ops *self, int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno)
static int | inf_child_fileio_pread (struct target_ops *self, int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno)
static int | inf_child_fileio_fstat (struct target_ops *self, int fd, struct stat *sb, int *target_errno)
static int | inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno)
static int | inf_child_fileio_unlink (struct target_ops *self, struct inferior *inf, const char *filename, int *target_errno)
static char * | inf_child_fileio_readlink (struct target_ops *self, struct inferior *inf, const char *filename, int *target_errno)
static int | inf_child_use_agent (struct target_ops *self, int use)
static int | inf_child_can_use_agent (struct target_ops *self)
static int | return_zero (struct target_ops *ignore)
struct target_ops * | inf_child_target (void)

## Variables
static struct target_ops * | inf_child_ops = NULL
static int | inf_child_explicitly_opened

## Function Documentation

## ◆ inf_child_can_run()

static int inf_child_can_run | ( | struct target_ops * | self | ) |
| static

Definition at line 194 of file inf-child.c.

Referenced by inf_child_target().

## ◆ inf_child_can_use_agent()

static int inf_child_can_use_agent | ( | struct target_ops * | self | ) |
| static

Definition at line 378 of file inf-child.c.

References agent_loaded_p().

Referenced by inf_child_target().

## ◆ inf_child_close()

static void inf_child_close | ( | struct target_ops * | target | ) |
| static

Definition at line 156 of file inf-child.c.

References inf_child_explicitly_opened.

Referenced by inf_child_target().

## ◆ inf_child_disconnect()

static void inf_child_disconnect | ( | struct target_ops * | target,
|  | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 143 of file inf-child.c.

References _, error(), and target_preopen().

Referenced by inf_child_target().

## ◆ inf_child_fetch_inferior_registers()

static void inf_child_fetch_inferior_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 74 of file inf-child.c.

References regcache::arch(), gdbarch_num_regs(), regcache_raw_supply(), and regnum.

Referenced by inf_child_target().

## ◆ inf_child_fileio_close()

static int inf_child_fileio_close | ( | struct target_ops * | self,
|  | int | fd,
|  | int * | target_errno
| ) |  |
| static

Definition at line 307 of file inf-child.c.

References host_to_fileio_error().

Referenced by inf_child_target().

## ◆ inf_child_fileio_fstat()

static int inf_child_fileio_fstat | ( | struct target_ops * | self,
|  | int | fd,
|  | struct stat * | sb,
|  | int * | target_errno
| ) |  |
| static

Definition at line 292 of file inf-child.c.

References host_to_fileio_error().

Referenced by inf_child_target().

## ◆ inf_child_fileio_open()

static int inf_child_fileio_open | ( | struct target_ops * | self,
|  | struct inferior * | inf,
|  | const char * | filename,
|  | int | flags,
|  | int | mode,
|  | int | warn_if_slow,
|  | int * | target_errno
| ) |  |
| static

Definition at line 210 of file inf-child.c.

References fileio_to_host_mode(), fileio_to_host_openflags(), flags, gdb_open_cloexec(), and host_to_fileio_error().

Referenced by inf_child_target().

## ◆ inf_child_fileio_pread()

static int inf_child_fileio_pread | ( | struct target_ops * | self,
|  | int | fd,
|  | gdb_byte * | read_buf,
|  | int | len,
|  | ULONGEST | offset,
|  | int * | target_errno
| ) |  |
| static

Definition at line 264 of file inf-child.c.

References host_to_fileio_error(), offset, read(), and SEEK_SET.

Referenced by inf_child_target().

## ◆ inf_child_fileio_pwrite()

static int inf_child_fileio_pwrite | ( | struct target_ops * | self,
|  | int | fd,
|  | const gdb_byte * | write_buf,
|  | int | len,
|  | ULONGEST | offset,
|  | int * | target_errno
| ) |  |
| static

Definition at line 236 of file inf-child.c.

References host_to_fileio_error(), offset, and SEEK_SET.

Referenced by inf_child_target().

## ◆ inf_child_fileio_readlink()

static char* inf_child_fileio_readlink | ( | struct target_ops * | self,
|  | struct inferior * | inf,
|  | const char * | filename,
|  | int * | target_errno
| ) |  |
| static

Definition at line 337 of file inf-child.c.

References host_to_fileio_error(), and xmalloc().

Referenced by inf_child_target().

## ◆ inf_child_fileio_unlink()

static int inf_child_fileio_unlink | ( | struct target_ops * | self,
|  | struct inferior * | inf,
|  | const char * | filename,
|  | int * | target_errno
| ) |  |
| static

Definition at line 321 of file inf-child.c.

References host_to_fileio_error().

Referenced by inf_child_target().

## ◆ inf_child_follow_fork()

static int inf_child_follow_fork | ( | struct target_ops * | ops,
|  | int | follow_child,
|  | int | detach_fork
| ) |  |
| static

Definition at line 186 of file inf-child.c.

Referenced by inf_child_target().

## ◆ inf_child_maybe_unpush_target()

void inf_child_maybe_unpush_target | ( | struct target_ops * | ops | ) |

Definition at line 172 of file inf-child.c.

References have_inferiors(), inf_child_explicitly_opened, and unpush_target().

Referenced by gnu_detach(), go32_mourn_inferior(), inf_child_mourn_inferior(), inf_ptrace_detach_success(), procfs_detach(), procfs_mourn_inferior(), and windows_detach().

## ◆ inf_child_mourn_inferior()

void inf_child_mourn_inferior | ( | struct target_ops * | ops | ) |

Definition at line 163 of file inf-child.c.

References generic_mourn_inferior(), and inf_child_maybe_unpush_target().

Referenced by darwin_mourn_inferior(), gnu_mourn_inferior(), inf_ptrace_mourn_inferior(), procfs_mourn_inferior(), and windows_mourn_inferior().

## ◆ inf_child_open()

static void inf_child_open | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 135 of file inf-child.c.

References inf_child_open_target(), and inf_child_ops.

Referenced by inf_child_target().

## ◆ inf_child_open_target()

void inf_child_open_target | ( | struct target_ops * | target,
|  | const char * | arg,
|  | int | from_tty
| ) |  |

Definition at line 124 of file inf-child.c.

References inf_child_explicitly_opened, printf_filtered(), push_target(), and target_preopen().

Referenced by inf_child_open(), and procfs_open_1().

## ◆ inf_child_pid_to_exec_file()

static char* inf_child_pid_to_exec_file | ( | struct target_ops * | self,
|  | int | pid
| ) |  |
| static

Definition at line 200 of file inf-child.c.

Referenced by inf_child_target().

## ◆ inf_child_post_attach()

static void inf_child_post_attach | ( | struct target_ops * | self,
|  | int | pid
| ) |  |
| static

Definition at line 98 of file inf-child.c.

Referenced by inf_child_target().

## ◆ inf_child_post_startup_inferior()

static void inf_child_post_startup_inferior | ( | struct target_ops * | self,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 179 of file inf-child.c.

Referenced by inf_child_target().

## ◆ inf_child_prepare_to_store()

static void inf_child_prepare_to_store | ( | struct target_ops * | self,
|  | struct regcache * | regcache
| ) |  |
| static

Definition at line 111 of file inf-child.c.

Referenced by inf_child_target().

## ◆ inf_child_store_inferior_registers()

static void inf_child_store_inferior_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 92 of file inf-child.c.

Referenced by inf_child_target().

## ◆ inf_child_target()

struct target_ops* inf_child_target | ( | void |  | ) |

Definition at line 393 of file inf-child.c.

References child_terminal_inferior(), child_terminal_info(), child_terminal_init(), child_terminal_ours(), child_terminal_ours_for_output(), default_child_has_all_memory(), default_child_has_execution(), default_child_has_memory(), default_child_has_registers(), default_child_has_stack(), inf_child_can_run(), inf_child_can_use_agent(), inf_child_close(), inf_child_disconnect(), inf_child_fetch_inferior_registers(), inf_child_fileio_close(), inf_child_fileio_fstat(), inf_child_fileio_open(), inf_child_fileio_pread(), inf_child_fileio_pwrite(), inf_child_fileio_readlink(), inf_child_fileio_unlink(), inf_child_follow_fork(), inf_child_open(), inf_child_ops, inf_child_pid_to_exec_file(), inf_child_post_attach(), inf_child_post_startup_inferior(), inf_child_prepare_to_store(), inf_child_store_inferior_registers(), inf_child_use_agent(), memory_insert_breakpoint(), memory_remove_breakpoint(), OPS_MAGIC, process_stratum, return_zero(), target_ops::to_can_async_p, target_ops::to_can_run, target_ops::to_can_use_agent, target_ops::to_close, target_ops::to_disconnect, target_ops::to_doc, target_ops::to_fetch_registers, target_ops::to_fileio_close, target_ops::to_fileio_fstat, target_ops::to_fileio_open, target_ops::to_fileio_pread, target_ops::to_fileio_pwrite, target_ops::to_fileio_readlink, target_ops::to_fileio_unlink, target_ops::to_follow_fork, target_ops::to_has_all_memory, target_ops::to_has_execution, target_ops::to_has_memory, target_ops::to_has_registers, target_ops::to_has_stack, target_ops::to_insert_breakpoint, target_ops::to_longname, target_ops::to_magic, target_ops::to_open, target_ops::to_pid_to_exec_file, target_ops::to_post_attach, target_ops::to_post_startup_inferior, target_ops::to_prepare_to_store, target_ops::to_remove_breakpoint, target_ops::to_shortname, target_ops::to_store_registers, target_ops::to_stratum, target_ops::to_supports_non_stop, target_ops::to_terminal_inferior, target_ops::to_terminal_info, target_ops::to_terminal_init, target_ops::to_terminal_ours, target_ops::to_terminal_ours_for_output, target_ops::to_use_agent, and XCNEW.

Referenced by _initialize_darwin_inferior(), gnu_target(), go32_target(), inf_ptrace_target(), init_procfs_targets(), procfs_target(), and windows_target().

## ◆ inf_child_use_agent()

static int inf_child_use_agent | ( | struct target_ops * | self,
|  | int | use
| ) |  |
| static

Definition at line 366 of file inf-child.c.

References agent_loaded_p(), and use_agent.

Referenced by inf_child_target().

## ◆ return_zero()

static int return_zero | ( | struct target_ops * | ignore | ) |
| static

Definition at line 387 of file inf-child.c.

Referenced by inf_child_target().

## ◆ store_waitstatus()

void store_waitstatus | ( | struct target_waitstatus * | ourstatus,
|  | int | hoststatus
| ) |  |

Definition at line 51 of file inf-child.c.

References gdb_signal_from_host(), target_waitstatus::integer, target_waitstatus::kind, target_waitstatus::sig, TARGET_WAITKIND_EXITED, TARGET_WAITKIND_SIGNALLED, TARGET_WAITKIND_STOPPED, target_waitstatus::value, WEXITSTATUS, WIFEXITED, WIFSTOPPED, WSTOPSIG, and WTERMSIG.

Referenced by if(), inf_ptrace_wait(), linux_nat_filter_event(), linux_nat_wait_1(), procfs_wait(), rs6000_wait(), spu_child_wait(), and wait_lwp().

## Variable Documentation

## ◆ inf_child_explicitly_opened

int inf_child_explicitly_opened
| static

Definition at line 119 of file inf-child.c.

Referenced by inf_child_close(), inf_child_maybe_unpush_target(), and inf_child_open_target().

## ◆ inf_child_ops

struct target_ops* inf_child_ops = NULL
| static

Definition at line 45 of file inf-child.c.

Referenced by inf_child_open(), and inf_child_target().