我有一个物理内存转储文件和一个符号文件(vmlinux),我想用gdb中的符号文件分析转储文件的内容。例如,当时的物理内存转储偷看INIT_TASK的状态:gdb - 使用物理内存转储文件调试内核
(gdb) print &init_task
=> show the address of init_task in physical memory dump file, said 0xc0XXXXXX
(gdb) print ((struct task_struct *) 0xc0XXXXXX)->tasks
=> show the content of init_task.tasks in physical memory dump file)
我只是想在gdb命令“还原”和“核心目标”,两者都无法正常工作。需要在正在运行的进程中使用“恢复”,并将核心文件(ELF 64位LSB核心文件)中的“目标核心”需要作为输入。
(gdb) restore binary physical-memory-dump-file
You can't do that without a process to debug.
(gdb) target core physical-memory-dump-file
"physical-memory-dump-file" is not a core dump: File format not recognized
任何想法?谢谢。
更新1: 嗨帕文,感谢提醒;由于我在特殊平台上工作,因此在从panic/Oops重新启动内核后,其上的bootloader会将完整的物理内存保存到转储文件中。因此,物理内存转储文件的大小与物理RAM的大小相同,可以从内核的第一个字节映射到内核中的0xc000:0000。
你是如何收集你的'物理内存转储文件'图像? – 2012-04-05 17:39:20