Linux Perf
dwarf-regs.c File Reference
#include <stddef.h>
#include <errno.h>
#include <string.h>
#include <dwarf-regs.h>
#include <linux/ptrace.h>
#include <linux/kernel.h>
#include <linux/stringify.h>
#include "util.h"
Include dependency graph for dwarf-regs.c:

Go to the source code of this file.

Classes

struct  pt_regs_dwarfnum
 

Macros

#define REG_DWARFNUM_NAME(r, num)
 
#define GPR_DWARFNUM_NAME(num)
 
#define REG_DWARFNUM_END   {.name = NULL, .dwarfnum = 0, .ptregs_offset = 0}
 

Functions

const char * get_arch_regstr (unsigned int n)
 
int regs_query_register_offset (const char *name)
 

Variables

static const struct pt_regs_dwarfnum regdwarfnum_table []
 

Macro Definition Documentation

◆ GPR_DWARFNUM_NAME

#define GPR_DWARFNUM_NAME (   num)
Value:
{.name = __stringify(%gpr##num), .dwarfnum = num, \
.ptregs_offset = offsetof(struct pt_regs, gpr[num])}

Definition at line 30 of file dwarf-regs.c.

◆ REG_DWARFNUM_END

#define REG_DWARFNUM_END   {.name = NULL, .dwarfnum = 0, .ptregs_offset = 0}

Definition at line 33 of file dwarf-regs.c.

◆ REG_DWARFNUM_NAME

#define REG_DWARFNUM_NAME (   r,
  num 
)
Value:
{.name = __stringify(%)__stringify(r), .dwarfnum = num, \
.ptregs_offset = offsetof(struct pt_regs, r)}

Definition at line 27 of file dwarf-regs.c.

Function Documentation

◆ get_arch_regstr()

const char* get_arch_regstr ( unsigned int  n)

get_arch_regstr() - lookup register name from it's DWARF register number
: the DWARF register number

get_arch_regstr() returns the name of the register in struct regdwarfnum_table from it's DWARF register number. If the register is not found in the table, this returns NULL;

Definition at line 89 of file dwarf-regs.c.

◆ regs_query_register_offset()

int regs_query_register_offset ( const char *  name)

Definition at line 98 of file dwarf-regs.c.

Variable Documentation

◆ regdwarfnum_table

const struct pt_regs_dwarfnum regdwarfnum_table[]
static

Definition at line 39 of file dwarf-regs.c.