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

Go to the source code of this file.

Classes

struct  pt_regs_offset
 

Macros

#define REG_OFFSET_END   {.name = NULL, .offset = 0}
 
#define REG_OFFSET_NAME_64(n, r)   {.name = n, .offset = -1}
 
#define REG_OFFSET_NAME_32(n, r)   {.name = n, .offset = offsetof(struct pt_regs, r)}
 
#define regoffset_table   x86_32_regoffset_table
 
#define ARCH_MAX_REGS   ((sizeof(regoffset_table) / sizeof(regoffset_table[0])) - 1)
 

Functions

const char * get_arch_regstr (unsigned int n)
 
: the name of a register

regs_query_register_offset() - query register offset from its name

regs_query_register_offset() returns the offset of a register in struct pt_regs from its name. If the name is invalid, this returns -EINVAL;

int regs_query_register_offset (const char *name)
 

Variables

static const struct pt_regs_offset x86_32_regoffset_table []
 

Macro Definition Documentation

◆ ARCH_MAX_REGS

#define ARCH_MAX_REGS   ((sizeof(regoffset_table) / sizeof(regoffset_table[0])) - 1)

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

◆ REG_OFFSET_END

#define REG_OFFSET_END   {.name = NULL, .offset = 0}

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

◆ REG_OFFSET_NAME_32

#define REG_OFFSET_NAME_32 (   n,
 
)    {.name = n, .offset = offsetof(struct pt_regs, r)}

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

◆ REG_OFFSET_NAME_64

#define REG_OFFSET_NAME_64 (   n,
 
)    {.name = n, .offset = -1}

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

◆ regoffset_table

#define regoffset_table   x86_32_regoffset_table

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

Function Documentation

◆ get_arch_regstr()

const char* get_arch_regstr ( unsigned int  n)

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

◆ regs_query_register_offset()

int regs_query_register_offset ( const char *  name)

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

Variable Documentation

◆ x86_32_regoffset_table

const struct pt_regs_offset x86_32_regoffset_table[]
static
Initial value:
= {
REG_OFFSET_NAME_32("%ax", eax),
REG_OFFSET_NAME_32("%cx", ecx),
REG_OFFSET_NAME_32("%dx", edx),
REG_OFFSET_NAME_32("%bx", ebx),
REG_OFFSET_NAME_32("$stack", esp),
REG_OFFSET_NAME_32("%bp", ebp),
REG_OFFSET_NAME_32("%si", esi),
REG_OFFSET_NAME_32("%di", edi),
}
#define REG_OFFSET_NAME_32(n, r)
Definition: dwarf-regs.c:63
#define REG_OFFSET_END
Definition: dwarf-regs.c:56

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