Fix comments on `struct frame_info'.
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
index be5cccf9e2906669d1a34424e6a7f6c8773b6930..ced835485e9457fd49309e5657c7a48998ab144c 100644 (file)
@@ -150,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;
@@ -248,6 +249,7 @@ struct gdbarch
   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;
 };
 
 
@@ -331,6 +333,7 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  0,
   generic_get_saved_register,
   0,
   0,
@@ -381,6 +384,7 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  0,
   /* startup_gdbarch() */
 };
 
@@ -429,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;
@@ -479,6 +484,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->extra_stack_alignment_needed = 1;
   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;
@@ -534,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)
@@ -773,6 +780,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* 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 */
 }
 
 
@@ -894,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",
@@ -1457,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,
@@ -1564,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,
@@ -2181,6 +2209,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *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);
@@ -2497,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)
 {
@@ -4277,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. */
This page took 0.0289 seconds and 4 git commands to generate.