* alpha-tdep.c (alpha_register_name): New function.
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
index 2a9fe711791a2e4c05f10177f284ef80ac2ae8d9..8cac8cb2712df6b4f9c629552e873fc877fade2b 100644 (file)
 #define GDBARCH_H
 
 #include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
+#if !GDB_MULTI_ARCH
+#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro.  */
+#endif
 
 struct frame_info;
 struct value;
-
+struct objfile;
 
 extern struct gdbarch *current_gdbarch;
 
@@ -284,6 +287,24 @@ extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
 #endif
 #endif
 
+/* One if `char' acts like `signed char', zero if `unsigned char'. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED)
+#define TARGET_CHAR_SIGNED (1)
+#endif
+
+extern int gdbarch_char_signed (struct gdbarch *gdbarch);
+extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED)
+#error "Non multi-arch definition of TARGET_CHAR_SIGNED"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED)
+#define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch))
+#endif
+#endif
+
 /* Default (value) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (IEEE_FLOAT)
 #define IEEE_FLOAT (0)
@@ -1167,6 +1188,26 @@ extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarc
    be updated.  Typically it will be defined on a per-architecture
    basis. */
 
+#if defined (FETCH_PSEUDO_REGISTER)
+/* Legacy for systems yet to multi-arch FETCH_PSEUDO_REGISTER */
+#if !defined (FETCH_PSEUDO_REGISTER_P)
+#define FETCH_PSEUDO_REGISTER_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER_P)
+#define FETCH_PSEUDO_REGISTER_P() (0)
+#endif
+
+extern int gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER_P)
+#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER_P)
+#define FETCH_PSEUDO_REGISTER_P() (gdbarch_fetch_pseudo_register_p (current_gdbarch))
+#endif
+
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
 #define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0)
@@ -1188,6 +1229,26 @@ extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_
    be set or stored.  Typically it will be defined on a
    per-architecture basis. */
 
+#if defined (STORE_PSEUDO_REGISTER)
+/* Legacy for systems yet to multi-arch STORE_PSEUDO_REGISTER */
+#if !defined (STORE_PSEUDO_REGISTER_P)
+#define STORE_PSEUDO_REGISTER_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER_P)
+#define STORE_PSEUDO_REGISTER_P() (0)
+#endif
+
+extern int gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER_P)
+#error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER_P)
+#define STORE_PSEUDO_REGISTER_P() (gdbarch_store_pseudo_register_p (current_gdbarch))
+#endif
+
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
 #define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0)
@@ -1329,6 +1390,31 @@ extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_
 #endif
 #endif
 
+#if defined (PUSH_RETURN_ADDRESS)
+/* Legacy for systems yet to multi-arch PUSH_RETURN_ADDRESS */
+#if !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_push_return_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS_P)
+#error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (gdbarch_push_return_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS)
+#define PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "PUSH_RETURN_ADDRESS"), 0)
+#endif
+
 typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
 extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
 extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address);
@@ -1414,6 +1500,11 @@ extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, g
 #endif
 #endif
 
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION)
+#define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type))
+#endif
+
 typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
 extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
 extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
@@ -1438,6 +1529,31 @@ extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_
 #endif
 #endif
 
+#if defined (INIT_EXTRA_FRAME_INFO)
+/* Legacy for systems yet to multi-arch INIT_EXTRA_FRAME_INFO */
+#if !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (0)
+#endif
+
+extern int gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO_P)
+#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (gdbarch_init_extra_frame_info_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO)
+#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "INIT_EXTRA_FRAME_INFO"), 0)
+#endif
+
 typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
 extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
 extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info);
@@ -2020,6 +2136,91 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s
 #endif
 #endif
 
+/* For SVR4 shared libraries, each call goes through a small piece of
+   trampoline code in the ".plt" section.  IN_SOLIB_CALL_TRAMPOLINE evaluates
+   to nonzero if we are current stopped in one of these. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
+#endif
+
+typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
+extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
+extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
+#error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE)
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
+#endif
+#endif
+
+/* A target might have problems with watchpoints as soon as the stack
+   frame of the current function has been destroyed.  This mostly happens
+   as the first action in a funtion's epilogue.  in_function_epilogue_p()
+   is defined to return a non-zero value if either the given addr is one
+   instruction after the stack destroying instruction up to the trailing
+   return instruction or if we can figure out that the stack frame has
+   already been invalidated regardless of the value of addr.  Targets
+   which don't suffer from that problem could just let this functionality
+   untouched. */
+
+typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p);
+
+/* Given a vector of command-line arguments, return a newly allocated
+   string which, when passed to the create_inferior function, will be
+   parsed (on Unix systems, by the shell) to yield the same vector.
+   This function should call error() if the argument vector is not
+   representable for this target or if this target does not support
+   command-line arguments.
+   ARGC is the number of elements in the vector.
+   ARGV is an array of strings, one per argument. */
+
+typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv);
+extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv);
+extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments);
+
+#if defined (DWARF2_BUILD_FRAME_INFO)
+/* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */
+#if !defined (DWARF2_BUILD_FRAME_INFO_P)
+#define DWARF2_BUILD_FRAME_INFO_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P)
+#define DWARF2_BUILD_FRAME_INFO_P() (0)
+#endif
+
+extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P)
+#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P)
+#define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO)
+#define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0)
+#endif
+
+typedef void (gdbarch_dwarf2_build_frame_info_ftype) (struct objfile *objfile);
+extern void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile);
+extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO)
+#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO)
+#define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile))
+#endif
+#endif
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
@@ -2062,8 +2263,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
    The INIT function parameter INFO shall, as far as possible, be
    pre-initialized with information obtained from INFO.ABFD or
-   previously selected architecture (if similar).  INIT shall ensure
-   that the INFO.BYTE_ORDER is non-zero.
+   previously selected architecture (if similar).
 
    The INIT function shall return any of: NULL - indicating that it
    doesn't recognize the selected architecture; an existing ``struct
@@ -2087,7 +2287,7 @@ struct gdbarch_info
   /* Use default: NULL (ZERO). */
   const struct bfd_arch_info *bfd_arch_info;
 
-  /* Use default: 0 (ZERO). */
+  /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO).  */
   int byte_order;
 
   /* Use default: NULL (ZERO). */
This page took 0.026309 seconds and 4 git commands to generate.