GDB (xrefs)
Classes | Macros | Typedefs | Functions | Variables
/tmp/gdb-8.1/gdb/s390-linux-nat.c File Reference
#include "defs.h"
#include "regcache.h"
#include "inferior.h"
#include "target.h"
#include "linux-nat.h"
#include "auxv.h"
#include "gregset.h"
#include "regset.h"
#include "nat/linux-ptrace.h"
#include "gdbcmd.h"
#include "s390-linux-tdep.h"
#include "elf/common.h"
#include <asm/ptrace.h>
#include "nat/gdb_ptrace.h"
#include <asm/types.h>
#include <sys/procfs.h>
#include <sys/ucontext.h>
#include <elf.h>
#include <algorithm>
#include "inf-ptrace.h"

Go to the source code of this file.

Classes

struct  arch_lwp_info
 
struct  watch_area
 
struct  s390_debug_reg_state
 
struct  s390_process_info
 

Macros

#define PER_BIT(n)   (1UL << (63 - (n)))
 
#define PER_EVENT_BRANCH   PER_BIT (32)
 
#define PER_EVENT_IFETCH   PER_BIT (33)
 
#define PER_EVENT_STORE   PER_BIT (34)
 
#define PER_EVENT_NULLIFICATION   PER_BIT (39)
 
#define PER_CONTROL_BRANCH_ADDRESS   PER_BIT (40)
 
#define PER_CONTROL_SUSPENSION   PER_BIT (41)
 
#define PER_CONTROL_ALTERATION   PER_BIT (42)
 

Typedefs

typedef struct watch_area s390_watch_area
 

Functions

void supply_gregset (struct regcache *regcache, const gregset_t *regp)
 
void fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
 
void supply_fpregset (struct regcache *regcache, const fpregset_t *regp)
 
void fill_fpregset (const struct regcache *regcache, fpregset_t *regp, int regno)
 
static int s390_inferior_tid (void)
 
static void fetch_regs (struct regcache *regcache, int tid)
 
static void store_regs (const struct regcache *regcache, int tid, int regnum)
 
static void fetch_fpregs (struct regcache *regcache, int tid)
 
static void store_fpregs (const struct regcache *regcache, int tid, int regnum)
 
static void fetch_regset (struct regcache *regcache, int tid, int regset_id, int regsize, const struct regset *regset)
 
static void store_regset (struct regcache *regcache, int tid, int regset_id, int regsize, const struct regset *regset)
 
static int check_regset (int tid, int regset, int regsize)
 
static void s390_linux_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
 
static void s390_linux_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
 
 DEF_VEC_O (s390_watch_area)
 
static struct s390_process_infos390_find_process_pid (pid_t pid)
 
static struct s390_process_infos390_add_process (pid_t pid)
 
static struct s390_process_infos390_process_info_get (pid_t pid)
 
static struct s390_debug_reg_states390_get_debug_reg_state (pid_t pid)
 
static void s390_forget_process (pid_t pid)
 
static void s390_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
 
static void s390_show_debug_regs (int tid, const char *where)
 
static int s390_stopped_by_watchpoint (struct target_ops *ops)
 
static void s390_prepare_to_resume (struct lwp_info *lp)
 
static void s390_mark_per_info_changed (struct lwp_info *lp)
 
static void s390_new_thread (struct lwp_info *lp)
 
static void s390_delete_thread (struct arch_lwp_info *arch_lwp)
 
static int s390_refresh_per_info_cb (struct lwp_info *lp, void *arg)
 
static int s390_refresh_per_info (void)
 
static int s390_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
 
static int s390_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
 
static int s390_can_use_hw_breakpoint (struct target_ops *self, enum bptype type, int cnt, int othertype)
 
static int s390_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
 
static int s390_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
 
static int s390_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR addr, int cnt)
 
static int s390_target_wordsize (void)
 
