diff options
Diffstat (limited to 'gdb/sparc-nat.h')
-rw-r--r-- | gdb/sparc-nat.h | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/gdb/sparc-nat.h b/gdb/sparc-nat.h index 6960d3d..b564c01 100644 --- a/gdb/sparc-nat.h +++ b/gdb/sparc-nat.h @@ -39,14 +39,43 @@ extern int (*sparc_fpregset_supplies_p) (struct gdbarch *gdbarch, int); extern int sparc32_gregset_supplies_p (struct gdbarch *gdbarch, int regnum); extern int sparc32_fpregset_supplies_p (struct gdbarch *gdbarch, int regnum); -/* Create a prototype generic SPARC target. The client can override +extern void sparc_fetch_inferior_registers (struct regcache *, int); +extern void sparc_store_inferior_registers (struct regcache *, int); + +extern target_xfer_status sparc_xfer_wcookie (enum target_object object, + const char *annex, + gdb_byte *readbuf, + const gdb_byte *writebuf, + ULONGEST offset, + ULONGEST len, + ULONGEST *xfered_len); + +/* A prototype generic SPARC target. The client can override it with local methods. */ -extern struct target_ops *sparc_target (void); +template<typename BaseTarget> +struct sparc_target : public BaseTarget +{ + void fetch_registers (struct regcache *regcache, int regnum) override + { sparc_fetch_inferior_registers (regcache, regnum); } + + void store_registers (struct regcache *regcache, int regnum) override + { sparc_store_inferior_registers (regcache, regnum); } + + enum target_xfer_status xfer_partial (enum target_object object, + const char *annex, + gdb_byte *readbuf, + const gdb_byte *writebuf, + ULONGEST offset, ULONGEST len, + ULONGEST *xfered_len) override + { + if (object == TARGET_OBJECT_WCOOKIE) + return sparc_xfer_wcookie (object, annex, readbuf, writebuf, + offset, len, xfered_len); -extern void sparc_fetch_inferior_registers (struct target_ops *, - struct regcache *, int); -extern void sparc_store_inferior_registers (struct target_ops *, - struct regcache *, int); + return BaseTarget (object, annex, readbuf, writebuf, + offset, len, xfered_len); + } +}; #endif /* sparc-nat.h */ |