GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
bpf-tdep.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "dis-asm.h"
#include "frame.h"
#include "frame-unwind.h"
#include "trad-frame.h"
#include "symtab.h"
#include "value.h"
#include "gdbcmd.h"
#include "breakpoint.h"
#include "inferior.h"
#include "regcache.h"
#include "target.h"
#include "dwarf2/frame.h"
#include "osabi.h"
#include "target-descriptions.h"
#include "remote.h"
#include "gdbarch.h"

Go to the source code of this file.

Classes

struct  bpf_gdbarch_tdep
 

Macros

#define BPF_NUM_REGS   (BPF_PC_REGNUM + 1)
 

Enumerations

enum  bpf_regnum {
  BPF_R0_REGNUM , BPF_R1_REGNUM , BPF_R2_REGNUM , BPF_R3_REGNUM ,
  BPF_R4_REGNUM , BPF_R5_REGNUM , BPF_R6_REGNUM , BPF_R7_REGNUM ,
  BPF_R8_REGNUM , BPF_R9_REGNUM , BPF_R10_REGNUM , BPF_PC_REGNUM
}
 
enum  bpf_breakpoint_kinds { BPF_BP_KIND_BRKPT = 0 }
 

Functions

static void show_bpf_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static const char * bpf_register_name (struct gdbarch *gdbarch, int reg)
 
static struct typebpf_register_type (struct gdbarch *gdbarch, int reg)
 
static int bpf_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
 
static int bpf_gdb_print_insn (bfd_vma memaddr, disassemble_info *info)
 
static CORE_ADDR bpf_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
 
static void bpf_frame_this_id (frame_info_ptr this_frame, void **this_prologue_cache, struct frame_id *this_id)
 
static enum unwind_stop_reason bpf_frame_unwind_stop_reason (frame_info_ptr this_frame, void **this_cache)
 
static struct valuebpf_frame_prev_register (frame_info_ptr this_frame, void **this_prologue_cache, int regnum)
 
static int bpf_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *start_pc)
 
static const gdb_byte * bpf_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
 
static struct frame_id bpf_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame)
 
static CORE_ADDR bpf_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr)
 
static void bpf_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
 
static void bpf_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
 
static enum return_value_convention bpf_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
static struct gdbarchbpf_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
void _initialize_bpf_tdep ()
 

Variables

static unsigned int bpf_debug_flag = 0
 
static const char * bpf_register_names []
 
static const struct frame_unwind bpf_frame_unwind
 

Macro Definition Documentation

◆ BPF_NUM_REGS

#define BPF_NUM_REGS   (BPF_PC_REGNUM + 1)

Definition at line 58 of file bpf-tdep.c.

Referenced by bpf_dwarf2_reg_to_regnum(), bpf_gdbarch_init(), and bpf_register_name().

Enumeration Type Documentation

◆ bpf_breakpoint_kinds

Enumerator
BPF_BP_KIND_BRKPT 

Definition at line 202 of file bpf-tdep.c.

◆ bpf_regnum

enum bpf_regnum
Enumerator
BPF_R0_REGNUM 
BPF_R1_REGNUM 
BPF_R2_REGNUM 
BPF_R3_REGNUM 
BPF_R4_REGNUM 
BPF_R5_REGNUM 
BPF_R6_REGNUM 
BPF_R7_REGNUM 
BPF_R8_REGNUM 
BPF_R9_REGNUM 
BPF_R10_REGNUM 
BPF_PC_REGNUM 

Definition at line 42 of file bpf-tdep.c.

Function Documentation

◆ _initialize_bpf_tdep()

void _initialize_bpf_tdep ( )

◆ bpf_breakpoint_kind_from_pc()

static int bpf_breakpoint_kind_from_pc ( struct gdbarch * gdbarch,
CORE_ADDR * start_pc )
static

Definition at line 210 of file bpf-tdep.c.

References BPF_BP_KIND_BRKPT.

Referenced by bpf_gdbarch_init().

◆ bpf_dummy_id()

static struct frame_id bpf_dummy_id ( struct gdbarch * gdbarch,
frame_info_ptr this_frame )
static

◆ bpf_dwarf2_reg_to_regnum()

static int bpf_dwarf2_reg_to_regnum ( struct gdbarch * gdbarch,
int reg )
static

Definition at line 115 of file bpf-tdep.c.

References BPF_NUM_REGS.

Referenced by bpf_gdbarch_init().

◆ bpf_extract_return_value()

static void bpf_extract_return_value ( struct type * type,
struct regcache * regcache,
gdb_byte * valbuf )
static

Definition at line 264 of file bpf-tdep.c.

References BPF_R0_REGNUM, readable_regcache::cooked_read(), and type::length().

