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

Jiri Gaisler
2015-03-30T20:51:21Z

[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]

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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]