GDB (xrefs)

Macros | Functions | Variables
/tmp/gdb-8.1/gdb/bsd-kvm.c File Reference
`#include "defs.h"`
`#include "cli/cli-cmds.h"`
`#include "command.h"`
`#include "frame.h"`
`#include "regcache.h"`
`#include "target.h"`
`#include "value.h"`
`#include "gdbcore.h"`
`#include "gdbthread.h"`
`#include <fcntl.h>`
`#include <kvm.h>`
`#include <paths.h>`
`#include "readline/readline.h"`
`#include <sys/param.h>`
`#include <sys/proc.h>`
`#include <sys/user.h>`
`#include "bsd-kvm.h"`

Go to the source code of this file.

## Macros
#define | _KMEMUSER

## Functions
static void | bsd_kvm_open (const char *arg, int from_tty)
static void | bsd_kvm_close (struct target_ops *self)
static LONGEST | bsd_kvm_xfer_memory (CORE_ADDR addr, ULONGEST len, gdb_byte *readbuf, const gdb_byte *writebuf)
static enum target_xfer_status | bsd_kvm_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
static void | bsd_kvm_files_info (struct target_ops *ops)
static int | bsd_kvm_fetch_pcb (struct regcache *regcache, struct pcb *paddr)
static void | bsd_kvm_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
static void | bsd_kvm_cmd (const char *arg, int fromtty)
static void | bsd_kvm_proc_cmd (const char *arg, int fromtty)
static void | bsd_kvm_pcb_cmd (const char *arg, int fromtty)
static int | bsd_kvm_thread_alive (struct target_ops *ops, ptid_t ptid)
static const char * | bsd_kvm_pid_to_str (struct target_ops *ops, ptid_t ptid)
static int | bsd_kvm_return_one (struct target_ops *ops)
void | bsd_kvm_add_target (int(*supply_pcb)(struct regcache *, struct pcb *))

## Variables
static const char * | bsd_kvm_corefile
static kvm_t * | core_kd
static struct pcb * | bsd_kvm_paddr
static int(* | bsd_kvm_supply_pcb )(struct regcache *regcache, struct pcb *pcb)
static struct target_ops | bsd_kvm_ops
static ptid_t | bsd_kvm_ptid
struct cmd_list_element * | bsd_kvm_cmdlist

## Macro Definition Documentation

## ◆ _KMEMUSER

#define _KMEMUSER

Definition at line 20 of file bsd-kvm.c.

## Function Documentation

## ◆ bsd_kvm_add_target()

void bsd_kvm_add_target | ( | int(*)(struct regcache *, struct pcb *) | supply_pcb | ) |

Definition at line 354 of file bsd-kvm.c.

References _, add_cmd(), add_prefix_cmd(), add_target(), bsd_kvm_close(), bsd_kvm_cmd(), bsd_kvm_cmdlist, bsd_kvm_fetch_registers(), bsd_kvm_files_info(), bsd_kvm_open(), bsd_kvm_ops, bsd_kvm_pcb_cmd(), bsd_kvm_pid_to_str(), bsd_kvm_proc_cmd(), bsd_kvm_ptid, bsd_kvm_return_one(), bsd_kvm_supply_pcb, bsd_kvm_thread_alive(), bsd_kvm_xfer_partial(), class_obscure, cmdlist, gdb_assert, OPS_MAGIC, process_stratum, ptid_build(), target_ops::to_close, target_ops::to_doc, target_ops::to_fetch_registers, target_ops::to_files_info, target_ops::to_has_memory, target_ops::to_has_registers, target_ops::to_has_stack, target_ops::to_longname, target_ops::to_magic, target_ops::to_open, target_ops::to_pid_to_str, target_ops::to_shortname, target_ops::to_stratum, target_ops::to_thread_alive, and target_ops::to_xfer_partial.

Referenced by _initialize_alphabsd_nat(), _initialize_amd64fbsd_nat(), _initialize_amd64obsd_nat(), _initialize_i386fbsd_nat(), _initialize_i386nbsd_nat(), _initialize_i386obsd_nat(), _initialize_m68kbsd_nat(), _initialize_ppcfbsd_nat(), _initialize_ppcnbsd_nat(), _initialize_ppcobsd_nat(), _initialize_sparc64fbsd_nat(), _initialize_sparc64nbsd_nat(), _initialize_sparc64obsd_nat(), _initialize_sparcnbsd_nat(), and _initialize_vaxbsd_nat().

## ◆ bsd_kvm_close()

static void bsd_kvm_close | ( | struct target_ops * | self | ) |
| static

Definition at line 111 of file bsd-kvm.c.

References bsd_kvm_ptid, core_kd, delete_thread_silent(), inferior_ptid, null_ptid, and warning().

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_cmd()

static void bsd_kvm_cmd | ( | const char * | arg,
|  | int | fromtty
| ) |  |
| static

Definition at line 274 of file bsd-kvm.c.

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_fetch_pcb()

static int bsd_kvm_fetch_pcb | ( | struct regcache * | regcache,
|  | struct pcb * | paddr
| ) |  |
| static

Definition at line 178 of file bsd-kvm.c.

References bsd_kvm_supply_pcb, core_kd, error(), and gdb_assert.

