linux-nat-trad.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Generic GNU/Linux target using traditional ptrace register access.
  2. Copyright (C) 2000-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef LINUX_NAT_TRAD_H
  15. #define LINUX_NAT_TRAD_H
  16. #include "linux-nat.h"
  17. /* A prototype GNU/Linux target using traditional ptrace register
  18. access. A concrete type should override REGISTER_U_OFFSET. */
  19. class linux_nat_trad_target : public linux_nat_target
  20. {
  21. public:
  22. void fetch_registers (struct regcache *, int) override;
  23. void store_registers (struct regcache *, int) override;
  24. protected:
  25. /* Return the offset within the user area where a particular
  26. register is stored. */
  27. virtual CORE_ADDR register_u_offset (struct gdbarch *gdbarch,
  28. int regnum, int store) = 0;
  29. private:
  30. /* Helpers. See definition. */
  31. void fetch_register (struct regcache *regcache, int regnum);
  32. void store_register (const struct regcache *regcache, int regnum);
  33. };
  34. #endif /* LINUX_NAT_TRAD_H */