* gdbarch.sh (ADJUST_BREAKPOINT_ADDRESS): New method.
authorKevin Buettner <kevinb@redhat.com>
Mon, 13 Oct 2003 23:41:40 +0000 (23:41 +0000)
committerKevin Buettner <kevinb@redhat.com>
Mon, 13 Oct 2003 23:41:40 +0000 (23:41 +0000)
  * gdbarch.h, gdbarch.c: Regenerate.

gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh

index 1df41639a0d6c231ebc34fb3d52b919aae33df4a..0d5e155bff96b17db62e8e4da8cb294799eeb2ec 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-13  Kevin Buettner  <kevinb@redhat.com>
+
+       * gdbarch.sh (ADJUST_BREAKPOINT_ADDRESS): New method.
+       * gdbarch.h, gdbarch.c: Regenerate.
+
 2003-10-11  Mark Kettenis  <kettenis@gnu.org>
 
        * i386bsd-tdep.c (i386bsd_init_abi): Use ARRAY_SIZE to initialize
index d5aa595a9be9042c93e1d644be42a66fa786a211..feb6725606947a98e48ecef6ae8e21361eec9463 100644 (file)
@@ -219,6 +219,7 @@ struct gdbarch
   gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
   gdbarch_inner_than_ftype *inner_than;
   gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
+  gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
   gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
   gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
   CORE_ADDR decr_pc_after_break;
@@ -389,6 +390,7 @@ struct gdbarch startup_gdbarch =
   0,  /* prologue_frameless_p */
   0,  /* inner_than */
   0,  /* breakpoint_from_pc */
+  0,  /* adjust_breakpoint_address */
   0,  /* memory_insert_breakpoint */
   0,  /* memory_remove_breakpoint */
   0,  /* decr_pc_after_break */
@@ -710,6 +712,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->breakpoint_from_pc == 0))
     fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
+  /* Skip verify of adjust_breakpoint_address, has predicate */
   /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
   /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
@@ -876,6 +879,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) current_gdbarch->addr_bits_remove
                       /*ADDR_BITS_REMOVE ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
+                      gdbarch_adjust_breakpoint_address_p (current_gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: adjust_breakpoint_address = 0x%08lx\n",
+                      (long) current_gdbarch->adjust_breakpoint_address);
 #ifdef BELIEVE_PCC_PROMOTION
   fprintf_unfiltered (file,
                       "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
@@ -4534,6 +4543,30 @@ set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
   gdbarch->breakpoint_from_pc = breakpoint_from_pc;
 }
 
+int
+gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->adjust_breakpoint_address != NULL;
+}
+
+CORE_ADDR
+gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
+{
+  gdb_assert (gdbarch != NULL);
+  gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
+  return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
+}
+
+void
+set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
+                                       gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
+{
+  gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
+}
+
 int
 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
 {
index 3f8ee0da963290b9b47374074a63a7b8702f41f6..a82a12faac499015dc5d822bed8e60672186042a 100644 (file)
@@ -1644,6 +1644,12 @@ extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_bre
 #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
 #endif
 
+extern int gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_adjust_breakpoint_address_ftype) (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
+extern CORE_ADDR gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
+extern void set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address);
+
 typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
 extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
 extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
index ccfde347b57f1a0f5ce49a8f0820560f52454005..3835ac0b940b78bed4509cba86910f5248993f91 100755 (executable)
@@ -614,6 +614,7 @@ f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
 f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0
 f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
 f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0:
+M:2:ADJUST_BREAKPOINT_ADDRESS:CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
 f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
 f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1