895e866644c3e3be562e30afc97a29ccfc915c40
[external/binutils.git] / gdb / arch / arm-get-next-pcs.h
1 /* Common code for ARM software single stepping support.
2
3    Copyright (C) 1988-2016 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 ARM_GET_NEXT_PCS_H
21 #define ARM_GET_NEXT_PCS_H 1
22
23 /* Forward declaration.  */
24 struct arm_get_next_pcs;
25
26 /* get_next_pcs operations.  */
27 struct arm_get_next_pcs_ops
28 {
29   ULONGEST (*read_mem_uint) (CORE_ADDR memaddr, int len, int byte_order);
30   CORE_ADDR (*syscall_next_pc) (struct arm_get_next_pcs *self, CORE_ADDR pc);
31   CORE_ADDR (*addr_bits_remove) (struct arm_get_next_pcs *self, CORE_ADDR val);
32   int (*is_thumb) (struct arm_get_next_pcs *self);
33 };
34
35 /* Context for a get_next_pcs call on ARM.  */
36 struct arm_get_next_pcs
37 {
38   /* Operations implementations.  */
39   struct arm_get_next_pcs_ops *ops;
40   /* Byte order for data.  */
41   int byte_order;
42   /* Byte order for code.  */
43   int byte_order_for_code;
44   /* Thumb2 breakpoint instruction.  */
45   const gdb_byte *arm_thumb2_breakpoint;
46   /* Registry cache.  */
47   struct regcache *regcache;
48 };
49
50 /* Initialize arm_get_next_pcs.  */
51 void arm_get_next_pcs_ctor (struct arm_get_next_pcs *self,
52                             struct arm_get_next_pcs_ops *ops,
53                             int byte_order,
54                             int byte_order_for_code,
55                             const gdb_byte *arm_thumb2_breakpoint,
56                             struct regcache *regcache);
57
58 /* Find the next possible PCs after the current instruction executes.  */
59 VEC (CORE_ADDR) *arm_get_next_pcs (struct arm_get_next_pcs *self,
60                                    CORE_ADDR pc);
61
62 #endif /* ARM_GET_NEXT_PCS_H */