From: Kevin Buettner Date: Mon, 13 Oct 2003 23:41:40 +0000 (+0000) Subject: * gdbarch.sh (ADJUST_BREAKPOINT_ADDRESS): New method. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a113152116cefd055d67b816cd19b98d8f03f0b4;p=binutils-gdb.git * gdbarch.sh (ADJUST_BREAKPOINT_ADDRESS): New method. * gdbarch.h, gdbarch.c: Regenerate. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1df41639a0d..0d5e155bff9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-10-13 Kevin Buettner + + * gdbarch.sh (ADJUST_BREAKPOINT_ADDRESS): New method. + * gdbarch.h, gdbarch.c: Regenerate. + 2003-10-11 Mark Kettenis * i386bsd-tdep.c (i386bsd_init_abi): Use ARRAY_SIZE to initialize diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index d5aa595a9be..feb67256069 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -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) { diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 3f8ee0da963..a82a12faac4 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -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); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index ccfde347b57..3835ac0b940 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -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