Linux Perf
dwarf-regs.c File Reference
#include <errno.h>
#include <stddef.h>
#include <string.h>
#include <dwarf-regs.h>
#include <linux/ptrace.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)   {.name = r, .dwarfnum = num}
 
#define GPR_DWARFNUM_NAME(num)   {.name = __stringify(%x##num), .dwarfnum = num}
 
#define REG_DWARFNUM_END   {.name = NULL, .dwarfnum = 0}
 
#define DWARFNUM2OFFSET(index)   (index * sizeof((struct user_pt_regs *)0)->regs[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

◆ DWARFNUM2OFFSET

#define DWARFNUM2OFFSET (   index)    (index * sizeof((struct user_pt_regs *)0)->regs[0])

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

◆ GPR_DWARFNUM_NAME

#define GPR_DWARFNUM_NAME (   num)    {.name = __stringify(%x##num), .dwarfnum = num}

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

◆ REG_DWARFNUM_END

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

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

◆ REG_DWARFNUM_NAME

#define REG_DWARFNUM_NAME (   r,
  num 
)    {.name = r, .dwarfnum = num}

Definition at line 24 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 79 of file dwarf-regs.c.

◆ regs_query_register_offset()

int regs_query_register_offset ( const char *  name)

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

Variable Documentation

◆ regdwarfnum_table

const struct pt_regs_dwarfnum regdwarfnum_table[]
static

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