[PATCH v4 13/13] Add watchpoint support to gdb simulator interface.

Jiri Gaisler jiri@gaisler.se
Mon Mar 30 20:51:00 GMT 2015



On 28/03/15 08:19, Mike Frysinger wrote:
> On 17 Mar 2015 22:02, Jiri Gaisler wrote:
>> 	Currently, only the sparc sim supports watchpoints. Stubs for the
>> 	watchpoint functions were added to all other built-in sims
>> 	to avoid linking errors.
> 
> i haven't looked too closely here, but we already have common/sim-watch.c.  how 
> does this interact with that ?

This is interesting. The sim-watch.c seems only to define PC watchpoints,
i.e. what I would call (hardware) breakpoints. There does not seem to be any
support for data watchpoints like we have in sis. As far as I can see,
only the ARM simulator also implements data watchpoints but does not
export it to gdb. This is probably because the target_ops structure for gdbsim
does not export the (data) watchpoint functionality.

My patch extends the target_ops structure to include the gdb watchpoint
interface, and provide dummy functions for all simulators to avoid linking
errors. It does not modify or interfere with the sim-watch.c since the
functions are different. Ideally, common/sim-watch.c could be updated
to also support data watchpoints but it is beyond my capability at this
point. The code does not seem to have been touched since 1998 btw.

I propose to add my code as it currently stands in common/sim-watch-remote.c,
but rename it to sim-watch-data.c. By adding the watchpoint interface to
the target_ops, any maintainer could then map potential watchpoint support
in a simulator on the gdb interface. If the sim/common framework is extended
to support this, then more simulators will obviously benefit.

> 
> also missing ChangeLog entries

Will fix.

Jiri.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20150330/5342b61d/attachment.sig>


More information about the Gdb-patches mailing list