static int s390_auxv_parse (struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
 
static const struct target_descs390_read_description (struct target_ops *ops)
 
void _initialize_s390_nat (void)
 

Variables

static int have_regset_last_break = 0
 
static int have_regset_system_call = 0
 
static int have_regset_tdb = 0
 
static int have_regset_vxrs = 0
 
static int have_regset_gs = 0
 
static struct s390_process_infos390_process_list = NULL
 

Macro Definition Documentation

◆ PER_BIT

#define PER_BIT (   n)    (1UL << (63 - (n)))

Definition at line 101 of file s390-linux-nat.c.

◆ PER_CONTROL_ALTERATION

#define PER_CONTROL_ALTERATION   PER_BIT (42)

Definition at line 108 of file s390-linux-nat.c.

Referenced by s390_prepare_to_resume().

◆ PER_CONTROL_BRANCH_ADDRESS

#define PER_CONTROL_BRANCH_ADDRESS   PER_BIT (40)

Definition at line 106 of file s390-linux-nat.c.

Referenced by s390_prepare_to_resume().

◆ PER_CONTROL_SUSPENSION

#define PER_CONTROL_SUSPENSION   PER_BIT (41)

Definition at line 107 of file s390-linux-nat.c.

◆ PER_EVENT_BRANCH

#define PER_EVENT_BRANCH   PER_BIT (32)

Definition at line 102 of file s390-linux-nat.c.

Referenced by s390_prepare_to_resume().

◆ PER_EVENT_IFETCH

#define PER_EVENT_IFETCH   PER_BIT (33)

Definition at line 103 of file s390-linux-nat.c.

Referenced by s390_prepare_to_resume().

◆ PER_EVENT_NULLIFICATION

#define PER_EVENT_NULLIFICATION   PER_BIT (39)

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

Referenced by s390_prepare_to_resume().

◆ PER_EVENT_STORE

#define PER_EVENT_STORE   PER_BIT (34)

Definition at line 104 of file s390-linux-nat.c.

Referenced by s390_prepare_to_resume().

Typedef Documentation

◆ s390_watch_area

typedef struct watch_area s390_watch_area

Function Documentation

◆ _initialize_s390_nat()

void _initialize_s390_nat ( void  )

◆ check_regset()

static int check_regset ( int  tid,
int  regset,
int  regsize 
)
static

Definition at line 355 of file s390-linux-nat.c.

References ptrace(), PTRACE_GETREGSET, and selftests::ptid::tid.

Referenced by s390_read_description().

◆ DEF_VEC_O()

DEF_VEC_O ( s390_watch_area  )

◆ fetch_fpregs()

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

◆ fetch_regs()

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

◆ fetch_regset()

static void fetch_regset ( struct regcache regcache,
int  tid,
int  regset_id,
int  regsize,
const struct regset regset 
)
static

◆ fill_fpregset()

void fill_fpregset ( const struct regcache regcache,
fpregset_t regp,
int  regno 
)

Definition at line 213 of file s390-linux-nat.c.

References regcache_collect_regset(), and s390_fpregset.

Referenced by store_fpregs().

◆ fill_gregset()

void fill_gregset ( const struct regcache regcache,
gregset_t regp,
int  regno 
)

◆ s390_add_process()

static struct s390_process_info* s390_add_process ( pid_t  pid)
static

Definition at line 512 of file s390-linux-nat.c.

References proc::next, pid, s390_process_list, and XCNEW.

Referenced by s390_process_info_get().

◆ s390_auxv_parse()

static int s390_auxv_parse ( struct target_ops ops,
gdb_byte **  readptr,
gdb_byte endptr,
CORE_ADDR typep,
CORE_ADDR valp 
)
static

◆ s390_can_use_hw_breakpoint()

static int s390_can_use_hw_breakpoint ( struct target_ops self,
enum bptype  type,
int  cnt,
int  othertype 
)
static

Definition at line 868 of file s390-linux-nat.c.

References bp_hardware_breakpoint, and bp_hardware_watchpoint.

Referenced by _initialize_s390_nat().

◆ s390_delete_thread()

static void s390_delete_thread ( struct arch_lwp_info arch_lwp)
static

Definition at line 795 of file s390-linux-nat.c.

References xfree().

Referenced by _initialize_s390_nat().

◆ s390_find_process_pid()

static struct s390_process_info* s390_find_process_pid ( pid_t  pid)
static

Definition at line 497 of file s390-linux-nat.c.

References proc::next, pid, and s390_process_list.

Referenced by s390_process_info_get().

◆ s390_forget_process()

static void s390_forget_process ( pid_t  pid)
static

Definition at line 550 of file s390-linux-nat.c.

References proc::next, pid, s390_process_list, proc::state, VEC_free, and xfree().

Referenced by _initialize_s390_nat().

◆ s390_get_debug_reg_state()

static struct s390_debug_reg_state* s390_get_debug_reg_state ( pid_t  pid)
static

◆ s390_inferior_tid()

static int s390_inferior_tid ( void  )
static

◆ s390_insert_hw_breakpoint()

static int s390_insert_hw_breakpoint ( struct target_ops self,
struct gdbarch gdbarch,
struct bp_target_info bp_tgt 
)
static

◆ s390_insert_watchpoint()

static int s390_insert_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  len,
enum target_hw_bp_type  type,
struct expression cond 
)
static

