GDB (xrefs)
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/dwarf2-frame.c File Reference
#include "defs.h"
#include "dwarf2expr.h"
#include "dwarf2.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "gdbcore.h"
#include "gdbtypes.h"
#include "symtab.h"
#include "objfiles.h"
#include "regcache.h"
#include "value.h"
#include "record.h"
#include "complaints.h"
#include "dwarf2-frame.h"
#include "ax.h"
#include "dwarf2loc.h"
#include "dwarf2-frame-tailcall.h"

Go to the source code of this file.

Classes

struct  dwarf2_cie
 
struct  dwarf2_cie_table
 
struct  dwarf2_fde
 
struct  dwarf2_fde_table
 
struct  comp_unit
 
class  dwarf_expr_executor
 
struct  dwarf2_frame_ops
 
struct  dwarf2_frame_cache
 

Macros

#define cfa_exp_len   cfa_reg
 
#define DW64_CIE_ID   0xffffffffffffffffULL
 

Enumerations

enum  eh_frame_type { EH_CIE_TYPE_ID = 1 << 0, EH_FDE_TYPE_ID = 1 << 1, EH_CIE_OR_FDE_TYPE_ID = EH_CIE_TYPE_ID | EH_FDE_TYPE_ID }
 

Functions

static struct dwarf2_fdedwarf2_frame_find_fde (CORE_ADDR *pc, CORE_ADDR *out_offset)
 
static int dwarf2_frame_adjust_regnum (struct gdbarch *gdbarch, int regnum, int eh_frame_p)
 
static CORE_ADDR read_encoded_value (struct comp_unit *unit, gdb_byte encoding, int ptr_len, const gdb_byte *buf, unsigned int *bytes_read_ptr, CORE_ADDR func_base)
 
static CORE_ADDR read_addr_from_reg (struct frame_info *this_frame, int reg)
 
static void dwarf2_restore_rule (struct gdbarch *gdbarch, ULONGEST reg_num, struct dwarf2_frame_state *fs, int eh_frame_p)
 
static CORE_ADDR execute_stack_op (const gdb_byte *exp, ULONGEST len, int addr_size, CORE_ADDR offset, struct frame_info *this_frame, CORE_ADDR initial, int initial_in_stack_memory)
 
static const gdb_byteexecute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr, const gdb_byte *insn_end, struct gdbarch *gdbarch, CORE_ADDR pc, struct dwarf2_frame_state *fs)
 
static void dwarf2_frame_default_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, struct frame_info *this_frame)
 
static void * dwarf2_frame_init (struct obstack *obstack)
 
void dwarf2_frame_set_init_reg (struct gdbarch *gdbarch, void(*init_reg)(struct gdbarch *, int, struct dwarf2_frame_state_reg *, struct frame_info *))
 
static void dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, struct frame_info *this_frame)
 
void dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch, int(*signal_frame_p)(struct gdbarch *, struct frame_info *))
 
static int dwarf2_frame_signal_frame_p (struct gdbarch *gdbarch, struct frame_info *this_frame)
 
void dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch, int(*adjust_regnum)(struct gdbarch *, int, int))
 
static void dwarf2_frame_find_quirks (struct dwarf2_frame_state *fs, struct dwarf2_fde *fde)
 
int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, struct dwarf2_per_cu_data *data, int *regnum_out, LONGEST *offset_out, CORE_ADDR *text_offset_out, const gdb_byte **cfa_start_out, const gdb_byte **cfa_end_out)
 
static struct dwarf2_frame_cachedwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
 
static enum unwind_stop_reason dwarf2_frame_unwind_stop_reason (struct frame_info *this_frame, void **this_cache)
 
static void dwarf2_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
 
static struct valuedwarf2_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
 
static void dwarf2_frame_dealloc_cache (struct frame_info *self, void *this_cache)
 
static int dwarf2_frame_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
 
void dwarf2_append_unwinders (struct gdbarch *gdbarch)
 
static CORE_ADDR dwarf2_frame_base_address (struct frame_info *this_frame, void **this_cache)
 
const struct frame_basedwarf2_frame_base_sniffer (struct frame_info *this_frame)
 
CORE_ADDR dwarf2_frame_cfa (struct frame_info *this_frame)
 
static unsigned int read_1_byte (bfd *abfd, const gdb_byte *buf)
 
