]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/arch-utils.h
Fix powerpc-power8.exp test with new mnemonics
[thirdparty/binutils-gdb.git] / gdb / arch-utils.h
index fa2908605f5b3956e5c1ebdc619f69c06a0f061b..a5b40ad8ff1bdbc0a4760482c3d527fd8314bbc5 100644 (file)
@@ -1,6 +1,6 @@
 /* Dynamic architecture support for GDB, the GNU debugger.
 
-   Copyright (C) 1998-2017 Free Software Foundation, Inc.
+   Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef GDBARCH_UTILS_H
-#define GDBARCH_UTILS_H
+#ifndef ARCH_UTILS_H
+#define ARCH_UTILS_H
+
+#include "gdbarch.h"
 
-struct gdbarch;
 struct frame_info;
 struct minimal_symbol;
 struct type;
@@ -73,22 +74,8 @@ struct bp_manipulation_endian
   bp_manipulation_endian<sizeof (BREAK_INSN_LITTLE),             \
   BREAK_INSN_LITTLE, BREAK_INSN_BIG>
 
-/* An implementation of gdbarch_displaced_step_copy_insn for
-   processors that don't need to modify the instruction before
-   single-stepping the displaced copy.
-
-   Simply copy gdbarch_max_insn_length (ARCH) bytes from FROM to TO.
-   The closure is an array of that many bytes containing the
-   instruction's bytes, allocated with xmalloc.  */
-extern struct displaced_step_closure *
-  simple_displaced_step_copy_insn (struct gdbarch *gdbarch,
-                                   CORE_ADDR from, CORE_ADDR to,
-                                   struct regcache *regs);
-
 /* Default implementation of gdbarch_displaced_hw_singlestep.  */
-extern int
-  default_displaced_step_hw_singlestep (struct gdbarch *,
-                                       struct displaced_step_closure *);
+extern bool default_displaced_step_hw_singlestep (struct gdbarch *);
 
 /* Possible value for gdbarch_displaced_step_location:
    Place displaced instructions at the program's entry point,
@@ -145,6 +132,28 @@ extern const struct floatformat **
   default_floatformat_for_type (struct gdbarch *gdbarch,
                                const char *name, int len);
 
+/* Default implementation of gdbarch_memtag_to_string.  */
+extern std::string default_memtag_to_string (struct gdbarch *gdbarch,
+                                            struct value *tag);
+
+/* Default implementation of gdbarch_tagged_address_p.  */
+bool default_tagged_address_p (struct gdbarch *gdbarch, struct value *address);
+
+/* Default implementation of gdbarch_memtag_matches_p.  */
+extern bool default_memtag_matches_p (struct gdbarch *gdbarch,
+                                      struct value *address);
+
+/* Default implementation of gdbarch_set_memtags.  */
+bool default_set_memtags (struct gdbarch *gdbarch,
+                         struct value *address, size_t length,
+                         const gdb::byte_vector &tags,
+                         memtag_type tag_type);
+
+/* Default implementation of gdbarch_get_memtag.  */
+struct value *default_get_memtag (struct gdbarch *gdbarch,
+                                 struct value *address,
+                                 memtag_type tag_type);
+
 extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame,
                                               CORE_ADDR pc);
 
@@ -214,7 +223,7 @@ extern struct gdbarch *get_current_arch (void);
 extern int default_has_shared_address_space (struct gdbarch *);
 
 extern int default_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
-                                            CORE_ADDR addr, char **msg);
+                                            CORE_ADDR addr, std::string *msg);
 
 extern const gdb_byte *default_breakpoint_from_pc (struct gdbarch *gdbarch,
                                                   CORE_ADDR *pcptr,
@@ -239,6 +248,10 @@ extern int default_insn_is_call (struct gdbarch *, CORE_ADDR);
 extern int default_insn_is_ret (struct gdbarch *, CORE_ADDR);
 extern int default_insn_is_jump (struct gdbarch *, CORE_ADDR);
 
+/* Default implementation of gdbarch_program_breakpoint_here_p.  */
+extern bool default_program_breakpoint_here_p (struct gdbarch *gdbarch,
+                                              CORE_ADDR addr);
+
 /* Do-nothing version of vsyscall_range.  Returns false.  */
 
 extern int default_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range);
@@ -258,7 +271,7 @@ extern void default_skip_permanent_breakpoint (struct regcache *regcache);
 
 extern CORE_ADDR default_infcall_mmap (CORE_ADDR size, unsigned prot);
 extern void default_infcall_munmap (CORE_ADDR addr, CORE_ADDR size);
-extern char *default_gcc_target_options (struct gdbarch *gdbarch);
+extern std::string default_gcc_target_options (struct gdbarch *gdbarch);
 extern const char *default_gnu_triplet_regexp (struct gdbarch *gdbarch);
 extern int default_addressable_memory_unit_size (struct gdbarch *gdbarch);
 
@@ -274,4 +287,28 @@ extern int default_print_insn (bfd_vma memaddr, disassemble_info *info);
 extern CORE_ADDR gdbarch_skip_prologue_noexcept (gdbarch *gdbarch,
                                                 CORE_ADDR pc) noexcept;
 
-#endif
+/* Default implementation of gdbarch_in_indirect_branch_thunk that returns
+   false.  */
+extern bool default_in_indirect_branch_thunk (gdbarch *gdbarch,
+                                             CORE_ADDR pc);
+
+/* Default implementation of gdbarch type_align method.  */
+extern ULONGEST default_type_align (struct gdbarch *gdbarch,
+                                   struct type *type);
+
+/* Default implementation of gdbarch get_pc_address_flags method.  */
+extern std::string default_get_pc_address_flags (frame_info *frame,
+                                                CORE_ADDR pc);
+
+/* Default implementation of gdbarch read_core_file_mappings method.  */
+extern void default_read_core_file_mappings (struct gdbarch *gdbarch,
+                                            struct bfd *cbfd,
+                                            gdb::function_view<void (ULONGEST count)>
+                                              pre_loop_cb,
+                                            gdb::function_view<void (int num,
+                                                                     ULONGEST start,
+                                                                     ULONGEST end,
+                                                                     ULONGEST file_ofs,
+                                                                     const char *filename)>
+                                              loop_cb);
+#endif /* ARCH_UTILS_H */