renjith
renjith

Reputation: 561

Debug qemu with gdb

How can I use gdb to debug qemu? I have been googling but couldn't find anything concrete.

Upvotes: 7

Views: 15931

Answers (2)

Max Mustermann
Max Mustermann

Reputation: 351

I got an error with GDB 7.5 -> "Error accessing memory address"

It seems there is a problem with "Position Independet Executables" ...so use

./configure --enable-debug --disable-pie

and debug should work.

Upvotes: 10

Sukanto
Sukanto

Reputation: 1002

Try the following:

./configure --enable-debug

By default qemu builds with "CFLAGS = -O2 -g" option which somehow doesn't allow debug symbols to be added. Using --enable-debug option will mean -O2 will not be added.

Upvotes: 6

Related Questions