sa_sigaction 的第三个参数是一个指向机器相关的指针struct ucontext
,我想知道我可以从中转储什么struct ucontext
。
void (*sa_sigaction)(int signum, siginfo_t *info, void *ucontext)
struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
struct sigcontext uc_mcontext;
sigset_t uc_sigmask; /* mask last for extensibility */
};
特别是通过 uc_mcontext (如果你能告诉我在哪里我可以了解更多关于其他数据成员的信息,那就太好了),因为人们通常uc_mcontext
用来转储这样的主机寄存器,
ucontext->uc_mcontext.gregs[REG_EIP]
因为uc_mcontext
类型是struct sigcontext
,我struct sigcontext
在看arch/x86/include/asm/sigcontext.h
。
struct sigcontext {
unsigned short gs, __gsh;
unsigned short fs, __fsh;
unsigned short es, __esh;
unsigned short ds, __dsh;
... snip ...
};
gregs
它是正确的,因为我没有看到struct sigcontext
吗?欢迎任何建议。