static unsigned int read_4_bytes (bfd *abfd, const gdb_byte *buf)
 
static ULONGEST read_8_bytes (bfd *abfd, const gdb_byte *buf)
 
static ULONGEST read_initial_length (bfd *abfd, const gdb_byte *buf, unsigned int *bytes_read_ptr)
 
static gdb_byte encoding_for_size (unsigned int size)
 
static int bsearch_cie_cmp (const void *key, const void *element)
 
static struct dwarf2_ciefind_cie (struct dwarf2_cie_table *cie_table, ULONGEST cie_pointer)
 
static void add_cie (struct dwarf2_cie_table *cie_table, struct dwarf2_cie *cie)
 
static int bsearch_fde_cmp (const void *key, const void *element)
 
static void add_fde (struct dwarf2_fde_table *fde_table, struct dwarf2_fde *fde)
 
static const gdb_bytedecode_frame_entry (struct comp_unit *unit, const gdb_byte *start, int eh_frame_p, struct dwarf2_cie_table *cie_table, struct dwarf2_fde_table *fde_table, enum eh_frame_type entry_type)
 
static const gdb_bytedecode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start, int eh_frame_p, struct dwarf2_cie_table *cie_table, struct dwarf2_fde_table *fde_table, enum eh_frame_type entry_type)
 
static int qsort_fde_cmp (const void *a, const void *b)
 
void dwarf2_build_frame_info (struct objfile *objfile)
 
void _initialize_dwarf2_frame (void)
 

Variables

static struct gdbarch_datadwarf2_frame_data
 
static const struct frame_unwind dwarf2_frame_unwind
 
static const struct frame_unwind dwarf2_signal_frame_unwind
 
static const struct frame_base dwarf2_frame_base
 
const struct objfile_data * dwarf2_frame_objfile_data
 

Macro Definition Documentation

◆ cfa_exp_len

#define cfa_exp_len   cfa_reg

Definition at line 174 of file dwarf2-frame.c.

◆ DW64_CIE_ID

#define DW64_CIE_ID   0xffffffffffffffffULL

Definition at line 1752 of file dwarf2-frame.c.

Referenced by decode_frame_entry_1().

Enumeration Type Documentation

◆ eh_frame_type

Enumerator
EH_CIE_TYPE_ID 
EH_FDE_TYPE_ID 
EH_CIE_OR_FDE_TYPE_ID 

Definition at line 1757 of file dwarf2-frame.c.

Function Documentation

◆ _initialize_dwarf2_frame()

void _initialize_dwarf2_frame ( void  )

◆ add_cie()

static void add_cie ( struct dwarf2_cie_table cie_table,
struct dwarf2_cie cie 
)
static

◆ add_fde()

static void add_fde ( struct dwarf2_fde_table fde_table,
struct dwarf2_fde fde 
)
static

◆ bsearch_cie_cmp()

static int bsearch_cie_cmp ( const void *  key,
const void *  element 
)
static

Definition at line 1627 of file dwarf2-frame.c.

References dwarf2_cie::cie_pointer.

Referenced by find_cie().

◆ bsearch_fde_cmp()

static int bsearch_fde_cmp ( const void *  key,
const void *  element 
)
static

Definition at line 1676 of file dwarf2-frame.c.

References dwarf2_fde::address_range, and dwarf2_fde::initial_location.

Referenced by dwarf2_frame_find_fde().

◆ decode_frame_entry()

static const gdb_byte * decode_frame_entry ( struct comp_unit unit,
const gdb_byte start,
int  eh_frame_p,
struct dwarf2_cie_table cie_table,
struct dwarf2_fde_table fde_table,
enum eh_frame_type  entry_type 
)
static

◆ decode_frame_entry_1()

static const gdb_byte* decode_frame_entry_1 ( struct comp_unit unit,
const gdb_byte start,
int  eh_frame_p,
struct dwarf2_cie_table cie_table,
struct dwarf2_fde_table fde_table,
enum eh_frame_type  entry_type 
)
static

◆ dwarf2_append_unwinders()

void dwarf2_append_unwinders ( struct gdbarch gdbarch)

◆ dwarf2_build_frame_info()

void dwarf2_build_frame_info ( struct objfile objfile)

◆ dwarf2_fetch_cfa_info()

