Corrected spelling error in comment: swaped -> swapped.
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
index 967534ee372e5f26b4ae648899dafa08590f3a86..1bdf278d4f7ecfe54ff56ba05273ff33d156c06d 100644 (file)
 
 /* This file was created with the aid of ``gdbarch.sh''.
 
-   The bourn shell script ``gdbarch.sh'' creates the files
+   The Bourne shell script ``gdbarch.sh'' creates the files
    ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
    against the existing ``gdbarch.[hc]''.  Any differences found
    being reported.
 
    If editing this file, please also run gdbarch.sh and merge any
-   changes into that script. Conversely, when makeing sweeping changes
+   changes into that script. Conversely, when making sweeping changes
    to this file, modifying gdbarch.sh and using its output may prove
    easier. */
 
@@ -128,8 +128,6 @@ struct gdbarch
 
      */
 
-  int bfd_vma_bit;
-  int ptr_bit;
   int short_bit;
   int int_bit;
   int long_bit;
@@ -137,6 +135,9 @@ struct gdbarch
   int float_bit;
   int double_bit;
   int long_double_bit;
+  int ptr_bit;
+  int addr_bit;
+  int bfd_vma_bit;
   int ieee_float;
   gdbarch_read_pc_ftype *read_pc;
   gdbarch_write_pc_ftype *write_pc;
@@ -145,6 +146,7 @@ struct gdbarch
   gdbarch_read_sp_ftype *read_sp;
   gdbarch_write_sp_ftype *write_sp;
   int num_regs;
+  int num_pseudo_regs;
   int sp_regnum;
   int fp_regnum;
   int pc_regnum;
@@ -160,6 +162,8 @@ struct gdbarch
   gdbarch_register_virtual_size_ftype *register_virtual_size;
   int max_register_virtual_size;
   gdbarch_register_virtual_type_ftype *register_virtual_type;
+  gdbarch_do_registers_info_ftype *do_registers_info;
+  gdbarch_register_sim_regno_ftype *register_sim_regno;
   int use_generic_dummy_frames;
   int call_dummy_location;
   gdbarch_call_dummy_address_ftype *call_dummy_address;
@@ -181,6 +185,8 @@ struct gdbarch
   gdbarch_register_convertible_ftype *register_convertible;
   gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
   gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
+  gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register;
+  gdbarch_store_pseudo_register_ftype *store_pseudo_register;
   gdbarch_pointer_to_address_ftype *pointer_to_address;
   gdbarch_address_to_pointer_ftype *address_to_pointer;
   gdbarch_return_value_on_stack_ftype *return_value_on_stack;
@@ -220,6 +226,7 @@ struct gdbarch
   gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
   gdbarch_frame_num_args_ftype *frame_num_args;
   gdbarch_stack_align_ftype *stack_align;
+  int extra_stack_alignment_needed;
   gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
   gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
   const struct floatformat * float_format;
@@ -243,8 +250,6 @@ struct gdbarch startup_gdbarch =
   /*per-architecture data-pointers and swap regions */
   0, NULL, NULL,
   /* Multi-arch values */
-  8 * sizeof (void*),
-  8 * sizeof (void*),
   8 * sizeof (short),
   8 * sizeof (int),
   8 * sizeof (long),
@@ -252,6 +257,12 @@ struct gdbarch startup_gdbarch =
   8 * sizeof (float),
   8 * sizeof (double),
   8 * sizeof (long double),
+  8 * sizeof (void*),
+  8 * sizeof (void*),
+  8 * sizeof (void*),
+  0,
+  0,
+  0,
   0,
   0,
   0,
@@ -340,13 +351,16 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  0,
+  0,
+  0,
   /* startup_gdbarch() */
 };
 
 struct gdbarch *current_gdbarch = &startup_gdbarch;
 
 
-/* Create a new ``struct gdbarch'' based in information provided by
+/* Create a new ``struct gdbarch'' based on information provided by
    ``struct gdbarch_info''. */
 
 struct gdbarch *
@@ -362,7 +376,21 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->byte_order = info->byte_order;
 
   /* Force the explicit initialization of these. */
