All of lore.kernel.org
 help / color / mirror / Atom feed
* Gdb support for Debugging Arm M profile with Xilinx Qemu
@ 2024-03-28  9:58 sanjana gogte
  0 siblings, 0 replies; only message in thread
From: sanjana gogte @ 2024-03-28  9:58 UTC (permalink / raw)
  To: vikram.garhwal, Edgar E. Iglesias, francisco.iglesias, qemu-arm,
	qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3108 bytes --]

Greetings,

I am currently engaged in a project that involves emulating the LM3S811EVB
( M3 Core ) board using Xilinx QEMU (version 7.1.0) . While the emulation
process is successful, I am encountering difficulties in attaching GNU
Debugger (GDB) or GDB-multiarch to the ELF file being executed on the
emulated board. Interestingly, this issue does not arise when utilizing the
standard QEMU (version 8.1.5), where I am able to attach GDB and step
through the ELF file without any hindrances.


To address this issue, I have experimented with different versions of GDB,
specifically:
GNU gdb (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) ( arm-none-eabi)
GNU gdb (Linaro_GDB-2019.12) 8.3.1.20191204-git
*Error I am facing :*
Remote debugging using localhost:1234
Remote 'g' packet reply is too long (expected 68 bytes, got 92 bytes):
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028100020ffffffff0800000000000041000000000000000000000000000000000000000000000000
(gdb) b main
Breakpoint 1 at 0xc6: file main2.c, line 69.
(gdb) continue
The program is not being run.
(gdb) run
Don't know how to run. Try "help target".

*With Gdb-multiarch (12.1)*
gef➤ set architecture armv7
The target architecture is set to "armv7".
gef➤ target remote:1234
Remote debugging using :1234
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
Remote 'g' packet reply is too long (expected 68 bytes, got 92 bytes):
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028100020ffffffff0800000000000041000000000000000000000000000000000000000000000000
gef➤ file kernel2.elf
Reading symbols from kernel2.elf...
gef➤ b main
Breakpoint 1 at 0xc6: file main2.c, line 69.
gef➤ continue
The program is not being run.
gef➤ run
Starting program:
/mnt/c/Users/Gogte/Desktop/sanjana_intern_project/Qemu_test/test3/LinkerM3/kernel2.elf

/bin/bash: line 1:
/mnt/c/Users/Gogte/Desktop/sanjana_intern_project/Qemu_test/test3/LinkerM3/kernel2.elf:
cannot execute binary file: Exec format error
/bin/bash: line 1:
/mnt/c/Users/Gogte/Desktop/sanjana_intern_project/Qemu_test/test3/LinkerM3/kernel2.elf:
Success
During startup program exited with code 126.

*If I do the same with Standard qemu binary the gdb works:*
Remote debugging using localhost:1234
start () at startup.s:10
--Type <RET> for more, q to quit, c to continue without paging--c
10 ldr r1, =main
(gdb) b main
Breakpoint 1 at 0xc6: file main2.c, line 69.
(gdb) continue
Continuing.

Breakpoint 1, main () at main2.c:69
69 uart_print("Inside main function");
(gdb)


My project necessitates the use of the Xilinx QEMU binary, specifically to
leverage the remote port functionality it offers.

Therefore, I am seeking guidance on which version of GDB should be used, or
any specific configurations that might enable successful GDB attachment to
the ELF file running on Xilinx QEMU.


Regards,
Sanjana

[-- Attachment #2: Type: text/html, Size: 12741 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-28  9:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28  9:58 Gdb support for Debugging Arm M profile with Xilinx Qemu sanjana gogte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.