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

Guinevere Larsen
2026-01-13T18:23:36Z

On 1/12/26 12:33 PM, Andrew Burgess wrote:
> 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.

Yeah, that was Ciaran's latest feedback, and I think this is a good idea
(setting the warning when "Don't know how to run")

I don't necessarily think there's much to be gained by injecting the
warning in the "help target" message, but I think "help target native"
could be much more informative, and since the "don't know how to run"
message explicitly looks for a native target, the hint could be more
specific as well.

I'll look into this for v3

--
Cheers,
Guinevere Larsen
It/she

>
> Just a thought.
>
> Thanks,
> Andrew
>