GDB (xrefs)

Macros | Functions | Variables
/tmp/gdb-8.1/gdb/m68k-linux-nat.c File Reference
`#include "defs.h"`
`#include "frame.h"`
`#include "inferior.h"`
`#include "language.h"`
`#include "gdbcore.h"`
`#include "regcache.h"`
`#include "target.h"`
`#include "linux-nat.h"`
`#include "m68k-tdep.h"`
`#include <sys/dir.h>`
`#include <signal.h>`
`#include "nat/gdb_ptrace.h"`
`#include <sys/user.h>`
`#include <sys/ioctl.h>`
`#include <fcntl.h>`
`#include <sys/procfs.h>`
`#include <sys/reg.h>`
`#include <sys/file.h>`
`#include <sys/stat.h>`
`#include "floatformat.h"`
`#include "gregset.h"`
`#include "gdb_proc_service.h"`
`#include "inf-ptrace.h"`

Go to the source code of this file.

## Macros
#define | PTRACE_GET_THREAD_AREA 25
#define | NUM_GREGS (18)
#define | MAX_NUM_REGS (NUM_GREGS + 11)
#define | FPREG_ADDR(f, n) (&(f)->fpregs[(n) * 3])

## Functions
static int | getregs_supplies (int regno)
static int | getfpregs_supplies (int regno)
static void | fetch_register (struct regcache *regcache, int regno)
static void | old_fetch_inferior_registers (struct regcache *regcache, int regno)
static void | store_register (const struct regcache *regcache, int regno)
static void | old_store_inferior_registers (const struct regcache *regcache, int regno)
void | supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
void | fill_gregset (const struct regcache *regcache, elf_gregset_t *gregsetp, int regno)
static void | fetch_regs (struct regcache *regcache, int tid)
static void | store_regs (const struct regcache *regcache, int tid, int regno)
void | supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
void | fill_fpregset (const struct regcache *regcache, elf_fpregset_t *fpregsetp, int regno)
static void | fetch_fpregs (struct regcache *regcache, int tid)
static void | store_fpregs (const struct regcache *regcache, int tid, int regno)
static void | m68k_linux_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno)
static void | m68k_linux_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno)
ps_err_e | ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
void | _initialize_m68k_linux_nat (void)

## Variables
static const int | regmap []
static int | have_ptrace_getregs

## Macro Definition Documentation

## ◆ FPREG_ADDR

#define FPREG_ADDR | ( |  | f,
|  |  | n
| ) |  | (&(f)->fpregs[(n) * 3])

Definition at line 297 of file m68k-linux-nat.c.

Referenced by fill_fpregset(), and supply_fpregset().

## ◆ MAX_NUM_REGS

#define MAX_NUM_REGS (NUM_GREGS + 11)

Definition at line 75 of file m68k-linux-nat.c.

## ◆ NUM_GREGS

#define NUM_GREGS (18)

Definition at line 74 of file m68k-linux-nat.c.

Referenced by fill_gregset(), and getregs_supplies().

## ◆ PTRACE_GET_THREAD_AREA

#define PTRACE_GET_THREAD_AREA 25

Definition at line 57 of file m68k-linux-nat.c.

Referenced by ps_get_thread_area().

## Function Documentation

## ◆ _initialize_m68k_linux_nat()

void _initialize_m68k_linux_nat | ( | void |  | ) |

Definition at line 510 of file m68k-linux-nat.c.

References linux_nat_add_target(), linux_target(), m68k_linux_fetch_inferior_registers(), m68k_linux_store_inferior_registers(), target_ops::to_fetch_registers, and target_ops::to_store_registers.

## ◆ fetch_fpregs()

static void fetch_fpregs | ( | struct regcache * | regcache,
|  | int | tid
| ) |  |
| static

Definition at line 350 of file m68k-linux-nat.c.

References _, perror_with_name(), ptrace(), PTRACE_GETFPREGS, supply_fpregset(), and selftests::ptid::tid.

Referenced by m68k_linux_fetch_inferior_registers().

## ◆ fetch_register()

