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

Guinevere Larsen
2026-01-09T13:41:09Z

On 1/9/26 9:36 AM, Ciaran Woodward wrote:
>> -----Original Message-----
>> From: Guinevere Larsen <guinevere@redhat.com>
>>
>> When a user starts GDB, they have no way of knowing if native debugging
>> will be supported or not. This is most relevant for Mac users, since
>> GDB hasn't been ported to Apple's CPUs yet.
>>
>> This patch adds a warning if, after initializing all files, GDB was
>> unable to find an appropriate native target for the session, informing
>> the user that they will only be able to debug remotely.
> Thanks for continuing to focus on usability :)
>
> I thought I would add my perspective as a primarily embedded developer. Most
> of the GDBs I use are "cross GDBs", for debugging embedded targets that
> can't run GDB themselves. These get configured by having a different HOST
> and TARGET in the build config, and I tend to think that usually its quite
> clear that you're using one instead of your system GDB.
>
> I think for such debuggers, it would be good to have this warning suppressed,
> since users usually obtain it as part of a tool suite for that same platform,
> so wouldn't be expected to get reminded that they can't use it to debug host
> programs.
>
> Thanks,
> Ciaran
>
Hmmm, that's a good point. I think I can add a switch to this, to be
added to the gdbinit (or maybe gdbearlyinit), will cook a v3 in a moment.

--
Cheers,
Guinevere Larsen
It/she