X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Flinux-nat-trad.h;h=04ff602d8c50184f6828c2ea4e963bc631e3612f;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=3b4a6c8595a92fed6dc63ee76570d39493d65d9f;hpb=6798487f5bc66ab9c34ad81fa28ba25d32a00bd9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/linux-nat-trad.h b/gdb/linux-nat-trad.h index 3b4a6c8595..04ff602d8c 100644 --- a/gdb/linux-nat-trad.h +++ b/gdb/linux-nat-trad.h @@ -1,6 +1,6 @@ /* Generic GNU/Linux target using traditional ptrace register access. - Copyright (C) 2000-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -22,9 +22,25 @@ #include "linux-nat.h" -/* Create a generic GNU/Linux target using traditional - ptrace register access. */ -struct target_ops *linux_trad_target - (CORE_ADDR (*register_u_offset)(struct gdbarch *, int, int)); +/* A prototype GNU/Linux target using traditional ptrace register + access. A concrete type should override REGISTER_U_OFFSET. */ + +class linux_nat_trad_target : public linux_nat_target +{ +public: + void fetch_registers (struct regcache *, int) override; + void store_registers (struct regcache *, int) override; + +protected: + /* Return the offset within the user area where a particular + register is stored. */ + virtual CORE_ADDR register_u_offset (struct gdbarch *gdbarch, + int regnum, int store) = 0; + +private: + /* Helpers. See definition. */ + void fetch_register (struct regcache *regcache, int regnum); + void store_register (const struct regcache *regcache, int regnum); +}; #endif /* LINUX_NAT_TRAD_H */