Debug qemu with gdb

2020-06-19 05:46发布

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

2条回答
成全新的幸福
2楼-- · 2020-06-19 06:22

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.

查看更多
我命由我不由天
3楼-- · 2020-06-19 06:34

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.

查看更多
登录 后发表回答