Referenced by bpf_return_value().

◆ bpf_frame_prev_register()

static struct value * bpf_frame_prev_register ( frame_info_ptr this_frame,
void ** this_prologue_cache,
int regnum )
static

Definition at line 177 of file bpf-tdep.c.

References frame_unwind_got_register(), and regnum.

◆ bpf_frame_this_id()

static void bpf_frame_this_id ( frame_info_ptr this_frame,
void ** this_prologue_cache,
struct frame_id * this_id )
static

Definition at line 157 of file bpf-tdep.c.

◆ bpf_frame_unwind_stop_reason()

static enum unwind_stop_reason bpf_frame_unwind_stop_reason ( frame_info_ptr this_frame,
void ** this_cache )
static

Definition at line 168 of file bpf-tdep.c.

◆ bpf_gdb_print_insn()

static int bpf_gdb_print_insn ( bfd_vma memaddr,
disassemble_info * info )
static

Definition at line 125 of file bpf-tdep.c.

References default_print_insn().

Referenced by bpf_gdbarch_init().

◆ bpf_gdbarch_init()

static struct gdbarch * bpf_gdbarch_init ( struct gdbarch_info info,
struct gdbarch_list * arches )
static

◆ bpf_push_dummy_call()

static CORE_ADDR bpf_push_dummy_call ( struct gdbarch * gdbarch,
struct value * function,
struct regcache * regcache,
CORE_ADDR bp_addr,
int nargs,
struct value ** args,
CORE_ADDR sp,
function_call_return_method return_method,
CORE_ADDR struct_addr )
static

Definition at line 248 of file bpf-tdep.c.

References gdb_printf(), gdb_stdlog, and paddress().

Referenced by bpf_gdbarch_init().

◆ bpf_register_name()

static const char * bpf_register_name ( struct gdbarch * gdbarch,
int reg )
static

Definition at line 94 of file bpf-tdep.c.

References BPF_NUM_REGS, bpf_register_names, and gdb_static_assert().

Referenced by bpf_gdbarch_init().

◆ bpf_register_type()

static struct type * bpf_register_type ( struct gdbarch * gdbarch,
int reg )
static

◆ bpf_return_value()

static enum return_value_convention bpf_return_value ( struct gdbarch * gdbarch,
struct value * function,
struct type * type,
struct regcache * regcache,
gdb_byte * readbuf,
const gdb_byte * writebuf )
static

◆ bpf_skip_prologue()

static CORE_ADDR bpf_skip_prologue ( struct gdbarch * gdbarch,
CORE_ADDR start_pc )
static

Definition at line 136 of file bpf-tdep.c.

References gdb_printf(), gdb_stdlog, and paddress().

Referenced by bpf_gdbarch_init().

◆ bpf_store_return_value()

static void bpf_store_return_value ( struct type * type,
struct regcache * regcache,
const gdb_byte * valbuf )
static

Definition at line 278 of file bpf-tdep.c.

References BPF_R0_REGNUM, regcache::cooked_write(), and type::length().

Referenced by bpf_return_value().

◆ bpf_sw_breakpoint_from_kind()

static const gdb_byte * bpf_sw_breakpoint_from_kind ( struct gdbarch * gdbarch,
int kind,
int * size )
static

Definition at line 219 of file bpf-tdep.c.

References BPF_BP_KIND_BRKPT, and size.

Referenced by bpf_gdbarch_init().

◆ show_bpf_debug()

static void show_bpf_debug ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

Definition at line 76 of file bpf-tdep.c.

References gdb_printf().

Referenced by _initialize_bpf_tdep().

Variable Documentation

◆ bpf_debug_flag

unsigned int bpf_debug_flag = 0
static

Definition at line 71 of file bpf-tdep.c.

Referenced by _initialize_bpf_tdep().

◆ bpf_frame_unwind

const struct frame_unwind bpf_frame_unwind
static
Initial value:
=
{
"bpf prologue",
NULL,
}
static enum unwind_stop_reason bpf_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
Definition bpf-tdep.c:168
static void bpf_frame_this_id(frame_info_ptr this_frame, void **this_prologue_cache, struct frame_id *this_id)
Definition bpf-tdep.c:157
static struct value * bpf_frame_prev_register(frame_info_ptr this_frame, void **this_prologue_cache, int regnum)
Definition bpf-tdep.c:177
int default_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
@ NORMAL_FRAME
Definition frame.h:187

Definition at line 185 of file bpf-tdep.c.

Referenced by bpf_gdbarch_init().

◆ bpf_register_names

const char* bpf_register_names[]
static
Initial value:
=
{
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "pc"
}

Definition at line 85 of file bpf-tdep.c.

Referenced by bpf_register_name().