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

Andrew Burgess
2026-01-12T15:35:26Z

Guinevere Larsen <guinevere@redhat.com> writes:

> On 1/9/26 11:16 AM, Ciaran Woodward wrote:
>>> 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.
>> Would you object to making it configure-time, or would that break your
>> intended use case?

Currently, if a user tries to 'run' when there's no native target
support, GDB gives an error like:

Don't know how to run. Try "help target".

Would your new text be better emitted around the time this error is
produced? The actual output of 'help target' is pretty unhelpful for a
confused user I think, it's mostly just a list of the various target
sub-commands. But there is some introductory text at the top, maybe we
could do something smart and inject your new warning there for GDB's
without a native target?

Both of these would defer the additional text to the point where the
user has tried to do the wrong thing, at which point, printing more text
is OK.

Just a thought.

Thanks,
Andrew