+  gdbarch->short_bit = 2*TARGET_CHAR_BIT;
+  gdbarch->int_bit = 4*TARGET_CHAR_BIT;
+  gdbarch->long_bit = 4*TARGET_CHAR_BIT;
+  gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
+  gdbarch->float_bit = 4*TARGET_CHAR_BIT;
+  gdbarch->double_bit = 8*TARGET_CHAR_BIT;
+  gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
+  gdbarch->ptr_bit = TARGET_INT_BIT;
   gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
+  gdbarch->read_pc = generic_target_read_pc;
+  gdbarch->write_pc = generic_target_write_pc;
+  gdbarch->read_fp = generic_target_read_fp;
+  gdbarch->write_fp = generic_target_write_fp;
+  gdbarch->read_sp = generic_target_read_sp;
+  gdbarch->write_sp = generic_target_write_sp;
   gdbarch->num_regs = -1;
   gdbarch->sp_regnum = -1;
   gdbarch->fp_regnum = -1;
@@ -375,6 +403,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->register_bytes = -1;
   gdbarch->max_register_raw_size = -1;
   gdbarch->max_register_virtual_size = -1;
+  gdbarch->do_registers_info = do_registers_info;
+  gdbarch->register_sim_regno = default_register_sim_regno;
   gdbarch->use_generic_dummy_frames = -1;
   gdbarch->call_dummy_start_offset = -1;
   gdbarch->call_dummy_breakpoint_offset = -1;
@@ -398,6 +428,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
   gdbarch->frame_args_skip = -1;
   gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
+  gdbarch->extra_stack_alignment_needed = 1;
   /* gdbarch_alloc() */
 
   return gdbarch;
@@ -424,7 +455,7 @@ static void
 verify_gdbarch (struct gdbarch *gdbarch)
 {
   /* Only perform sanity checks on a multi-arch target. */
-  if (GDB_MULTI_ARCH <= 0)
+  if (!GDB_MULTI_ARCH)
     return;
   /* fundamental */
   if (gdbarch->byte_order == 0)
@@ -432,53 +463,28 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if (gdbarch->bfd_arch_info == NULL)
     internal_error ("verify_gdbarch: bfd_arch_info unset");
   /* Check those that need to be defined for the given multi-arch level. */
+  /* Skip verify of short_bit, invalid_p == 0 */
+  /* Skip verify of int_bit, invalid_p == 0 */
+  /* Skip verify of long_bit, invalid_p == 0 */
+  /* Skip verify of long_long_bit, invalid_p == 0 */
+  /* Skip verify of float_bit, invalid_p == 0 */
+  /* Skip verify of double_bit, invalid_p == 0 */
+  /* Skip verify of long_double_bit, invalid_p == 0 */
+  /* Skip verify of ptr_bit, invalid_p == 0 */
+  if (gdbarch->addr_bit == 0)
+    gdbarch->addr_bit = TARGET_PTR_BIT;
   /* Skip verify of bfd_vma_bit, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->ptr_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->short_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->int_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->long_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->long_long_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->float_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->double_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->long_double_bit == 0))
-    internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
   /* Skip verify of ieee_float, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->read_pc == 0))
-    internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->write_pc == 0))
-    internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->read_fp == 0))
-    internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->write_fp == 0))
-    internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->read_sp == 0))
-    internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->write_sp == 0))
-    internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
+  /* Skip verify of read_pc, invalid_p == 0 */
+  /* Skip verify of write_pc, invalid_p == 0 */
+  /* Skip verify of read_fp, invalid_p == 0 */
+  /* Skip verify of write_fp, invalid_p == 0 */
+  /* Skip verify of read_sp, invalid_p == 0 */
+  /* Skip verify of write_sp, invalid_p == 0 */
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->num_regs == -1))
     internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
+  /* Skip verify of num_pseudo_regs, invalid_p == 0 */
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->sp_regnum == -1))
     internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
@@ -516,6 +522,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->register_virtual_type == 0))
     internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