Referenced by bsd_kvm_fetch_registers().

## ◆ bsd_kvm_fetch_registers()

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

Definition at line 190 of file bsd-kvm.c.

References _, bsd_kvm_fetch_pcb(), bsd_kvm_paddr, core_kd, error(), and memset().

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_files_info()

static void bsd_kvm_files_info | ( | struct target_ops * | ops | ) |
| static

Definition at line 166 of file bsd-kvm.c.

References _, bsd_kvm_corefile, and printf_filtered().

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_open()

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

Definition at line 68 of file bsd-kvm.c.

References add_thread_silent(), bsd_kvm_corefile, bsd_kvm_ops, bsd_kvm_ptid, core_kd, current_directory, error(), get_current_regcache(), get_exec_file(), get_selected_frame(), inferior_ptid, print_stack_frame(), push_target(), reinit_frame_cache(), SRC_AND_LOC, target_fetch_registers(), target_preopen(), unpush_target(), write_files, and xfree().

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_pcb_cmd()

static void bsd_kvm_pcb_cmd | ( | const char * | arg,
|  | int | fromtty
| ) |  |
| static

Definition at line 311 of file bsd-kvm.c.

References _, bsd_kvm_paddr, core_kd, error(), error_no_arg(), get_current_regcache(), get_selected_frame(), parse_and_eval_address(), print_stack_frame(), reinit_frame_cache(), SRC_AND_LOC, and target_fetch_registers().

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_pid_to_str()

static const char* bsd_kvm_pid_to_str | ( | struct target_ops * | ops,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 336 of file bsd-kvm.c.

References xsnprintf().

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_proc_cmd()

static void bsd_kvm_proc_cmd | ( | const char * | arg,
|  | int | fromtty
| ) |  |
| static

Definition at line 282 of file bsd-kvm.c.

References _, bsd_kvm_paddr, core_kd, error(), error_no_arg(), get_current_regcache(), get_selected_frame(), selftests::ptid::lwp, parse_and_eval_address(), print_stack_frame(), reinit_frame_cache(), SRC_AND_LOC, and target_fetch_registers().

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_return_one()

static int bsd_kvm_return_one | ( | struct target_ops * | ops | ) |
| static

Definition at line 344 of file bsd-kvm.c.

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_thread_alive()

static int bsd_kvm_thread_alive | ( | struct target_ops * | ops,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 329 of file bsd-kvm.c.

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_xfer_memory()

static LONGEST bsd_kvm_xfer_memory | ( | CORE_ADDR | addr,
|  | ULONGEST | len,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf
| ) |  |
| static

Definition at line 125 of file bsd-kvm.c.

References core_kd.

Referenced by bsd_kvm_xfer_partial().

## ◆ bsd_kvm_xfer_partial()

static enum target_xfer_status bsd_kvm_xfer_partial | ( | struct target_ops * | ops,
|  | enum target_object | object,
|  | const char * | annex,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf,
|  | ULONGEST | offset,
|  | ULONGEST | len,
|  | ULONGEST * | xfered_len
| ) |  |
| static

Definition at line 138 of file bsd-kvm.c.

References bsd_kvm_xfer_memory(), offset, TARGET_OBJECT_MEMORY, TARGET_XFER_E_IO, TARGET_XFER_EOF, and TARGET_XFER_OK.

Referenced by bsd_kvm_add_target().

## Variable Documentation

## ◆ bsd_kvm_cmdlist

struct cmd_list_element* bsd_kvm_cmdlist

Definition at line 271 of file bsd-kvm.c.

Referenced by bsd_kvm_add_target().

## ◆ bsd_kvm_corefile

const char* bsd_kvm_corefile
| static

Definition at line 47 of file bsd-kvm.c.

Referenced by bsd_kvm_files_info(), and bsd_kvm_open().

## ◆ bsd_kvm_ops

struct target_ops bsd_kvm_ops
| static

Definition at line 60 of file bsd-kvm.c.

Referenced by bsd_kvm_add_target(), and bsd_kvm_open().

## ◆ bsd_kvm_paddr

struct pcb* bsd_kvm_paddr
| static

Definition at line 53 of file bsd-kvm.c.

Referenced by bsd_kvm_fetch_registers(), bsd_kvm_pcb_cmd(), and bsd_kvm_proc_cmd().

## ◆ bsd_kvm_ptid

ptid_t bsd_kvm_ptid
| static

Definition at line 65 of file bsd-kvm.c.

Referenced by bsd_kvm_add_target(), bsd_kvm_close(), and bsd_kvm_open().

## ◆ bsd_kvm_supply_pcb

int(* bsd_kvm_supply_pcb) (struct regcache *regcache, struct pcb *pcb)
| static

Definition at line 57 of file bsd-kvm.c.

Referenced by bsd_kvm_add_target(), and bsd_kvm_fetch_pcb().

## ◆ core_kd

kvm_t* core_kd
| static

Definition at line 50 of file bsd-kvm.c.

Referenced by bsd_kvm_close(), bsd_kvm_fetch_pcb(), bsd_kvm_fetch_registers(), bsd_kvm_open(), bsd_kvm_pcb_cmd(), bsd_kvm_proc_cmd(), and bsd_kvm_xfer_memory().