From: Simon Marchi via Gdb <gdb@sourceware.org>
To: psmith@gnu.org, gdb@sourceware.org
Subject: Re: GDB 16.3: is it possible to cross-debug an x64 core from ARM?
Date: Mon, 1 Dec 2025 15:19:17 -0500 [thread overview]
Message-ID: <3188e560-bf2b-4b31-9347-9ed870fb3eb3@simark.ca> (raw)
In-Reply-To: <2f8e6564c0110db9be7ed9b5ab78ee5c9349ca0a.camel@gnu.org>
On 2025-12-01 10:36, Paul Smith via Gdb wrote:
> If I build an x86_64 GDB binary that has support for debugging ARM core
> files, it works fine. The build is invoked (on x86_64) like:
>
> $ ../gdb-6.3/configure ... --enable-targets=aarch64-linux-gnu
> ...
> $ make -j$(nproc)
>
> There's no problem and the resulting GDB works both for native x86_64
> cores and ARM cores.
>
> But, if I try to build an aarch64 GDB (on an ARM system) that has
> support for debugging x86_64 core files, the build fails like this:
>
> $ ../gdb-6.3/configure ... --enable-targets=x86_64-linux-gnu
> ...
> $ make -j$(nprocs)
> ...
> make[2]: *** No rule to make target '../sim/aarch64/libsim.a', needed by 'gdb'. Stop.
>
> If I use the same configure arguments but omitting --enable-targets
> then I get a correctly built GDB that will work on ARM.
>
> Comparing sim/config.log from the ARM build without --enable-targets
> (which works) versus the failing one, shows nothing too interesting; I
> get the same messages etc. The only consequential difference is that
> in the working version (no extra enabled targets) I see:
>
> SIM_ENABLE_ARCH_aarch64_FALSE='#'
> SIM_ENABLE_ARCH_aarch64_TRUE=''
>
> while in the failing version (with x86_64 enabled target) I see:
>
> SIM_ENABLE_ARCH_aarch64_FALSE=''
> SIM_ENABLE_ARCH_aarch64_TRUE='#'
>
> Which could have been guessed from the error message I suppose :).
>
>
> Anyone have any further advice? I guess the next step would be to run
> configure with sh -x and see if I can deduce where it gets confused
> (assuming this is a supported configuration).
I don't know why using `--enable-targets=...` makes the sim configure
script decide not to build the simulator for aarch64.
`--enable-targets` enables a target on top of the default one (in this
case aarch64). So if the simulator is built and linked when not using
`--enable-targets=...`, then I think it would make sense to do the same
when using `--enable-targets...`.
If your goal is to get something working right now, you can try
--disable-sim, or use --target=x86_64-linux-gnu, which will produce a
GDB that runs on aarch64 but only knows about debugging x86_64 targets
and cores.
Simon
next prev parent reply other threads:[~2025-12-01 20:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 15:36 Paul Smith via Gdb
2025-12-01 19:53 ` Tom Tromey
2025-12-01 20:19 ` Simon Marchi via Gdb [this message]
2025-12-01 21:13 ` Simon Marchi via Gdb
2025-12-03 13:13 ` Paul Smith via Gdb
2025-12-05 19:10 ` Luis via Gdb
2025-12-05 22:40 ` Paul Smith via Gdb
2025-12-07 18:41 ` Luis via Gdb
2025-12-08 18:08 ` Paul Smith via Gdb
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=3188e560-bf2b-4b31-9347-9ed870fb3eb3@simark.ca \
--to=gdb@sourceware.org \
--cc=psmith@gnu.org \
--cc=simark@simark.ca \
/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