Re: [PATCH 2/2] gdb: add warning when no native target is available

Eli Zaretskii
2025-11-07T14:22:30Z

> Date: Fri, 7 Nov 2025 10:24:15 -0300
> Cc: gdb-patches@sourceware.org
> From: Guinevere Larsen <guinevere@redhat.com>
>
> On 11/7/25 4:48 AM, Eli Zaretskii wrote:
> >> From: Guinevere Larsen <guinevere@redhat.com>
> >> Cc: Guinevere Larsen <guinevere@redhat.com>
> >> Date: Thu, 6 Nov 2025 16:45:14 -0300
> >>
> >> + if (get_native_target () == nullptr)
> >> + warning (_("No native target, only remote debugging is supported.\n"
> >> + "Use \"%ps\" to check which architectures are supported."),
> >> + styled_string (command_style.style (), "info architecture"));
> > Would we also say "Native debugging is supported" in the opposite
> > case?
> >
> > Thanks.
> >
> When you debug an inferior without connecting to a gdbserver, you are
> doing native debugging, but I don't think it makes sense to warn the
> user that native debugging is supported since that is the default
> behavior of GDB, if that is what  you mean with this email.

Then perhaps I don't understand the purpose of the patch. I thought
it was part of showing the information about GDB at the start of a
session. In that case, I think it's good to let user know that this
GDB supports native debugging, and also tell them if it doesn't.
Apologies if I misunderstood.