register: added simple register description
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include <editline/readline.h>
|
#include <editline/readline.h>
|
||||||
|
|
||||||
#include "breakpoint.h"
|
#include "breakpoint.h"
|
||||||
|
#include "register.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
33
src/register.c
Normal file
33
src/register.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#include "register.h"
|
||||||
|
|
||||||
|
int n_registers = 27;
|
||||||
|
|
||||||
|
const reg_descriptor reg_descriptors[27] = {
|
||||||
|
{ r15, 15, "r15" },
|
||||||
|
{ r14, 14, "r14" },
|
||||||
|
{ r13, 13, "r13" },
|
||||||
|
{ r12, 12, "r12" },
|
||||||
|
{ rbp, 6, "rbp" },
|
||||||
|
{ rbx, 3, "rbx" },
|
||||||
|
{ r11, 11, "r11" },
|
||||||
|
{ r10, 10, "r10" },
|
||||||
|
{ r9, 9, "r9" },
|
||||||
|
{ r8, 8, "r8" },
|
||||||
|
{ rax, 0, "rax" },
|
||||||
|
{ rcx, 2, "rcx" },
|
||||||
|
{ rdx, 1, "rdx" },
|
||||||
|
{ rsi, 4, "rsi" },
|
||||||
|
{ rdi, 5, "rdi" },
|
||||||
|
{ orig_rax, -1, "orig_rax" },
|
||||||
|
{ rip, -1, "rip" },
|
||||||
|
{ cs, 51, "cs" },
|
||||||
|
{ rflags, 49, "eflags" },
|
||||||
|
{ rsp, 7, "rsp" },
|
||||||
|
{ ss, 52, "ss" },
|
||||||
|
{ fs_base, 58, "fs_base" },
|
||||||
|
{ gs_base, 59, "gs_base" },
|
||||||
|
{ ds, 53, "ds" },
|
||||||
|
{ es, 50, "es" },
|
||||||
|
{ fs, 54, "fs" },
|
||||||
|
{ gs, 55, "gs" },
|
||||||
|
};
|
41
src/register.h
Normal file
41
src/register.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
rax,
|
||||||
|
rbx,
|
||||||
|
rcx,
|
||||||
|
rdx,
|
||||||
|
rdi,
|
||||||
|
rsi,
|
||||||
|
rbp,
|
||||||
|
rsp,
|
||||||
|
r8,
|
||||||
|
r9,
|
||||||
|
r10,
|
||||||
|
r11,
|
||||||
|
r12,
|
||||||
|
r13,
|
||||||
|
r14,
|
||||||
|
r15,
|
||||||
|
rip,
|
||||||
|
rflags,
|
||||||
|
cs,
|
||||||
|
orig_rax,
|
||||||
|
fs_base,
|
||||||
|
gs_base,
|
||||||
|
fs,
|
||||||
|
gs,
|
||||||
|
ss,
|
||||||
|
ds,
|
||||||
|
es,
|
||||||
|
} reg;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
reg r;
|
||||||
|
int dwarf_r;
|
||||||
|
const char name[10];
|
||||||
|
} reg_descriptor;
|
||||||
|
|
||||||
|
int n_registers;
|
||||||
|
const reg_descriptor reg_descriptors[27];
|
Reference in New Issue
Block a user