static void fetch_register | ( | struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 105 of file m68k-linux-nat.c.

References _, regcache::arch(), error(), gdbarch_register_name(), get_ptrace_pid(), gdb.printer.bound_registers::long, M68K_MAX_REGISTER_SIZE, ptrace(), regcache_get_ptid(), regcache_raw_supply(), register_size(), regmap, safe_strerror(), and selftests::ptid::tid.

Referenced by old_fetch_inferior_registers().

## ◆ fetch_regs()

static void fetch_regs | ( | struct regcache * | regcache,
|  | int | tid
| ) |  |
| static

Definition at line 244 of file m68k-linux-nat.c.

References _, have_ptrace_getregs, perror_with_name(), ptrace(), PTRACE_GETREGS, supply_gregset(), and selftests::ptid::tid.

Referenced by m68k_linux_fetch_inferior_registers().

## ◆ fill_fpregset()

void fill_fpregset | ( | const struct regcache * | regcache,
|  | elf_fpregset_t * | fpregsetp,
|  | int | regno
| ) |  |

Definition at line 323 of file m68k-linux-nat.c.

References regcache::arch(), FPREG_ADDR, gdbarch_fp0_regnum(), M68K_FPC_REGNUM, M68K_FPI_REGNUM, and regcache_raw_collect().

Referenced by store_fpregs().

## ◆ fill_gregset()

void fill_gregset | ( | const struct regcache * | regcache,
|  | elf_gregset_t * | gregsetp,
|  | int | regno
| ) |  |

Definition at line 227 of file m68k-linux-nat.c.

References NUM_GREGS, regcache_raw_collect(), and regmap.

Referenced by store_regs().

## ◆ getfpregs_supplies()

static int getfpregs_supplies | ( | int | regno | ) |
| static

Definition at line 84 of file m68k-linux-nat.c.

References M68K_FP0_REGNUM, and M68K_FPI_REGNUM.

Referenced by m68k_linux_fetch_inferior_registers(), and m68k_linux_store_inferior_registers().

## ◆ getregs_supplies()

static int getregs_supplies | ( | int | regno | ) |
| static

Definition at line 78 of file m68k-linux-nat.c.

References NUM_GREGS.

Referenced by m68k_linux_fetch_inferior_registers(), and m68k_linux_store_inferior_registers().

## ◆ m68k_linux_fetch_inferior_registers()

static void m68k_linux_fetch_inferior_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 396 of file m68k-linux-nat.c.

References _, fetch_fpregs(), fetch_regs(), get_ptrace_pid(), getfpregs_supplies(), getregs_supplies(), have_ptrace_getregs, internal_error(), old_fetch_inferior_registers(), regcache_get_ptid(), and selftests::ptid::tid.

Referenced by _initialize_m68k_linux_nat().

## ◆ m68k_linux_store_inferior_registers()

static void m68k_linux_store_inferior_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 450 of file m68k-linux-nat.c.

References _, get_ptrace_pid(), getfpregs_supplies(), getregs_supplies(), have_ptrace_getregs, internal_error(), old_store_inferior_registers(), regcache_get_ptid(), store_fpregs(), store_regs(), and selftests::ptid::tid.

Referenced by _initialize_m68k_linux_nat().

## ◆ old_fetch_inferior_registers()

static void old_fetch_inferior_registers | ( | struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 133 of file m68k-linux-nat.c.

References regcache::arch(), fetch_register(), and gdbarch_num_regs().

Referenced by m68k_linux_fetch_inferior_registers().

## ◆ old_store_inferior_registers()

static void old_store_inferior_registers | ( | const struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 185 of file m68k-linux-nat.c.

References regcache::arch(), gdbarch_num_regs(), and store_register().

Referenced by m68k_linux_store_inferior_registers().

## ◆ ps_get_thread_area()

ps_err_e ps_get_thread_area | ( | struct ps_prochandle * | ph,
|  | lwpid_t | lwpid,
|  | int | idx,
|  | void ** | base
| ) |  |

Definition at line 495 of file m68k-linux-nat.c.

References PS_ERR, PS_OK, ptrace(), and PTRACE_GET_THREAD_AREA.

## ◆ store_fpregs()

static void store_fpregs | ( | const struct regcache * | regcache,
|  | int | tid,
|  | int | regno
| ) |  |
| static

Definition at line 364 of file m68k-linux-nat.c.

References _, fill_fpregset(), perror_with_name(), ptrace(), PTRACE_GETFPREGS, PTRACE_SETFPREGS, and selftests::ptid::tid.

Referenced by m68k_linux_store_inferior_registers().

## ◆ store_register()

static void store_register | ( | const struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 153 of file m68k-linux-nat.c.

References _, regcache::arch(), error(), gdbarch_register_name(), get_ptrace_pid(), gdb.printer.bound_registers::long, M68K_MAX_REGISTER_SIZE, ptrace(), regcache_get_ptid(), regcache_raw_collect(), register_size(), regmap, safe_strerror(), and selftests::ptid::tid.

Referenced by old_store_inferior_registers().

## ◆ store_regs()

static void store_regs | ( | const struct regcache * | regcache,
|  | int | tid,
|  | int | regno
| ) |  |
| static

Definition at line 268 of file m68k-linux-nat.c.

References _, fill_gregset(), perror_with_name(), ptrace(), PTRACE_GETREGS, PTRACE_SETREGS, and selftests::ptid::tid.

Referenced by m68k_linux_store_inferior_registers().

## ◆ supply_fpregset()

void supply_fpregset | ( | struct regcache * | regcache,
|  | const elf_fpregset_t * | fpregsetp
| ) |  |

Definition at line 303 of file m68k-linux-nat.c.

References regcache::arch(), FPREG_ADDR, gdbarch_fp0_regnum(), M68K_FPC_REGNUM, M68K_FPI_REGNUM, M68K_FPS_REGNUM, and regcache_raw_supply().

Referenced by fetch_fpregs().

## ◆ supply_gregset()

void supply_gregset | ( | struct regcache * | regcache,
|  | const elf_gregset_t * | gregsetp
| ) |  |

Definition at line 207 of file m68k-linux-nat.c.

References regcache::arch(), gdbarch_pc_regnum(), gdbarch_ps_regnum(), gdbarch_sp_regnum(), M68K_D0_REGNUM, regcache_raw_supply(), and regmap.

Referenced by fetch_regs().

## Variable Documentation

## ◆ have_ptrace_getregs

int have_ptrace_getregs
| static

Initial value:
=
1

Definition at line 90 of file m68k-linux-nat.c.

Referenced by fetch_regs(), m68k_linux_fetch_inferior_registers(), and m68k_linux_store_inferior_registers().

## ◆ regmap

const int regmap[]
| static

Initial value:
=
{
PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7,
PT_A0, PT_A1, PT_A2, PT_A3, PT_A4, PT_A5, PT_A6, PT_USP,
PT_SR, PT_PC,
21, 24, 27, 30, 33, 36, 39, 42,
45, 46, 47
}

Definition at line 61 of file m68k-linux-nat.c.

Referenced by fetch_register(), fill_gregset(), store_register(), and supply_gregset().