int dwarf2_fetch_cfa_info ( struct gdbarch gdbarch,
CORE_ADDR  pc,
struct dwarf2_per_cu_data data,
int *  regnum_out,
LONGEST offset_out,
CORE_ADDR text_offset_out,
const gdb_byte **  cfa_start_out,
const gdb_byte **  cfa_end_out 
)

◆ dwarf2_frame_adjust_regnum()

static int dwarf2_frame_adjust_regnum ( struct gdbarch gdbarch,
int  regnum,
int  eh_frame_p 
)
static

◆ dwarf2_frame_base_address()

static CORE_ADDR dwarf2_frame_base_address ( struct frame_info this_frame,
void **  this_cache 
)
static

Definition at line 1402 of file dwarf2-frame.c.

References dwarf2_frame_cache::cfa, and dwarf2_frame_cache().

◆ dwarf2_frame_base_sniffer()

const struct frame_base* dwarf2_frame_base_sniffer ( struct frame_info this_frame)

◆ dwarf2_frame_cache()

static struct dwarf2_frame_cache* dwarf2_frame_cache ( struct frame_info this_frame,
void **  this_cache 
)
static

◆ dwarf2_frame_cfa()

CORE_ADDR dwarf2_frame_cfa ( struct frame_info this_frame)

◆ dwarf2_frame_dealloc_cache()

static void dwarf2_frame_dealloc_cache ( struct frame_info self,
void *  this_cache 
)
static

◆ dwarf2_frame_default_init_reg()

static void dwarf2_frame_default_init_reg ( struct gdbarch gdbarch,
int  regnum,
struct dwarf2_frame_state_reg reg,
struct frame_info this_frame 
)
static

◆ dwarf2_frame_find_fde()

static struct dwarf2_fde * dwarf2_frame_find_fde ( CORE_ADDR pc,
CORE_ADDR out_offset 
)
static

◆ dwarf2_frame_find_quirks()

static void dwarf2_frame_find_quirks ( struct dwarf2_frame_state fs,
struct dwarf2_fde fde 
)
static

◆ dwarf2_frame_init()

static void* dwarf2_frame_init ( struct obstack *  obstack)
static

◆ dwarf2_frame_init_reg()

static void dwarf2_frame_init_reg ( struct gdbarch gdbarch,
int  regnum,
struct dwarf2_frame_state_reg reg,
struct frame_info this_frame 
)
static

Definition at line 757 of file dwarf2-frame.c.

References dwarf2_frame_data, dwarf2_frame_ops::init_reg, and regnum.

Referenced by dwarf2_frame_cache().

◆ dwarf2_frame_prev_register()

static struct value* dwarf2_frame_prev_register ( struct frame_info this_frame,
void **  this_cache,
int  regnum 
)
static

◆ dwarf2_frame_set_adjust_regnum()

void dwarf2_frame_set_adjust_regnum ( struct gdbarch gdbarch,
int(*)(struct gdbarch *, int, int)  adjust_regnum 
)

Definition at line 800 of file dwarf2-frame.c.

References dwarf2_frame_ops::adjust_regnum, and dwarf2_frame_data.

Referenced by rs6000_gdbarch_init(), and s390_gdbarch_init().

◆ dwarf2_frame_set_init_reg()

void dwarf2_frame_set_init_reg ( struct gdbarch gdbarch,
void(*)(struct gdbarch *, int, struct dwarf2_frame_state_reg *, struct frame_info *)  init_reg 
)

◆ dwarf2_frame_set_signal_frame_p()

void dwarf2_frame_set_signal_frame_p ( struct gdbarch gdbarch,
int(*)(struct gdbarch *, struct frame_info *)  signal_frame_p 
)

◆ dwarf2_frame_signal_frame_p()

static int dwarf2_frame_signal_frame_p ( struct gdbarch gdbarch,
struct frame_info this_frame 
)
static

Definition at line 785 of file dwarf2-frame.c.

References dwarf2_frame_data, and dwarf2_frame_ops::signal_frame_p.

Referenced by dwarf2_frame_sniffer().

◆ dwarf2_frame_sniffer()

static int dwarf2_frame_sniffer ( const struct frame_unwind self,
struct frame_info this_frame,
void **  this_cache 
)
static

◆ dwarf2_frame_this_id()

static void dwarf2_frame_this_id ( struct frame_info this_frame,
void **  this_cache,
struct frame_id this_id 
)
static

◆ dwarf2_frame_unwind_stop_reason()