+  /* Skip verify of do_registers_info, invalid_p == 0 */
+  /* Skip verify of register_sim_regno, invalid_p == 0 */
   if ((GDB_MULTI_ARCH >= 1)
       && (gdbarch->use_generic_dummy_frames == -1))
     internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
@@ -561,6 +569,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of register_convertible, invalid_p == 0 */
   /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
   /* Skip verify of register_convert_to_raw, invalid_p == 0 */
+  /* Skip verify of fetch_pseudo_register, invalid_p == 0 */
+  /* Skip verify of store_pseudo_register, invalid_p == 0 */
   /* Skip verify of pointer_to_address, invalid_p == 0 */
   /* Skip verify of address_to_pointer, invalid_p == 0 */
   /* Skip verify of return_value_on_stack, invalid_p == 0 */
@@ -646,6 +656,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
       && (gdbarch->frame_num_args == 0))
     internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
   /* Skip verify of stack_align, has predicate */
+  /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
   /* Skip verify of reg_struct_has_addr, has predicate */
   /* Skip verify of save_dummy_frame_tos, has predicate */
   if (gdbarch->float_format == 0)
@@ -681,16 +692,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
                       XSTRING (TARGET_BYTE_ORDER));
 #endif
-#ifdef TARGET_BFD_VMA_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
-                      XSTRING (TARGET_BFD_VMA_BIT));
-#endif
-#ifdef TARGET_PTR_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_PTR_BIT # %s\n",
-                      XSTRING (TARGET_PTR_BIT));
-#endif
 #ifdef TARGET_SHORT_BIT
   fprintf_unfiltered (file,
                       "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
@@ -726,6 +727,21 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
                       XSTRING (TARGET_LONG_DOUBLE_BIT));
 #endif
+#ifdef TARGET_PTR_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_PTR_BIT # %s\n",
+                      XSTRING (TARGET_PTR_BIT));
+#endif
+#ifdef TARGET_ADDR_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
+                      XSTRING (TARGET_ADDR_BIT));
+#endif
+#ifdef TARGET_BFD_VMA_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
+                      XSTRING (TARGET_BFD_VMA_BIT));
+#endif
 #ifdef IEEE_FLOAT
   fprintf_unfiltered (file,
                       "gdbarch_dump: IEEE_FLOAT # %s\n",
@@ -737,7 +753,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "TARGET_READ_PC(pid)",
                       XSTRING (TARGET_READ_PC (pid)));
 #endif
-#ifdef TARGET_WRITE_PC
+#if defined (TARGET_WRITE_PC) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "TARGET_WRITE_PC(val, pid)",
@@ -749,7 +766,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "TARGET_READ_FP()",
                       XSTRING (TARGET_READ_FP ()));
 #endif
-#ifdef TARGET_WRITE_FP
+#if defined (TARGET_WRITE_FP) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "TARGET_WRITE_FP(val)",
@@ -761,7 +779,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "TARGET_READ_SP()",
                       XSTRING (TARGET_READ_SP ()));
 #endif
-#ifdef TARGET_WRITE_SP
+#if defined (TARGET_WRITE_SP) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "TARGET_WRITE_SP(val)",
@@ -772,6 +791,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: NUM_REGS # %s\n",
                       XSTRING (NUM_REGS));
 #endif
+#ifdef NUM_PSEUDO_REGS
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
+                      XSTRING (NUM_PSEUDO_REGS));
+#endif
 #ifdef SP_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: SP_REGNUM # %s\n",
@@ -852,6 +876,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "REGISTER_VIRTUAL_TYPE(reg_nr)",
                       XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
 #endif
+#if defined (DO_REGISTERS_INFO) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DO_REGISTERS_INFO(reg_nr, fpregs)",
+                      XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
+#endif
+#ifdef REGISTER_SIM_REGNO
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "REGISTER_SIM_REGNO(reg_nr)",
+                      XSTRING (REGISTER_SIM_REGNO (reg_nr)));
+#endif
 #ifdef USE_GENERIC_DUMMY_FRAMES
   fprintf_unfiltered (file,
                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
@@ -919,7 +956,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
                       XSTRING (CALL_DUMMY_STACK_ADJUST));
 #endif
