为什么struct cpu_context只包含几个寄存器成员?

时间:2019-07-12 09:41:45

标签: c linux gdb

最近我正在研究linux-ramdump-parser-v2,我尝试从Qualcomm的ramdump中获取所有注册内容,在该工具中,它使用struct cpu_context从每个线程获取sp pc fp值。首先,我们可以研究该结构

struct cpu_context {
unsigned long x19;
unsigned long x20;
unsigned long x21;
unsigned long x22;
unsigned long x23;
unsigned long x24;
unsigned long x25;
unsigned long x26;
unsigned long x27;
unsigned long x28;
unsigned long fp;
unsigned long sp;
unsigned long pc;
};

我们可以看到,它不包含从x0到x18的寄存器,有人可以帮助回答吗? 有人知道如何通过linux-ramdump-parser-v2获取局部变量吗?我试图从redhat崩溃中获取那些局部变量,但它不起作用:(

还是应该参考汇编代码来获取堆栈中的每个局部变量? 我知道我可以在T32上得到它们,但是我想实现一个自动脚本来运行python命令。非常感谢。

红帽的实用程序崩溃

def thread_saved_sp(self, task):
        if self.arm64:
            return self.thread_saved_field_common_64(task, self.field_offset('struct cpu_context', 'sp'))
        else:
            return self.thread_saved_field_common_32(task, self.field_offset('struct cpu_context_save', 'sp'))

0 个答案:

没有答案