static enum unwind_stop_reason dwarf2_frame_unwind_stop_reason ( struct frame_info this_frame,
void **  this_cache 
)
static

◆ dwarf2_restore_rule()

static void dwarf2_restore_rule ( struct gdbarch gdbarch,
ULONGEST  reg_num,
struct dwarf2_frame_state fs,
int  eh_frame_p 
)
static

◆ encoding_for_size()

static gdb_byte encoding_for_size ( unsigned int  size)
static

Definition at line 1512 of file dwarf2-frame.c.

References _, internal_error(), and size.

Referenced by read_encoded_value().

◆ execute_cfa_program()

static const gdb_byte* execute_cfa_program ( struct dwarf2_fde fde,
const gdb_byte insn_ptr,
const gdb_byte insn_end,
struct gdbarch gdbarch,
CORE_ADDR  pc,
struct dwarf2_frame_state fs 
)
static

◆ execute_stack_op()

static CORE_ADDR execute_stack_op ( const gdb_byte exp,
ULONGEST  len,
int  addr_size,
CORE_ADDR  offset,
struct frame_info this_frame,
CORE_ADDR  initial,
int  initial_in_stack_memory 
)
static

◆ find_cie()

static struct dwarf2_cie* find_cie ( struct dwarf2_cie_table cie_table,
ULONGEST  cie_pointer 
)
static

◆ qsort_fde_cmp()

static int qsort_fde_cmp ( const void *  a,
const void *  b 
)
static

◆ read_1_byte()

static unsigned int read_1_byte ( bfd *  abfd,
const gdb_byte buf 
)
static

Definition at line 1459 of file dwarf2-frame.c.

Referenced by decode_frame_entry_1().

◆ read_4_bytes()

static unsigned int read_4_bytes ( bfd *  abfd,
const gdb_byte buf 
)
static

Definition at line 1465 of file dwarf2-frame.c.

Referenced by decode_frame_entry_1().

◆ read_8_bytes()

static ULONGEST read_8_bytes ( bfd *  abfd,
const gdb_byte buf 
)
static

Definition at line 1471 of file dwarf2-frame.c.

Referenced by decode_frame_entry_1().

◆ read_addr_from_reg()

static CORE_ADDR read_addr_from_reg ( struct frame_info this_frame,
int  reg 
)
static

◆ read_encoded_value()

static CORE_ADDR read_encoded_value ( struct comp_unit unit,
gdb_byte  encoding,
int  ptr_len,
const gdb_byte buf,
unsigned int *  bytes_read_ptr,
CORE_ADDR  func_base 
)
static

◆ read_initial_length()

static ULONGEST read_initial_length ( bfd *  abfd,
const gdb_byte buf,
unsigned int *  bytes_read_ptr 
)
static

Definition at line 1477 of file dwarf2-frame.c.

Referenced by decode_frame_entry_1().

Variable Documentation

◆ dwarf2_frame_base

const struct frame_base dwarf2_frame_base
static
Initial value:
=
{
}
static const struct frame_unwind dwarf2_frame_unwind
static CORE_ADDR dwarf2_frame_base_address(struct frame_info *this_frame, void **this_cache)

Definition at line 1410 of file dwarf2-frame.c.

Referenced by dwarf2_frame_base_sniffer().

◆ dwarf2_frame_data

struct gdbarch_data* dwarf2_frame_data
static

◆ dwarf2_frame_objfile_data

const struct objfile_data* dwarf2_frame_objfile_data

◆ dwarf2_frame_unwind

const struct frame_unwind dwarf2_frame_unwind
static
Initial value:
=
{
NULL,
}
static void dwarf2_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static enum unwind_stop_reason dwarf2_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static void dwarf2_frame_dealloc_cache(struct frame_info *self, void *this_cache)
static int dwarf2_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static struct value * dwarf2_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)

Definition at line 1357 of file dwarf2-frame.c.

Referenced by dwarf2_append_unwinders().

◆ dwarf2_signal_frame_unwind

const struct frame_unwind dwarf2_signal_frame_unwind
static
Initial value:
=
{
NULL,
NULL
}
static void dwarf2_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static enum unwind_stop_reason dwarf2_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static int dwarf2_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static struct value * dwarf2_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)

Definition at line 1368 of file dwarf2-frame.c.

Referenced by dwarf2_append_unwinders().