riscv: gdb cannot connect to rtems runnin in qemu

Jan.Sommer at dlr.de Jan.Sommer at dlr.de
Fri Jan 29 13:20:03 UTC 2021


I just tried to debug a riscv test program running in qemu.
However, gdb could not establish a connection to qemu and produced the following error:
/tmp/rtems/riscv❯ riscv-rtems6-gdb ticker.exe
GNU gdb (GDB)

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tools/modulesystem/tools/rtems/rtems6/install/bsps/riscv-rtems6/grv32imafdc-smp/testsuites/samples/ticker.exe...
(gdb) target remote :1234
Remote debugging using :1234
bfd requires flen 8, but target has flen 4

The tools and rtems are built from master a couple of days ago.
I used the following command line for qemu (v. 4.2.0):
qemu-system-riscv32 -nographic -machine virt -m 2G -nographic -net none -serial mon:stdio -bios /tmp/riscv/ticker.exe -s -S

Does anyone have a hint if the problem is with qemu, gdb or rtems?
Without gdb the program runs normally in qemu.

Best regards,


Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)
German Aerospace Center
Institute for Software Technology | Software for Space Systems and Interactive Visualization | Lilienthalplatz 7 | 38108 Braunschweig | Germany

Jan Sommer

More information about the users mailing list