Why enforcing sw_breakpoint_from_kind() implementation in GDBserver targets

Metzger, Markus T markus.t.metzger@intel.com
Thu Jun 18 11:11:44 GMT 2020

Hello Maciej,

> > The breakpoint kind would depend on the ISA.  And we'd have a real lot of
> them.
>  Well, that's just one interpretation.  The breakpoint kind is really a
> generic cookie each target is free to give any interpretation to.  There
> is no processing of this data I know of in common GDB or `gdbserver' code.

That's how I had interpreted it.  I thought you suggested defining one kind per
instruction/operand so the kind would encode the original instruction to restore.

> > I don't think that we'd want to encode the original instruction in the breakpoint
> > kind.  That's what the shadow copy inside the breakpoint object is for.
>  I thought you wrote you had had to choose not to use `z0'/`Z0' packets
> due to the inability to utilise the breakpoint bits this way.  Maybe I got
> this wrong.

The issue is that the breakpoint struct is opaque and there is no API to access
the shadow copy storage from a target's insert_point() function.

This can be changed, of course.  I did not look into it because gdbarch breakpoint
methods worked for me.


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

More information about the Gdb mailing list