◆ s390_linux_fetch_inferior_registers()

static void s390_linux_fetch_inferior_registers ( struct target_ops ops,
struct regcache regcache,
int  regnum 
)
static

◆ s390_linux_new_fork()

static void s390_linux_new_fork ( struct lwp_info parent,
pid_t  child_pid 
)
static

◆ s390_linux_store_inferior_registers()

static void s390_linux_store_inferior_registers ( struct target_ops ops,
struct regcache regcache,
int  regnum 
)
static

◆ s390_mark_per_info_changed()

static void s390_mark_per_info_changed ( struct lwp_info lp)
static

◆ s390_new_thread()

static void s390_new_thread ( struct lwp_info lp)
static

Definition at line 787 of file s390-linux-nat.c.

References s390_mark_per_info_changed().

Referenced by _initialize_s390_nat().

◆ s390_prepare_to_resume()

static void s390_prepare_to_resume ( struct lwp_info lp)
static

◆ s390_process_info_get()

static struct s390_process_info* s390_process_info_get ( pid_t  pid)
static

Definition at line 527 of file s390-linux-nat.c.

References pid, s390_add_process(), and s390_find_process_pid().

Referenced by s390_get_debug_reg_state().

◆ s390_read_description()

static const struct target_desc* s390_read_description ( struct target_ops ops)
static

◆ s390_refresh_per_info()

static int s390_refresh_per_info ( void  )
static

◆ s390_refresh_per_info_cb()

static int s390_refresh_per_info_cb ( struct lwp_info lp,
void *  arg 
)
static

Definition at line 803 of file s390-linux-nat.c.

References linux_stop_lwp(), lwp_is_stopped(), and s390_mark_per_info_changed().

Referenced by s390_refresh_per_info().

◆ s390_region_ok_for_hw_watchpoint()

static int s390_region_ok_for_hw_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  cnt 
)
static

Definition at line 923 of file s390-linux-nat.c.

Referenced by _initialize_s390_nat().

◆ s390_remove_hw_breakpoint()

static int s390_remove_hw_breakpoint ( struct target_ops self,
struct gdbarch gdbarch,
struct bp_target_info bp_tgt 
)
static

◆ s390_remove_watchpoint()

static int s390_remove_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  len,
enum target_hw_bp_type  type,
struct expression cond 
)
static

◆ s390_show_debug_regs()

static void s390_show_debug_regs ( int  tid,
const char *  where 
)
static

◆ s390_stopped_by_watchpoint()

static int s390_stopped_by_watchpoint ( struct target_ops ops)
static

◆ s390_target_wordsize()

static int s390_target_wordsize ( void  )
static

◆ store_fpregs()

static void store_fpregs ( const struct regcache regcache,
int  tid,
int  regnum 
)
static

◆ store_regs()

static void store_regs ( const struct regcache regcache,
int  tid,
int  regnum 
)
static

◆ store_regset()

static void store_regset ( struct regcache regcache,
int  tid,
int  regset_id,
int  regsize,
const struct regset regset 
)
static

◆ supply_fpregset()

void supply_fpregset ( struct regcache regcache,
const fpregset_t regp 
)

Definition at line 203 of file s390-linux-nat.c.

References regcache_supply_regset(), and s390_fpregset.

Referenced by fetch_fpregs().

◆ supply_gregset()

void supply_gregset ( struct regcache regcache,
const gregset_t regp 
)

Variable Documentation

◆ have_regset_gs

int have_regset_gs = 0
static

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

Referenced by s390_linux_fetch_inferior_registers(), and s390_read_description().

◆ have_regset_last_break

int have_regset_last_break = 0
static

Definition at line 53 of file s390-linux-nat.c.

Referenced by s390_linux_fetch_inferior_registers(), and s390_read_description().

◆ have_regset_system_call

int have_regset_system_call = 0
static

◆ have_regset_tdb

int have_regset_tdb = 0
static

Definition at line 55 of file s390-linux-nat.c.

Referenced by s390_linux_fetch_inferior_registers(), and s390_read_description().

◆ have_regset_vxrs

int have_regset_vxrs = 0
static

◆ s390_process_list

struct s390_process_info* s390_process_list = NULL
static

Definition at line 492 of file s390-linux-nat.c.

Referenced by s390_add_process(), s390_find_process_pid(), and s390_forget_process().