-#ifdef FIX_CALL_DUMMY
+#if defined (FIX_CALL_DUMMY) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
@@ -941,7 +979,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
                       XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
 #endif
-#ifdef GET_SAVED_REGISTER
+#if defined (GET_SAVED_REGISTER) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
@@ -953,25 +992,42 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "REGISTER_CONVERTIBLE(nr)",
                       XSTRING (REGISTER_CONVERTIBLE (nr)));
 #endif
-#ifdef REGISTER_CONVERT_TO_VIRTUAL
+#if defined (REGISTER_CONVERT_TO_VIRTUAL) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
                       XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
 #endif
-#ifdef REGISTER_CONVERT_TO_RAW
+#if defined (REGISTER_CONVERT_TO_RAW) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
                       XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
 #endif
+#if defined (FETCH_PSEUDO_REGISTER) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "FETCH_PSEUDO_REGISTER(regnum)",
+                      XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
+#endif
+#if defined (STORE_PSEUDO_REGISTER) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "STORE_PSEUDO_REGISTER(regnum)",
+                      XSTRING (STORE_PSEUDO_REGISTER (regnum)));
+#endif
 #ifdef POINTER_TO_ADDRESS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "POINTER_TO_ADDRESS(type, buf)",
                       XSTRING (POINTER_TO_ADDRESS (type, buf)));
 #endif
-#ifdef ADDRESS_TO_POINTER
+#if defined (ADDRESS_TO_POINTER) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "ADDRESS_TO_POINTER(type, buf, addr)",
@@ -983,7 +1039,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "RETURN_VALUE_ON_STACK(type)",
                       XSTRING (RETURN_VALUE_ON_STACK (type)));
 #endif
-#ifdef EXTRACT_RETURN_VALUE
+#if defined (EXTRACT_RETURN_VALUE) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
@@ -995,7 +1052,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
                       XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
 #endif
-#ifdef PUSH_DUMMY_FRAME
+#if defined (PUSH_DUMMY_FRAME) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "PUSH_DUMMY_FRAME(-)",
@@ -1007,7 +1065,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "PUSH_RETURN_ADDRESS(pc, sp)",
                       XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
 #endif
-#ifdef POP_FRAME
+#if defined (POP_FRAME) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "POP_FRAME(-)",
@@ -1049,13 +1108,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "D10V_CONVERT_IADDR_TO_RAW(x)",
                       XSTRING (D10V_CONVERT_IADDR_TO_RAW (x)));
 #endif
-#ifdef STORE_STRUCT_RETURN
+#if defined (STORE_STRUCT_RETURN) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "STORE_STRUCT_RETURN(addr, sp)",
                       XSTRING (STORE_STRUCT_RETURN (addr, sp)));
 #endif
-#ifdef STORE_RETURN_VALUE
+#if defined (STORE_RETURN_VALUE) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "STORE_RETURN_VALUE(type, valbuf)",
@@ -1073,13 +1134,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "USE_STRUCT_CONVENTION(gcc_p, value_type)",
                       XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
 #endif
-#ifdef FRAME_INIT_SAVED_REGS
+#if defined (FRAME_INIT_SAVED_REGS) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "FRAME_INIT_SAVED_REGS(frame)",
                       XSTRING (FRAME_INIT_SAVED_REGS (frame)));
 #endif
-#ifdef INIT_EXTRA_FRAME_INFO
+#if defined (INIT_EXTRA_FRAME_INFO) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
@@ -1131,7 +1194,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
                       XSTRING (FUNCTION_START_OFFSET));
 #endif
-#ifdef REMOTE_TRANSLATE_XFER_ADDRESS
+#if defined (REMOTE_TRANSLATE_XFER_ADDRESS) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
@@ -1196,13 +1260,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "STACK_ALIGN(sp)",
                       XSTRING (STACK_ALIGN (sp)));
 #endif
+#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
+                      XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
+#endif
 #ifdef REG_STRUCT_HAS_ADDR
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REG_STRUCT_HAS_ADDR(gcc_p, type)",
                       XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
 #endif
