Discussion:
[Qemu-discuss] Debugging QEMU NIOS2
Zeeshan Hayat
2018-11-21 10:24:59 UTC
Permalink
Hi,


I am trying to debug simple program (hello_world). I run the QEMU as,
qemu-system-nios2 -s
and run the nios aware gdb as,
nios2-elf-gdb hello
and than in gdb I attach it to QEMU by,
target remote localhost:1234
but when I type "continue" in gdb window, it just hangs and prints nothing. I tried to set breakpoint but still the same issue


hello executable is generated as,
nios2-elf-gcc -g -o hello hello.c
Where hello.c is a simple program which prints "hello world"


I am not sure if I am doing something wrong here...


/Zeeshan
Thomas Huth
2018-11-21 11:31:39 UTC
Permalink
Post by Zeeshan Hayat
Hi,
I am trying to debug simple program (hello_world). I run the QEMU as,
qemu-system-nios2 -s
and run the nios aware gdb as,
nios2-elf-gdb hello
and than in gdb I attach it to QEMU by,
target remote localhost:1234
but when I type "continue" in gdb window, it just hangs and prints nothing. I tried to set breakpoint but still the same issue
hello executable is generated as,
nios2-elf-gcc -g -o hello hello.c
Where hello.c is a simple program which prints "hello world"
I am not sure if I am doing something wrong here...
As Peter already mentioned in his mail yesterday, you're using the wrong
QEMU binary: qemu-system-nios2 emulates a full system, so this is e.g.
for running a Linux kernel. You're apparently trying to run a normal
user-space program, so you have to use "qemu-nios2" instead.

HTH,
Thomas

Loading...