Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Mock, George via Gdb" <gdb@sourceware.org>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: test gdb as it runs qemu simulator
Date: Wed, 29 Oct 2025 20:21:13 +0000	[thread overview]
Message-ID: <938d2b5574b94d9584b758eee3c0c064@ti.com> (raw)

Hello!

I work on a team that implements C/C++ cross compilers.  Among other combinations, one cross compiler runs on Linux and generates code for RISC-V systems.  I want to use the gdb testsuite.  Not for the purpose of testing gdb, but to test whether the Dwarf generated by our compiler works with gdb.  I need to test gdb while it controls execution of code running under a qemu simulator for RISC-V.

The following shows a typical way, from Linux, to interactively use gdb on one program.

# In one process
$ qemu-riscv32 -g 1234 riscv-program

# In a different process
$ riscv32-unknown-elf-gdb riscv-program
(gdb) target remote localhost:1234
(gdb) # typical gdb commands go here

The option -g 1234 tells qemu-riscv32 to start gdbserver and wait for communication through port 1234.

I have some familiarity with testing gdb.  I learned how to build and test it for Linux.  I built riscv32-unknown-elf-gdb, and I can interactively watch it work.  I know how to configure the testsuite to build with our cross compiler.  But I cannot find the configuration (I presume some combination of a board file and command line options) which causes the testsuite to interface with qemu-riscv32 in a manner similar to that interactive example.

While I would appreciate a fully fleshed out solution, I'm sure that is too much to expect.  I suspect many have done this before me, but none of my many searches have found the blog post (or whatever) which shows how they did it.

I'd appreciate any light you can shed.

Thanks and regards,

-George Mock


             reply	other threads:[~2025-10-29 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 20:21 Mock, George via Gdb [this message]
2025-10-29 22:05 ` Luis via Gdb
2025-10-31 20:32   ` Tom Tromey
2025-10-31 20:33 ` Tom Tromey

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=938d2b5574b94d9584b758eee3c0c064@ti.com \
    --to=gdb@sourceware.org \
    --cc=gmock@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox