X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fsparc-nat.h;h=1dbdd80b5ed6998ecbbf61c1b133aa57171e1536;hb=06a6207a1ab458521656f293bb1ca8fd013d6f7c;hp=460983981a3c9272c0f95e158aca82b875cee394;hpb=7b6bb8daaceb9ecf3f42dea57ae82733d6a3b2f6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/sparc-nat.h b/gdb/sparc-nat.h index 460983981a..1dbdd80b5e 100644 --- a/gdb/sparc-nat.h +++ b/gdb/sparc-nat.h @@ -1,7 +1,6 @@ /* Native-dependent code for SPARC. - Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -21,29 +20,64 @@ #ifndef SPARC_NAT_H #define SPARC_NAT_H 1 -struct sparc_gregset; +#include "target.h" -extern const struct sparc_gregset *sparc_gregset; -extern void (*sparc_supply_gregset) (const struct sparc_gregset *, +struct sparc_gregmap; +struct sparc_fpregmap; + +extern const struct sparc_gregmap *sparc_gregmap; +extern const struct sparc_fpregmap *sparc_fpregmap; +extern void (*sparc_supply_gregset) (const struct sparc_gregmap *, struct regcache *, int , const void *); -extern void (*sparc_collect_gregset) (const struct sparc_gregset *, +extern void (*sparc_collect_gregset) (const struct sparc_gregmap *, const struct regcache *, int, void *); -extern void (*sparc_supply_fpregset) (struct regcache *, int , const void *); -extern void (*sparc_collect_fpregset) (const struct regcache *, int , void *); +extern void (*sparc_supply_fpregset) (const struct sparc_fpregmap *, + struct regcache *, int , const void *); +extern void (*sparc_collect_fpregset) (const struct sparc_fpregmap *, + const struct regcache *, int , void *); extern int (*sparc_gregset_supplies_p) (struct gdbarch *gdbarch, int); 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 +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 */