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