简体   繁体   中英

How to Debug Linux Kernel using GDB in qemu environment

I have requirement where i wanted to debud my Linux kernel image using GDB but not sure whats is option available for it,

When I run below command

gdb ./vmlinux

 users/amit/vmlinuz-2.6.32-33-generic": not in executable format: File format not recognized

The z at the end of vmlinuz tells you that your kernel image is in a compressed format. To debug it, you need to have an uncompressed version. You can extract a vmlinux from your vmlinuz , but you have to make sure you have the required debug symbols somewhere (System.map?).

The easiest option is probably to rebuild your kernel with debug symbols and without compression.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM