X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Farch-utils.h;h=3fb9ad317acbb0c9b5cb30ee7c8abac18018a8a7;hb=3318ac0e53a673f9989f5e9bbaa9d1c5d536f4e5;hp=27f4787e842b70d5938293711f1622ab58bdc3c4;hpb=3374165f51fa3cc3ce1b1bf8c72293464da9d511;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 27f4787e84..3fb9ad317a 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -1,6 +1,6 @@ /* Dynamic architecture support for GDB, the GNU debugger. - Copyright (C) 1998-2015 Free Software Foundation, Inc. + Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -17,33 +17,62 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#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; struct gdbarch_info; - -/* 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); - -/* Simple implementation of gdbarch_displaced_step_free_closure: Call - xfree. - This is appropriate for use with simple_displaced_step_copy_insn. */ -extern void - simple_displaced_step_free_closure (struct gdbarch *gdbarch, - struct displaced_step_closure *closure); +struct dwarf2_frame_state; + +template +struct bp_manipulation +{ + static int + kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) + { + return bp_size; + } + + static const gdb_byte * + bp_from_kind (struct gdbarch *gdbarch, int kind, int *size) + { + *size = kind; + return break_insn; + } +}; + +template +struct bp_manipulation_endian +{ + static int + kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) + { + return bp_size; + } + + static const gdb_byte * + bp_from_kind (struct gdbarch *gdbarch, int kind, int *size) + { + *size = kind; + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + return break_insn_big; + else + return break_insn_little; + } +}; + +#define BP_MANIPULATION(BREAK_INSN) \ + bp_manipulation + +#define BP_MANIPULATION_ENDIAN(BREAK_INSN_LITTLE, BREAK_INSN_BIG) \ + bp_manipulation_endian /* Default implementation of gdbarch_displaced_hw_singlestep. */ extern int @@ -84,6 +113,11 @@ CORE_ADDR default_adjust_dwarf2_addr (CORE_ADDR pc); CORE_ADDR default_adjust_dwarf2_line (CORE_ADDR addr, int rel); +/* Default DWARF vendor CFI handler. */ + +bool default_execute_dwarf_cfa_vendor_op (struct gdbarch *gdbarch, gdb_byte op, + struct dwarf2_frame_state *fs); + /* Version of cannot_fetch_register() / cannot_store_register() that always fails. */ @@ -95,6 +129,11 @@ int cannot_register_not (struct gdbarch *gdbarch, int regnum); extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer; +/* Default implementation of gdbarch_floatformat_for_type. */ +extern const struct floatformat ** + default_floatformat_for_type (struct gdbarch *gdbarch, + const char *name, int len); + extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc); @@ -107,6 +146,9 @@ extern int generic_in_solib_return_trampoline (struct gdbarch *gdbarch, extern int generic_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc); +extern int default_code_of_frame_writable (struct gdbarch *gdbarch, + struct frame_info *frame); + /* By default, registers are not convertible. */ extern int generic_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type); @@ -161,11 +203,15 @@ 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, - int *isize, char **msg); + CORE_ADDR addr, std::string *msg); -extern void default_remote_breakpoint_from_pc (struct gdbarch *, - CORE_ADDR *pcptr, int *kindptr); +extern const gdb_byte *default_breakpoint_from_pc (struct gdbarch *gdbarch, + CORE_ADDR *pcptr, + int *lenptr); + +extern int default_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, + struct regcache *regcache, + CORE_ADDR *pcptr); extern void default_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, @@ -201,8 +247,33 @@ 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); -#endif +extern void default_guess_tracepoint_registers (struct gdbarch *gdbarch, + struct regcache *regcache, + CORE_ADDR addr); + +extern int default_print_insn (bfd_vma memaddr, disassemble_info *info); + +/* Wrapper to gdbarch_skip_prologue, but doesn't throw exception. Catch + exception thrown from gdbarch_skip_prologue, and return PC. */ + +extern CORE_ADDR gdbarch_skip_prologue_noexcept (gdbarch *gdbarch, + CORE_ADDR pc) noexcept; + +/* 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); + +#endif /* ARCH_UTILS_H */