2

I am using qemu to emulate a sparc V8 machine and using this as a remote target for gdb to debug a modified bootloader program. There is a bug in the program that causes it to run in an infinite loop.

My plan is to interrupt qemu a number of times to see which region of code is causing the execution in an infinite loop. How to interrupt qemu by pressing a key to examine the processor state?

Once interrupted, I know how to examine the registers etc using gdb, but I don't know how to interrupt qemu in the first place. I could not find this info after googling. Thanks for any hints.

Neha Karanjkar
  • 3,390
  • 2
  • 29
  • 48
  • 1
    I never did this, but AFAIK if you are connecting GDB to QEMU-s built-in gdb "stub" then suspending GDB (by pressing CTRL+C in GDB) should stop QEMU and let you examine the state. – dbrank0 Dec 19 '14 at 07:37
  • 1
    Did you try control-C? I use it all the time for other emulated processors (ARM, PowerPC, etc.) – Richard Pennington Dec 22 '14 at 13:17

1 Answers1

1

Ctrl + C works as others mentioned, just as it does on regular userland processes.

Tested with the minimal setup explained on this answer: How to debug the Linux kernel with GDB and QEMU?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985