All of lore.kernel.org
 help / color / mirror / Atom feed
From: sanjana gogte <sanj27272@gmail.com>
To: vikram.garhwal@amd.com,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	 francisco.iglesias@xilinx.com, qemu-arm@nongnu.org,
	qemu-devel@nongnu.org
Subject: Gdb support for Debugging Arm M profile with Xilinx Qemu
Date: Thu, 28 Mar 2024 15:28:12 +0530	[thread overview]
Message-ID: <CA+ji3pHZN0DPg4LfssBs1urgYTZy22a6b+fzjfciA_QHjngMQA@mail.gmail.com> (raw)

[-- 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 --]

                 reply	other threads:[~2024-03-28  9:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+ji3pHZN0DPg4LfssBs1urgYTZy22a6b+fzjfciA_QHjngMQA@mail.gmail.com \
    --to=sanj27272@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=francisco.iglesias@xilinx.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vikram.garhwal@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.