-#ifdef SAVE_DUMMY_FRAME_TOS
+#if defined (SAVE_DUMMY_FRAME_TOS) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "SAVE_DUMMY_FRAME_TOS(sp)",
@@ -1234,16 +1304,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
                       (long) TARGET_BYTE_ORDER);
 #endif
-#ifdef TARGET_BFD_VMA_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
-                      (long) TARGET_BFD_VMA_BIT);
-#endif
-#ifdef TARGET_PTR_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
-                      (long) TARGET_PTR_BIT);
-#endif
 #ifdef TARGET_SHORT_BIT
   fprintf_unfiltered (file,
                       "gdbarch_dump: TARGET_SHORT_BIT = %ld\n",
@@ -1279,6 +1339,21 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %ld\n",
                       (long) TARGET_LONG_DOUBLE_BIT);
 #endif
+#ifdef TARGET_PTR_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
+                      (long) TARGET_PTR_BIT);
+#endif
+#ifdef TARGET_ADDR_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_ADDR_BIT = %ld\n",
+                      (long) TARGET_ADDR_BIT);
+#endif
+#ifdef TARGET_BFD_VMA_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
+                      (long) TARGET_BFD_VMA_BIT);
+#endif
 #ifdef IEEE_FLOAT
   fprintf_unfiltered (file,
                       "gdbarch_dump: IEEE_FLOAT = %ld\n",
@@ -1331,6 +1406,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: NUM_REGS = %ld\n",
                       (long) NUM_REGS);
 #endif
+#ifdef NUM_PSEUDO_REGS
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: NUM_PSEUDO_REGS = %ld\n",
+                      (long) NUM_PSEUDO_REGS);
+#endif
 #ifdef SP_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: SP_REGNUM = %ld\n",
@@ -1416,6 +1496,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->register_virtual_type
                         /*REGISTER_VIRTUAL_TYPE ()*/);
 #endif
+#ifdef DO_REGISTERS_INFO
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
+                        (long) current_gdbarch->do_registers_info
+                        /*DO_REGISTERS_INFO ()*/);
+#endif
+#ifdef REGISTER_SIM_REGNO
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n",
+                        (long) current_gdbarch->register_sim_regno
+                        /*REGISTER_SIM_REGNO ()*/);
+#endif
 #ifdef USE_GENERIC_DUMMY_FRAMES
   fprintf_unfiltered (file,
                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
@@ -1439,9 +1533,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) CALL_DUMMY_START_OFFSET);
 #endif
 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
-                      (long) CALL_DUMMY_BREAKPOINT_OFFSET);
+  if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
+                        (long) CALL_DUMMY_BREAKPOINT_OFFSET);
 #endif
 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
   fprintf_unfiltered (file,
@@ -1539,6 +1634,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->register_convert_to_raw
                         /*REGISTER_CONVERT_TO_RAW ()*/);
 #endif
+#ifdef FETCH_PSEUDO_REGISTER
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
+                        (long) current_gdbarch->fetch_pseudo_register
+                        /*FETCH_PSEUDO_REGISTER ()*/);
+#endif
+#ifdef STORE_PSEUDO_REGISTER
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n",
+                        (long) current_gdbarch->store_pseudo_register
+                        /*STORE_PSEUDO_REGISTER ()*/);
+#endif
 #ifdef POINTER_TO_ADDRESS
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
@@ -1806,6 +1915,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->stack_align
                         /*STACK_ALIGN ()*/);
 #endif
+#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %ld\n",
+                      (long) EXTRA_STACK_ALIGNMENT_NEEDED);
+#endif
 #ifdef REG_STRUCT_HAS_ADDR
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
@@ -1864,44 +1978,10 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
   return gdbarch->byte_order;
 }
 
