Re: RISC-V: Is it reasonable to extend current target_description for KGDB?

Maciej W. Rozycki
2019-10-16T13:17:53Z

On Wed, 16 Oct 2019, Pedro Alves wrote:

> > I am a Linux developer and trying to add the KGDB support to the
> > RISC-V Linux. During the porting, I encountered a GDB issue with the
> > 'g' packet. I hope the GDB experts can give me some advice.
> > The KGDB is a debugger provided by the kernel for users to debug
> > kernel space through GDB. To parse the GDB packets, the KGDB has a
> > simple gdb stub. However, this gdb stub does not support the
> > "qSupported" packet.
>
> I don't understand the resistance to just adding the support.
> It is not complicated, and would surely end up being used to
> negotiate support for other optional features.

Seconded! A while ago I actually had a conversation with Jim and other
RISC-V people as to XML description support in the RISC-V backend and my
understanding has been we had a consensus to make it mandatory for debug
stubs and get that enforced on the GDB side, getting rid of any heuristics
now present for debug stubs with no description support.

For legacy debug stubs (odd to speak of any in the context of RISC-V, an
architecture introduced ~10 years after XML description support has been
added to GDB!) there's always the:

(gdb) set tdesc filename ...

command available to supply XML description information manually.

Maciej