differnce between struct reg and struct user_regs_

2019-08-05 06:50发布

What is the difference between struct reg and struct user_regs_struc on Linux 64 bit machine?

标签: ptrace
1条回答
成全新的幸福
2楼-- · 2019-08-05 07:12
struct user_regs_struct
{
  unsigned long r15;
  unsigned long r14;
  unsigned long r13;
  unsigned long r12;
  unsigned long rbp;
  unsigned long rbx;
  unsigned long r11;
  unsigned long r10;
  unsigned long r9;
  unsigned long r8;
  unsigned long rax;
  unsigned long rcx;
  unsigned long rdx;
  unsigned long rsi;
  unsigned long rdi;
  unsigned long orig_rax;
  unsigned long rip;
  unsigned long cs;
  unsigned long eflags;
  unsigned long rsp;
  unsigned long ss;
  unsigned long fs_base;
  unsigned long gs_base;
  unsigned long ds;
  unsigned long es;
  unsigned long fs;
  unsigned long gs;
};

This struct can be found in /usr/include/x86_64-linux-gnu/sys

According to this link struct reg is

 struct reg {
            register_t fixreg[32];
            register_t lr;
            register_t cr;
            register_t xer;
            register_t ctr;
            register_t pc;
    };

in freeBsd file: sys/powerpc/include/reg.h

And yes I did not found this struct in my debian 64bit system.

查看更多
登录 后发表回答