-int
-gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
-{
-  /* Skip verify of bfd_vma_bit, invalid_p == 0 */
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
-  return gdbarch->bfd_vma_bit;
-}
-
-void
-set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
-                         int bfd_vma_bit)
-{
-  gdbarch->bfd_vma_bit = bfd_vma_bit;
-}
-
-int
-gdbarch_ptr_bit (struct gdbarch *gdbarch)
-{
-  if (gdbarch->ptr_bit == 0)
-    internal_error ("gdbarch: gdbarch_ptr_bit invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
-  return gdbarch->ptr_bit;
-}
-
-void
-set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
-                     int ptr_bit)
-{
-  gdbarch->ptr_bit = ptr_bit;
-}
-
 int
 gdbarch_short_bit (struct gdbarch *gdbarch)
 {
-  if (gdbarch->short_bit == 0)
-    internal_error ("gdbarch: gdbarch_short_bit invalid");
+  /* Skip verify of short_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
   return gdbarch->short_bit;
@@ -1917,8 +1997,7 @@ set_gdbarch_short_bit (struct gdbarch *gdbarch,
 int
 gdbarch_int_bit (struct gdbarch *gdbarch)
 {
-  if (gdbarch->int_bit == 0)
-    internal_error ("gdbarch: gdbarch_int_bit invalid");
+  /* Skip verify of int_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
   return gdbarch->int_bit;
@@ -1934,8 +2013,7 @@ set_gdbarch_int_bit (struct gdbarch *gdbarch,
 int
 gdbarch_long_bit (struct gdbarch *gdbarch)
 {
-  if (gdbarch->long_bit == 0)
-    internal_error ("gdbarch: gdbarch_long_bit invalid");
+  /* Skip verify of long_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
   return gdbarch->long_bit;
@@ -1951,8 +2029,7 @@ set_gdbarch_long_bit (struct gdbarch *gdbarch,
 int
 gdbarch_long_long_bit (struct gdbarch *gdbarch)
 {
-  if (gdbarch->long_long_bit == 0)
-    internal_error ("gdbarch: gdbarch_long_long_bit invalid");
+  /* Skip verify of long_long_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
   return gdbarch->long_long_bit;
@@ -1968,8 +2045,7 @@ set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
 int
 gdbarch_float_bit (struct gdbarch *gdbarch)
 {
-  if (gdbarch->float_bit == 0)
-    internal_error ("gdbarch: gdbarch_float_bit invalid");
+  /* Skip verify of float_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
   return gdbarch->float_bit;
@@ -1985,8 +2061,7 @@ set_gdbarch_float_bit (struct gdbarch *gdbarch,
 int
 gdbarch_double_bit (struct gdbarch *gdbarch)
 {
-  if (gdbarch->double_bit == 0)
-    internal_error ("gdbarch: gdbarch_double_bit invalid");
+  /* Skip verify of double_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
   return gdbarch->double_bit;
@@ -2002,8 +2077,7 @@ set_gdbarch_double_bit (struct gdbarch *gdbarch,
 int
 gdbarch_long_double_bit (struct gdbarch *gdbarch)
 {
-  if (gdbarch->long_double_bit == 0)
-    internal_error ("gdbarch: gdbarch_long_double_bit invalid");
+  /* Skip verify of long_double_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
   return gdbarch->long_double_bit;
@@ -2016,6 +2090,55 @@ set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
   gdbarch->long_double_bit = long_double_bit;
 }
 
+int
+gdbarch_ptr_bit (struct gdbarch *gdbarch)
+{
+  /* Skip verify of ptr_bit, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
+  return gdbarch->ptr_bit;
+}
+
+void
+set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
+                     int ptr_bit)
+{
+  gdbarch->ptr_bit = ptr_bit;
+}
+
+int
+gdbarch_addr_bit (struct gdbarch *gdbarch)
+{
+  if (gdbarch->addr_bit == 0)
+    internal_error ("gdbarch: gdbarch_addr_bit invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
+  return gdbarch->addr_bit;
+}
+
+void
+set_gdbarch_addr_bit (struct gdbarch *gdbarch,
+                      int addr_bit)
+{
+  gdbarch->addr_bit = addr_bit;
+}
+
+int
+gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
+{
+  /* Skip verify of bfd_vma_bit, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
+  return gdbarch->bfd_vma_bit;
+}
+
+void
+set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
+                         int bfd_vma_bit)
+{
+  gdbarch->bfd_vma_bit = bfd_vma_bit;
+}
+
 int
 gdbarch_ieee_float (struct gdbarch *gdbarch)
 {
@@ -2151,6 +2274,22 @@ set_gdbarch_num_regs (struct gdbarch *gdbarch,
   gdbarch->num_regs = num_regs;
 }
 
+int
+gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
+{
+  /* Skip verify of num_pseudo_regs, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
+  return gdbarch->num_pseudo_regs;
+}
+
+void
+set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
+                             int num_pseudo_regs)
+{
+  gdbarch->num_pseudo_regs = num_pseudo_regs;
+}
+
 int
 gdbarch_sp_regnum (struct gdbarch *gdbarch)
 {
@@ -2403,6 +2542,40 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
   gdbarch->register_virtual_type = register_virtual_type;
 }
 
+void
+gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
+{
+  if (gdbarch->do_registers_info == 0)
+    internal_error ("gdbarch: gdbarch_do_registers_info invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
+  gdbarch->do_registers_info (reg_nr, fpregs);
+}
+
+void
+set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
+                               gdbarch_do_registers_info_ftype do_registers_info)
+{
+  gdbarch->do_registers_info = do_registers_info;
+}
+
+int
+gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
+{
+  if (gdbarch->register_sim_regno == 0)
+    internal_error ("gdbarch: gdbarch_register_sim_regno invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
+  return gdbarch->register_sim_regno (reg_nr);
+}
+
+void
+set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
+                                gdbarch_register_sim_regno_ftype register_sim_regno)
+{
+  gdbarch->register_sim_regno = register_sim_regno;
+}
+
 int
 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
 {
@@ -2754,6 +2927,40 @@ set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
   gdbarch->register_convert_to_raw = register_convert_to_raw;
 }
 
+void
+gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
+{
+  if (gdbarch->fetch_pseudo_register == 0)
+    internal_error ("gdbarch: gdbarch_fetch_pseudo_register invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n");
+  gdbarch->fetch_pseudo_register (regnum);
+}
+
+void
+set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
+                                   gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register)
+{
+  gdbarch->fetch_pseudo_register = fetch_pseudo_register;
+}
+
+void
+gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
+{
+  if (gdbarch->store_pseudo_register == 0)
+    internal_error ("gdbarch: gdbarch_store_pseudo_register invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n");
+  gdbarch->store_pseudo_register (regnum);
+}
+
+void
+set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
+                                   gdbarch_store_pseudo_register_ftype store_pseudo_register)
+{
+  gdbarch->store_pseudo_register = store_pseudo_register;
+}
+
 CORE_ADDR
 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
 {
@@ -3423,6 +3630,22 @@ set_gdbarch_stack_align (struct gdbarch *gdbarch,
   gdbarch->stack_align = stack_align;
 }
 
+int
+gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
+{
+  /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
+  return gdbarch->extra_stack_alignment_needed;
+}
+
+void
+set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
+                                          int extra_stack_alignment_needed)
+{
+  gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
+}
+
 int
 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
 {
@@ -3579,8 +3802,7 @@ init_gdbarch_data (struct gdbarch *gdbarch)
    data-pointer. */
 
 void *
-gdbarch_data (data)
-     struct gdbarch_data *data;
+gdbarch_data (struct gdbarch_data *data)
 {
   if (data->index >= current_gdbarch->nr_data)
     internal_error ("gdbarch_data: request for non-existant data.");
@@ -3589,7 +3811,7 @@ gdbarch_data (data)
 
 
 
-/* Keep a registrary of swaped data required by GDB modules. */
+/* Keep a registrary of swapped data required by GDB modules. */
 
 struct gdbarch_swap
 {
@@ -3808,7 +4030,7 @@ gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
    failed. */
 
 int
-gdbarch_update (struct gdbarch_info info)
+gdbarch_update_p (struct gdbarch_info info)
 {
   struct gdbarch *new_gdbarch;
   struct gdbarch_list **list;
@@ -3972,7 +4194,7 @@ disassemble_info tm_print_insn_info;
 extern void _initialize_gdbarch (void);
 
 void
-_initialize_gdbarch ()
+_initialize_gdbarch (void)
 {
   struct cmd_list_element *c;
 
This page took 0.047931 seconds and 4 git commands to generate.