Amit Singh Tomar
Amit Singh Tomar

Reputation: 8610

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

Upvotes: 0

Views: 794

Answers (1)

us2012
us2012

Reputation: 16263

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.

Upvotes: 4

Related Questions