How to debug pc386 compiled program with gdb?

Chris Johns chrisj at rtems.org
Wed Aug 29 21:50:51 UTC 2012


Xiaochen Pan wrote:
>
> How to use i386-rtems4.11-gdb to debug pc386 compiled exe programs?
>

I debug i386 programs using a basic serial port which is means most 
recent motherboards do not work because serial ports are not common and 
USB serial ports are no help. If you do have a serial port the set up I 
use is:

  http://git.rtems.org/chrisj/rtl.git/tree/pc386-gdb.c
  http://git.rtems.org/chrisj/rtl.git/tree/main.c#n378

Note, I add '--gdb' to the boot command line grub uses.

> Are all pc386 compiled files supposed to run with qemu emulator? Could they run without qemu? If it have to be with qemu, what instructions I should follow?

As already posted add the -s option to qemu. You can also tell qemu to 
hold the i386 in reset allowing you to connect gdb, set a break point, 
then run. This helps debug early boot type issues.

Chris



More information about the users mailing list