Fix comments on `struct frame_info'.
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
index d84e41deb571e304ab71ba07c34b7145ee06eaec..ced835485e9457fd49309e5657c7a48998ab144c 100644 (file)
@@ -61,6 +61,7 @@
 #include "floatformat.h"
 
 #include "gdb_assert.h"
+#include "gdb-events.h"
 
 /* Static function declarations */
 
@@ -149,6 +150,7 @@ struct gdbarch
   gdbarch_write_fp_ftype *write_fp;
   gdbarch_read_sp_ftype *read_sp;
   gdbarch_write_sp_ftype *write_sp;
+  gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
   gdbarch_register_read_ftype *register_read;
   gdbarch_register_write_ftype *register_write;
   int num_regs;
@@ -176,6 +178,8 @@ struct gdbarch
   gdbarch_do_registers_info_ftype *do_registers_info;
   gdbarch_register_sim_regno_ftype *register_sim_regno;
   gdbarch_register_bytes_ok_ftype *register_bytes_ok;
+  gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
+  gdbarch_cannot_store_register_ftype *cannot_store_register;
   int use_generic_dummy_frames;
   int call_dummy_location;
   gdbarch_call_dummy_address_ftype *call_dummy_address;
@@ -190,6 +194,8 @@ struct gdbarch
   int call_dummy_stack_adjust_p;
   int call_dummy_stack_adjust;
   gdbarch_fix_call_dummy_ftype *fix_call_dummy;
+  gdbarch_init_frame_pc_first_ftype *init_frame_pc_first;
+  gdbarch_init_frame_pc_ftype *init_frame_pc;
   int believe_pcc_promotion;
   int believe_pcc_promotion_type;
   gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
@@ -207,12 +213,6 @@ struct gdbarch
   gdbarch_push_dummy_frame_ftype *push_dummy_frame;
   gdbarch_push_return_address_ftype *push_return_address;
   gdbarch_pop_frame_ftype *pop_frame;
-  gdbarch_d10v_make_daddr_ftype *d10v_make_daddr;
-  gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
-  gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
-  gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
-  gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
-  gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
   gdbarch_store_struct_return_ftype *store_struct_return;
   gdbarch_store_return_value_ftype *store_return_value;
   gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
@@ -247,7 +247,9 @@ struct gdbarch
   const struct floatformat * double_format;
   const struct floatformat * long_double_format;
   gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
+  gdbarch_addr_bits_remove_ftype *addr_bits_remove;
   gdbarch_software_single_step_ftype *software_single_step;
+  gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
 };
 
 
@@ -327,12 +329,13 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
-  generic_get_saved_register,
   0,
   0,
   0,
   0,
   0,
+  generic_get_saved_register,
+  0,
   0,
   0,
   0,
@@ -387,6 +390,15 @@ struct gdbarch startup_gdbarch =
 
 struct gdbarch *current_gdbarch = &startup_gdbarch;
 
+/* Do any initialization needed for a non-multiarch configuration
+   after the _initialize_MODULE functions have been run.  */
+void
+initialize_non_multiarch ()
+{
+  alloc_gdbarch_data (&startup_gdbarch);
+  init_gdbarch_data (&startup_gdbarch);
+}
+
 
 /* Create a new ``struct gdbarch'' based on information provided by
    ``struct gdbarch_info''. */
@@ -421,6 +433,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->write_fp = generic_target_write_fp;
   gdbarch->read_sp = generic_target_read_sp;
   gdbarch->write_sp = generic_target_write_sp;
+  gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
   gdbarch->num_regs = -1;
   gdbarch->sp_regnum = -1;
   gdbarch->fp_regnum = -1;
@@ -440,6 +453,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->max_register_virtual_size = -1;
   gdbarch->do_registers_info = do_registers_info;
   gdbarch->register_sim_regno = default_register_sim_regno;
+  gdbarch->cannot_fetch_register = cannot_register_not;
+  gdbarch->cannot_store_register = cannot_register_not;
   gdbarch->use_generic_dummy_frames = -1;
   gdbarch->call_dummy_start_offset = -1;
   gdbarch->call_dummy_breakpoint_offset = -1;
@@ -449,6 +464,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->call_dummy_words = legacy_call_dummy_words;
   gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
   gdbarch->call_dummy_stack_adjust_p = -1;
+  gdbarch->init_frame_pc_first = init_frame_pc_noop;
+  gdbarch->init_frame_pc = init_frame_pc_default;
   gdbarch->coerce_float_to_double = default_coerce_float_to_double;
   gdbarch->register_convertible = generic_register_convertible_not;
   gdbarch->pointer_to_address = unsigned_pointer_to_address;
@@ -465,7 +482,9 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->frame_args_skip = -1;
   gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
   gdbarch->extra_stack_alignment_needed = 1;
-  gdbarch->convert_from_func_ptr_addr = default_convert_from_func_ptr_addr;
+  gdbarch->convert_from_func_ptr_addr = core_addr_identity;
+  gdbarch->addr_bits_remove = core_addr_identity;
+  gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
   /* gdbarch_alloc() */
 
   return gdbarch;
@@ -521,6 +540,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of write_fp, invalid_p == 0 */
   /* Skip verify of read_sp, invalid_p == 0 */
   /* Skip verify of write_sp, invalid_p == 0 */
+  /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
   /* Skip verify of register_read, has predicate */
   /* Skip verify of register_write, has predicate */
   if ((GDB_MULTI_ARCH >= 2)
@@ -584,6 +604,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of do_registers_info, invalid_p == 0 */
   /* Skip verify of register_sim_regno, invalid_p == 0 */
   /* Skip verify of register_bytes_ok, has predicate */
+  /* Skip verify of cannot_fetch_register, invalid_p == 0 */
+  /* Skip verify of cannot_store_register, invalid_p == 0 */
   if ((GDB_MULTI_ARCH >= 1)
       && (gdbarch->use_generic_dummy_frames == -1))
     internal_error (__FILE__, __LINE__,
@@ -634,6 +656,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
       && (gdbarch->fix_call_dummy == 0))
     internal_error (__FILE__, __LINE__,
                     "gdbarch: verify_gdbarch: fix_call_dummy invalid");
+  /* Skip verify of init_frame_pc_first, invalid_p == 0 */
+  /* Skip verify of init_frame_pc, invalid_p == 0 */
   /* Skip verify of coerce_float_to_double, invalid_p == 0 */
   if ((GDB_MULTI_ARCH >= 1)
       && (gdbarch->get_saved_register == 0))
@@ -667,12 +691,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
       && (gdbarch->pop_frame == 0))
     internal_error (__FILE__, __LINE__,
                     "gdbarch: verify_gdbarch: pop_frame invalid");
-  /* Skip verify of d10v_make_daddr, invalid_p == 0 */
-  /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
-  /* Skip verify of d10v_daddr_p, invalid_p == 0 */
-  /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
-  /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
-  /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->store_struct_return == 0))
     internal_error (__FILE__, __LINE__,
@@ -681,10 +699,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
       && (gdbarch->store_return_value == 0))
     internal_error (__FILE__, __LINE__,
                     "gdbarch: verify_gdbarch: store_return_value invalid");
-  if ((GDB_MULTI_ARCH >= 2)
-      && (gdbarch->extract_struct_value_address == 0))
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: verify_gdbarch: extract_struct_value_address invalid");
+  /* Skip verify of extract_struct_value_address, has predicate */
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->use_struct_convention == 0))
     internal_error (__FILE__, __LINE__,
@@ -763,7 +778,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if (gdbarch->long_double_format == 0)
     gdbarch->long_double_format = &floatformat_unknown;
   /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
+  /* Skip verify of addr_bits_remove, invalid_p == 0 */
   /* Skip verify of software_single_step, has predicate */
+  /* Skip verify of skip_trampoline_code, invalid_p == 0 */
 }
 
 
@@ -849,15 +866,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
 #ifdef TARGET_READ_PC
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
-                      "TARGET_READ_PC(pid)",
-                      XSTRING (TARGET_READ_PC (pid)));
+                      "TARGET_READ_PC(ptid)",
+                      XSTRING (TARGET_READ_PC (ptid)));
 #endif
 #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)",
-                      XSTRING (TARGET_WRITE_PC (val, pid)));
+                      "TARGET_WRITE_PC(val, ptid)",
+                      XSTRING (TARGET_WRITE_PC (val, ptid)));
 #endif
 #ifdef TARGET_READ_FP
   fprintf_unfiltered (file,
@@ -885,6 +902,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "TARGET_WRITE_SP(val)",
                       XSTRING (TARGET_WRITE_SP (val)));
 #endif
+#if defined (TARGET_VIRTUAL_FRAME_POINTER) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
+                      XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
+#endif
 #ifdef NUM_REGS
   fprintf_unfiltered (file,
                       "gdbarch_dump: NUM_REGS # %s\n",
@@ -1024,6 +1048,18 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "REGISTER_BYTES_OK(nr_bytes)",
                       XSTRING (REGISTER_BYTES_OK (nr_bytes)));
 #endif
+#ifdef CANNOT_FETCH_REGISTER
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "CANNOT_FETCH_REGISTER(regnum)",
+                      XSTRING (CANNOT_FETCH_REGISTER (regnum)));
+#endif
+#ifdef CANNOT_STORE_REGISTER
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "CANNOT_STORE_REGISTER(regnum)",
+                      XSTRING (CANNOT_STORE_REGISTER (regnum)));
+#endif
 #ifdef USE_GENERIC_DUMMY_FRAMES
   fprintf_unfiltered (file,
                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
@@ -1098,6 +1134,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
                       XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
 #endif
+#if defined (INIT_FRAME_PC_FIRST) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "INIT_FRAME_PC_FIRST(fromleaf, prev)",
+                      XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
+#endif
+#if defined (INIT_FRAME_PC) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "INIT_FRAME_PC(fromleaf, prev)",
+                      XSTRING (INIT_FRAME_PC (fromleaf, prev)));
+#endif
 #ifdef BELIEVE_PCC_PROMOTION
   fprintf_unfiltered (file,
                       "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
@@ -1207,42 +1257,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "POP_FRAME(-)",
                       XSTRING (POP_FRAME (-)));
 #endif
-#ifdef D10V_MAKE_DADDR
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "D10V_MAKE_DADDR(x)",
-                      XSTRING (D10V_MAKE_DADDR (x)));
-#endif
-#ifdef D10V_MAKE_IADDR
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "D10V_MAKE_IADDR(x)",
-                      XSTRING (D10V_MAKE_IADDR (x)));
-#endif
-#ifdef D10V_DADDR_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "D10V_DADDR_P(x)",
-                      XSTRING (D10V_DADDR_P (x)));
-#endif
-#ifdef D10V_IADDR_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "D10V_IADDR_P(x)",
-                      XSTRING (D10V_IADDR_P (x)));
-#endif
-#ifdef D10V_CONVERT_DADDR_TO_RAW
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "D10V_CONVERT_DADDR_TO_RAW(x)",
-                      XSTRING (D10V_CONVERT_DADDR_TO_RAW (x)));
-#endif
-#ifdef D10V_CONVERT_IADDR_TO_RAW
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "D10V_CONVERT_IADDR_TO_RAW(x)",
-                      XSTRING (D10V_CONVERT_IADDR_TO_RAW (x)));
-#endif
 #if defined (STORE_STRUCT_RETURN) && GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
@@ -1445,6 +1459,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
                       XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
 #endif
+#ifdef ADDR_BITS_REMOVE
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "ADDR_BITS_REMOVE(addr)",
+                      XSTRING (ADDR_BITS_REMOVE (addr)));
+#endif
 #if defined (SOFTWARE_SINGLE_STEP) && GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
   fprintf_unfiltered (file,
@@ -1452,6 +1472,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
                       XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
 #endif
+#ifdef SKIP_TRAMPOLINE_CODE
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "SKIP_TRAMPOLINE_CODE(pc)",
+                      XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
+#endif
 #ifdef TARGET_ARCHITECTURE
   if (TARGET_ARCHITECTURE != NULL)
     fprintf_unfiltered (file,
@@ -1559,6 +1585,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
                         (long) current_gdbarch->write_sp
                         /*TARGET_WRITE_SP ()*/);
+#endif
+#ifdef TARGET_VIRTUAL_FRAME_POINTER
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = 0x%08lx\n",
+                        (long) current_gdbarch->virtual_frame_pointer
+                        /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
 #endif
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
@@ -1719,6 +1752,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->register_bytes_ok
                         /*REGISTER_BYTES_OK ()*/);
 #endif
+#ifdef CANNOT_FETCH_REGISTER
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n",
+                        (long) current_gdbarch->cannot_fetch_register
+                        /*CANNOT_FETCH_REGISTER ()*/);
+#endif
+#ifdef CANNOT_STORE_REGISTER
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n",
+                        (long) current_gdbarch->cannot_store_register
+                        /*CANNOT_STORE_REGISTER ()*/);
+#endif
 #ifdef USE_GENERIC_DUMMY_FRAMES
   fprintf_unfiltered (file,
                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
@@ -1798,6 +1845,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->fix_call_dummy
                         /*FIX_CALL_DUMMY ()*/);
 #endif
+#ifdef INIT_FRAME_PC_FIRST
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
+                        (long) current_gdbarch->init_frame_pc_first
+                        /*INIT_FRAME_PC_FIRST ()*/);
+#endif
+#ifdef INIT_FRAME_PC
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
+                        (long) current_gdbarch->init_frame_pc
+                        /*INIT_FRAME_PC ()*/);
+#endif
 #ifdef BELIEVE_PCC_PROMOTION
   fprintf_unfiltered (file,
                       "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n",
@@ -1913,48 +1974,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->pop_frame
                         /*POP_FRAME ()*/);
 #endif
-#ifdef D10V_MAKE_DADDR
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: D10V_MAKE_DADDR = 0x%08lx\n",
-                        (long) current_gdbarch->d10v_make_daddr
-                        /*D10V_MAKE_DADDR ()*/);
-#endif
-#ifdef D10V_MAKE_IADDR
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: D10V_MAKE_IADDR = 0x%08lx\n",
-                        (long) current_gdbarch->d10v_make_iaddr
-                        /*D10V_MAKE_IADDR ()*/);
-#endif
-#ifdef D10V_DADDR_P
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: D10V_DADDR_P = 0x%08lx\n",
-                        (long) current_gdbarch->d10v_daddr_p
-                        /*D10V_DADDR_P ()*/);
-#endif
-#ifdef D10V_IADDR_P
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: D10V_IADDR_P = 0x%08lx\n",
-                        (long) current_gdbarch->d10v_iaddr_p
-                        /*D10V_IADDR_P ()*/);
-#endif
-#ifdef D10V_CONVERT_DADDR_TO_RAW
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
-                        (long) current_gdbarch->d10v_convert_daddr_to_raw
-                        /*D10V_CONVERT_DADDR_TO_RAW ()*/);
-#endif
-#ifdef D10V_CONVERT_IADDR_TO_RAW
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
-                        (long) current_gdbarch->d10v_convert_iaddr_to_raw
-                        /*D10V_CONVERT_IADDR_TO_RAW ()*/);
-#endif
 #ifdef STORE_STRUCT_RETURN
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
@@ -2177,12 +2196,26 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->convert_from_func_ptr_addr
                         /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
 #endif
+#ifdef ADDR_BITS_REMOVE
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n",
+                        (long) current_gdbarch->addr_bits_remove
+                        /*ADDR_BITS_REMOVE ()*/);
+#endif
 #ifdef SOFTWARE_SINGLE_STEP
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
                         "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
                         (long) current_gdbarch->software_single_step
                         /*SOFTWARE_SINGLE_STEP ()*/);
+#endif
+#ifdef SKIP_TRAMPOLINE_CODE
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n",
+                        (long) current_gdbarch->skip_trampoline_code
+                        /*SKIP_TRAMPOLINE_CODE ()*/);
 #endif
   if (current_gdbarch->dump_tdep != NULL)
     current_gdbarch->dump_tdep (current_gdbarch, file);
@@ -2392,14 +2425,14 @@ set_gdbarch_ieee_float (struct gdbarch *gdbarch,
 }
 
 CORE_ADDR
-gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
+gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
 {
   if (gdbarch->read_pc == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_read_pc invalid");
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
-  return gdbarch->read_pc (pid);
+  return gdbarch->read_pc (ptid);
 }
 
 void
@@ -2410,14 +2443,14 @@ set_gdbarch_read_pc (struct gdbarch *gdbarch,
 }
 
 void
-gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
+gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
 {
   if (gdbarch->write_pc == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_write_pc invalid");
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
-  gdbarch->write_pc (val, pid);
+  gdbarch->write_pc (val, ptid);
 }
 
 void
@@ -2499,6 +2532,24 @@ set_gdbarch_write_sp (struct gdbarch *gdbarch,
   gdbarch->write_sp = write_sp;
 }
 
+void
+gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
+{
+  if (gdbarch->virtual_frame_pointer == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_virtual_frame_pointer invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
+  gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
+}
+
+void
+set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
+                                   gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
+{
+  gdbarch->virtual_frame_pointer = virtual_frame_pointer;
+}
+
 int
 gdbarch_register_read_p (struct gdbarch *gdbarch)
 {
@@ -2995,6 +3046,42 @@ set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
   gdbarch->register_bytes_ok = register_bytes_ok;
 }
 
+int
+gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
+{
+  if (gdbarch->cannot_fetch_register == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_cannot_fetch_register invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
+  return gdbarch->cannot_fetch_register (regnum);
+}
+
+void
+set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
+                                   gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
+{
+  gdbarch->cannot_fetch_register = cannot_fetch_register;
+}
+
+int
+gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
+{
+  if (gdbarch->cannot_store_register == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_cannot_store_register invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
+  return gdbarch->cannot_store_register (regnum);
+}
+
+void
+set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
+                                   gdbarch_cannot_store_register_ftype cannot_store_register)
+{
+  gdbarch->cannot_store_register = cannot_store_register;
+}
+
 int
 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
 {
@@ -3243,6 +3330,42 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
   gdbarch->fix_call_dummy = fix_call_dummy;
 }
 
+void
+gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
+{
+  if (gdbarch->init_frame_pc_first == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_init_frame_pc_first invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n");
+  gdbarch->init_frame_pc_first (fromleaf, prev);
+}
+
+void
+set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
+                                 gdbarch_init_frame_pc_first_ftype init_frame_pc_first)
+{
+  gdbarch->init_frame_pc_first = init_frame_pc_first;
+}
+
+void
+gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
+{
+  if (gdbarch->init_frame_pc == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_init_frame_pc invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n");
+  gdbarch->init_frame_pc (fromleaf, prev);
+}
+
+void
+set_gdbarch_init_frame_pc (struct gdbarch *gdbarch,
+                           gdbarch_init_frame_pc_ftype init_frame_pc)
+{
+  gdbarch->init_frame_pc = init_frame_pc;
+}
+
 int
 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
 {
@@ -3543,114 +3666,6 @@ set_gdbarch_pop_frame (struct gdbarch *gdbarch,
   gdbarch->pop_frame = pop_frame;
 }
 
-CORE_ADDR
-gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
-{
-  if (gdbarch->d10v_make_daddr == 0)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_d10v_make_daddr invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
-  return gdbarch->d10v_make_daddr (x);
-}
-
-void
-set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch,
-                             gdbarch_d10v_make_daddr_ftype d10v_make_daddr)
-{
-  gdbarch->d10v_make_daddr = d10v_make_daddr;
-}
-
-CORE_ADDR
-gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
-{
-  if (gdbarch->d10v_make_iaddr == 0)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_d10v_make_iaddr invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
-  return gdbarch->d10v_make_iaddr (x);
-}
-
-void
-set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch,
-                             gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr)
-{
-  gdbarch->d10v_make_iaddr = d10v_make_iaddr;
-}
-
-int
-gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
-{
-  if (gdbarch->d10v_daddr_p == 0)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_d10v_daddr_p invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
-  return gdbarch->d10v_daddr_p (x);
-}
-
-void
-set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch,
-                          gdbarch_d10v_daddr_p_ftype d10v_daddr_p)
-{
-  gdbarch->d10v_daddr_p = d10v_daddr_p;
-}
-
-int
-gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
-{
-  if (gdbarch->d10v_iaddr_p == 0)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_d10v_iaddr_p invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
-  return gdbarch->d10v_iaddr_p (x);
-}
-
-void
-set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch,
-                          gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p)
-{
-  gdbarch->d10v_iaddr_p = d10v_iaddr_p;
-}
-
-CORE_ADDR
-gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
-{
-  if (gdbarch->d10v_convert_daddr_to_raw == 0)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
-  return gdbarch->d10v_convert_daddr_to_raw (x);
-}
-
-void
-set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch,
-                                       gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw)
-{
-  gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
-}
-
-CORE_ADDR
-gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
-{
-  if (gdbarch->d10v_convert_iaddr_to_raw == 0)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
-  return gdbarch->d10v_convert_iaddr_to_raw (x);
-}
-
-void
-set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch,
-                                       gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw)
-{
-  gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
-}
-
 void
 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
 {
@@ -3687,6 +3702,12 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch,
   gdbarch->store_return_value = store_return_value;
 }
 
+int
+gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
+{
+  return gdbarch->extract_struct_value_address != 0;
+}
+
 CORE_ADDR
 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
 {
@@ -4267,6 +4288,24 @@ set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
 }
 
+CORE_ADDR
+gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+  if (gdbarch->addr_bits_remove == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_addr_bits_remove invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
+  return gdbarch->addr_bits_remove (addr);
+}
+
+void
+set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
+                              gdbarch_addr_bits_remove_ftype addr_bits_remove)
+{
+  gdbarch->addr_bits_remove = addr_bits_remove;
+}
+
 int
 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
 {
@@ -4291,6 +4330,24 @@ set_gdbarch_software_single_step (struct gdbarch *gdbarch,
   gdbarch->software_single_step = software_single_step;
 }
 
+CORE_ADDR
+gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+  if (gdbarch->skip_trampoline_code == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_skip_trampoline_code invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
+  return gdbarch->skip_trampoline_code (pc);
+}
+
+void
+set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
+                                  gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
+{
+  gdbarch->skip_trampoline_code = skip_trampoline_code;
+}
+
 
 /* Keep a registry of per-architecture data-pointers required by GDB
    modules. */
@@ -4644,56 +4701,40 @@ gdbarch_update_p (struct gdbarch_info info)
   struct gdbarch_list **list;
   struct gdbarch_registration *rego;
 
-  /* Fill in any missing bits. Most important is the bfd_architecture
-     which is used to select the target architecture. */
-  if (info.bfd_architecture == bfd_arch_unknown)
-    {
-      if (info.bfd_arch_info != NULL)
-       info.bfd_architecture = info.bfd_arch_info->arch;
-      else if (info.abfd != NULL)
-       info.bfd_architecture = bfd_get_arch (info.abfd);
-      /* FIXME - should query BFD for its default architecture. */
-      else
-       info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
-    }
+  /* Fill in missing parts of the INFO struct using a number of
+     sources: ``set ...''; INFOabfd supplied; existing target.  */
+
+  /* ``(gdb) set architecture ...'' */
+  if (info.bfd_arch_info == NULL
+      && !TARGET_ARCHITECTURE_AUTO)
+    info.bfd_arch_info = TARGET_ARCHITECTURE;
+  if (info.bfd_arch_info == NULL
+      && info.abfd != NULL
+      && bfd_get_arch (info.abfd) != bfd_arch_unknown
+      && bfd_get_arch (info.abfd) != bfd_arch_obscure)
+    info.bfd_arch_info = bfd_get_arch_info (info.abfd);
   if (info.bfd_arch_info == NULL)
-    {
-      if (target_architecture_auto && info.abfd != NULL)
-       info.bfd_arch_info = bfd_get_arch_info (info.abfd);
-      else
-       info.bfd_arch_info = current_gdbarch->bfd_arch_info;
-    }
+    info.bfd_arch_info = TARGET_ARCHITECTURE;
+
+  /* ``(gdb) set byte-order ...'' */
+  if (info.byte_order == 0
+      && !TARGET_BYTE_ORDER_AUTO)
+    info.byte_order = TARGET_BYTE_ORDER;
+  /* From the INFO struct. */
+  if (info.byte_order == 0
+      && info.abfd != NULL)
+    info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
+                      : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
+                      : 0);
+  /* From the current target. */
   if (info.byte_order == 0)
-    {
-      if (target_byte_order_auto && info.abfd != NULL)
-       info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
-                          : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
-                          : 0);
-      else
-       info.byte_order = current_gdbarch->byte_order;
-      /* FIXME - should query BFD for its default byte-order. */
-    }
-  /* A default for abfd? */
+    info.byte_order = TARGET_BYTE_ORDER;
 
-  /* Find the target that knows about this architecture. */
-  for (rego = gdbarch_registry;
-       rego != NULL;
-       rego = rego->next)
-    if (rego->bfd_architecture == info.bfd_architecture)
-      break;
-  if (rego == NULL)
-    {
-      if (gdbarch_debug)
-       fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
-      return 0;
-    }
+  /* Must have found some sort of architecture. */
+  gdb_assert (info.bfd_arch_info != NULL);
 
   if (gdbarch_debug)
     {
-      fprintf_unfiltered (gdb_stdlog,
-                         "gdbarch_update: info.bfd_architecture %d (%s)\n",
-                         info.bfd_architecture,
-                         bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
       fprintf_unfiltered (gdb_stdlog,
                          "gdbarch_update: info.bfd_arch_info %s\n",
                          (info.bfd_arch_info != NULL
@@ -4713,6 +4754,19 @@ gdbarch_update_p (struct gdbarch_info info)
                          (long) info.tdep_info);
     }
 
+  /* Find the target that knows about this architecture. */
+  for (rego = gdbarch_registry;
+       rego != NULL;
+       rego = rego->next)
+    if (rego->bfd_architecture == info.bfd_arch_info->arch)
+      break;
+  if (rego == NULL)
+    {
+      if (gdbarch_debug)
+       fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
+      return 0;
+    }
+
   /* Ask the target for a replacement architecture. */
   new_gdbarch = rego->init (info, rego->arches);
 
@@ -4751,6 +4805,7 @@ gdbarch_update_p (struct gdbarch_info info)
                                new_gdbarch->bfd_arch_info->printable_name);
          current_gdbarch = new_gdbarch;
          swapin_gdbarch_swap (new_gdbarch);
+         architecture_changed_event ();
          return 1;
        }
     }
@@ -4784,7 +4839,8 @@ gdbarch_update_p (struct gdbarch_info info)
      registered an interest in this architecture.  CURRENT_GDBARCH
      must be updated before these modules are called. */
   init_gdbarch_data (new_gdbarch);
-  
+  architecture_changed_event ();
+
   if (gdbarch_debug)
     gdbarch_dump (current_gdbarch, gdb_stdlog);
 
This page took 0.033218 seconds and 4 git commands to generate.