diff options
-rw-r--r-- | gdb/ChangeLog | 37 | ||||
-rw-r--r-- | gdb/arch-utils.c | 43 | ||||
-rw-r--r-- | gdb/arch-utils.h | 5 | ||||
-rw-r--r-- | gdb/config/pa/tm-hppa.h | 3 | ||||
-rw-r--r-- | gdb/config/pa/tm-hppa64.h | 5 | ||||
-rw-r--r-- | gdb/config/sparc/tm-sparc.h | 8 | ||||
-rw-r--r-- | gdb/gdbarch.c | 5 | ||||
-rw-r--r-- | gdb/gdbarch.h | 5 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 2 | ||||
-rw-r--r-- | gdb/hppa-tdep.c | 8 | ||||
-rw-r--r-- | gdb/ia64-tdep.c | 6 | ||||
-rw-r--r-- | gdb/mem-break.c | 47 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 52 | ||||
-rw-r--r-- | gdb/monitor.c | 2 | ||||
-rw-r--r-- | gdb/proc-api.c | 10 | ||||
-rw-r--r-- | gdb/remote-mips.c | 14 | ||||
-rw-r--r-- | gdb/remote.c | 25 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 7 | ||||
-rw-r--r-- | gdb/s390-tdep.c | 6 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 10 | ||||
-rw-r--r-- | gdb/target.h | 13 |
21 files changed, 113 insertions, 200 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5802390..1011cc8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,42 @@ 2003-05-15 Andrew Cagney <cagney@redhat.com> + * arch-utils.h (legacy_breakpoint_from_pc): Delete declaration. + * target.h (memory_breakpoint_from_pc): Delete declaration. + * mem-break.c (memory_breakpoint_from_pc): Delete function. + * arch-utils.c (legacy_breakpoint_from_pc): Delete function. + * monitor.c (monitor_insert_breakpoint): Use + gdbarch_breakpoint_from_pc instead of memory_breakpoint_from_pc. + * gdbarch.sh (BREAKPOINT_FROM_PC): Do not provide a default. + * gdbarch.h, gdbarch.c: Re-generate. + * sparc-tdep.c (sparc_breakpoint_from_pc): New function. + (sparc_gdbarch_init): Set breakpoint_from_pc to + sparc_breakpoint_from_pc. + * config/sparc/tm-sparc.h (BREAKPOINT): Delete macro. + (BREAKPOINT_FROM_PC): Define. + (sparc_breakpoint_from_pc): Declare. + * hppa-tdep.c (hppa_breakpoint_from_pc): New function. + * config/pa/tm-hppa.h (hppa_breakpoint_from_pc): Declare. + (BREAKPOINT_FROM_PC): Define. + (BREAKPOINT): Delete macro. + * target.h: Update comment. + * s390-tdep.c (s390_gdbarch_init): Update comments. + * remote.c: Update comments. + * remote-mips.c: Update comments. + * proc-api.c (write_with_trace): Do not check for a breakpoint. + * mem-break.c: Update comment. + * ia64-tdep.c (IA64_BREAKPOINT): Rename BREAKPOINT. + (ia64_memory_insert_breakpoint): Update. + * config/sparc/tm-sparc.h: Update comment. + * config/pa/tm-hppa64.h: Update comment. + * rs6000-tdep.c (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Delete macro. + (rs6000_breakpoint_from_pc): Update. + * mips-tdep.c (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Delete macro. + (PMON_BIG_BREAKPOINT, PMON_LITTLE_BREAKPOINT): Delete macro. + (IDT_LITTLE_BREAKPOINT, IDT_LITTLE_BREAKPOINT): Delete macro. + (MIPS16_LITTLE_BREAKPOINT, MIPS16_BIG_BREAKPOINT): Delete macro. + (mips_breakpoint_from_pc): Update. + (mips_dump_tdep): Update. + * symtab.h (DEPRECATED_SYMBOL_MATCHES_NAME): Delete macro. * minsyms.c (lookup_minimal_symbol): Inline DEPRECATED_SYMBOL_MATCHES_NAME. Replace STREQ with strcmp. diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 2f555ff..48f7f7e 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -48,49 +48,6 @@ #include "floatformat.h" -/* Use the program counter to determine the contents and size - of a breakpoint instruction. If no target-dependent macro - BREAKPOINT_FROM_PC has been defined to implement this function, - assume that the breakpoint doesn't depend on the PC, and - use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros. - Return a pointer to a string of bytes that encode a breakpoint - instruction, stores the length of the string to *lenptr, - and optionally adjust the pc to point to the correct memory location - for inserting the breakpoint. */ - -const unsigned char * -legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) -{ - /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a - breakpoint. On some machines, breakpoints are handled by the - target environment and we don't have to worry about them here. */ -#ifdef BIG_BREAKPOINT - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - { - static unsigned char big_break_insn[] = BIG_BREAKPOINT; - *lenptr = sizeof (big_break_insn); - return big_break_insn; - } -#endif -#ifdef LITTLE_BREAKPOINT - if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG) - { - static unsigned char little_break_insn[] = LITTLE_BREAKPOINT; - *lenptr = sizeof (little_break_insn); - return little_break_insn; - } -#endif -#ifdef BREAKPOINT - { - static unsigned char break_insn[] = BREAKPOINT; - *lenptr = sizeof (break_insn); - return break_insn; - } -#endif - *lenptr = 0; - return NULL; -} - /* Implementation of extract return value that grubs around in the register cache. */ void diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index cf515a4..27f219b 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -40,11 +40,6 @@ extern CORE_ADDR generic_cannot_extract_struct_value_address (char *dummy); being passed */ extern gdbarch_frame_num_args_ftype frame_num_args_unknown; -/* Implementation of breakpoint from PC using any of the deprecated - macros BREAKPOINT, LITTLE_BREAKPOINT, BIG_BREAPOINT. For legacy - targets that don't yet implement their own breakpoint_from_pc(). */ -extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc; - /* Implementation of extract return value that grubs around in the register cache. */ extern gdbarch_extract_return_value_ftype legacy_extract_return_value; diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 7daa6f5..988b790 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -60,7 +60,8 @@ struct inferior_status; /* Sequence of bytes for breakpoint instruction. */ -#define BREAKPOINT {0x00, 0x01, 0x00, 0x04} +const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr); +#define BREAKPOINT_FROM_PC(PCPTR,LENPTR) hppa_breakpoint_from_pc ((PCPTR), (LENPTR)) #define BREAKPOINT32 0x10004 extern int hppa_pc_requires_run_before_use (CORE_ADDR pc); diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 4185f18..0d92311 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -97,9 +97,8 @@ extern CORE_ADDR hppa_stack_align (CORE_ADDR sp); #define STACK_ALIGN(sp) hppa_stack_align (sp) #endif -/* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. +/* Amount PC must be decremented by after a breakpoint. This is often + the number of bytes returned by BREAKPOINT_FROM_PC but not always. Not on the PA-RISC */ diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index a44b04e..95960b2 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -164,9 +164,8 @@ extern int sparc_intreg_size (void); #define FUNCTION_START_OFFSET 0 -/* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. */ +/* Amount PC must be decremented by after a breakpoint. This is often + the number of bytes returned by BREAKPOINT_FROM_PC but not always. */ #define DECR_PC_AFTER_BREAK 0 @@ -361,7 +360,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR); /* Sequence of bytes for breakpoint instruction (ta 1). */ -#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01} +extern const unsigned char *sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len); +#define BREAKPOINT_FROM_PC(PC,LEN) sparc_breakpoint_from_pc ((PC), (LEN)) /* Register numbers of various important registers. Note that some of these values are "real" register numbers, diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index db9e76e..eca8d9c 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -540,7 +540,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->store_return_value = legacy_store_return_value; current_gdbarch->use_struct_convention = generic_use_struct_convention; current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p; - current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; current_gdbarch->decr_pc_after_break = -1; @@ -701,7 +700,9 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->inner_than == 0)) fprintf_unfiltered (log, "\n\tinner_than"); - /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ + if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) + && (gdbarch->breakpoint_from_pc == 0)) + fprintf_unfiltered (log, "\n\tbreakpoint_from_pc"); /* 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) diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 1a8e386..b76f101 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -2163,11 +2163,6 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC) -#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr)) -#endif - typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 16165a9..5fb7085 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -591,7 +591,7 @@ F:2:DEPRECATED_INIT_EXTRA_FRAME_INFO:void:deprecated_init_extra_frame_info:int f 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:2:BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::0 +f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0: 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 diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 440f4c5..5cedfe7 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -642,6 +642,14 @@ find_unwind_entry (CORE_ADDR pc) return NULL; } +const unsigned char * +hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len) +{ + static const char breakpoint[] = {0x00, 0x01, 0x00, 0x04}; + (*len) = sizeof (breakpoint); + return breakpoint; +} + /* Return the adjustment necessary to make for addresses on the stack as presented by hpread.c. diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 43192d4..74be498 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -543,9 +543,9 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr) using the pattern seen below. */ #if 0 -#define BREAKPOINT 0x00002000040LL +#define IA64_BREAKPOINT 0x00002000040LL #endif -#define BREAKPOINT 0x00003333300LL +#define IA64_BREAKPOINT 0x00003333300LL static int ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache) @@ -573,7 +573,7 @@ ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache) instr = slotN_contents (bundle, slotnum); memcpy(contents_cache, &instr, sizeof(instr)); - replace_slotN_contents (bundle, BREAKPOINT, slotnum); + replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum); if (val == 0) target_write_memory (addr, bundle, BUNDLE_LEN); diff --git a/gdb/mem-break.c b/gdb/mem-break.c index 9cf638e..96750c8 100644 --- a/gdb/mem-break.c +++ b/gdb/mem-break.c @@ -24,7 +24,8 @@ #include "defs.h" -/* This file is only useful if BREAKPOINT is set. If not, we punt. */ +/* This file is only useful if BREAKPOINT_FROM_PC is set. If not, we + punt. */ #include "symtab.h" #include "breakpoint.h" @@ -32,50 +33,6 @@ #include "target.h" -/* Use the program counter to determine the contents and size - of a breakpoint instruction. If no target-dependent macro - BREAKPOINT_FROM_PC has been defined to implement this function, - assume that the breakpoint doesn't depend on the PC, and - use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros. - Return a pointer to a string of bytes that encode a breakpoint - instruction, stores the length of the string to *lenptr, - and optionally adjust the pc to point to the correct memory location - for inserting the breakpoint. */ - -const unsigned char * -memory_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) -{ - /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a - breakpoint. On some machines, breakpoints are handled by the - target environment and we don't have to worry about them here. */ -#ifdef BIG_BREAKPOINT - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - { - static unsigned char big_break_insn[] = BIG_BREAKPOINT; - *lenptr = sizeof (big_break_insn); - return big_break_insn; - } -#endif -#ifdef LITTLE_BREAKPOINT - if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG) - { - static unsigned char little_break_insn[] = LITTLE_BREAKPOINT; - *lenptr = sizeof (little_break_insn); - return little_break_insn; - } -#endif -#ifdef BREAKPOINT - { - static unsigned char break_insn[] = BREAKPOINT; - *lenptr = sizeof (break_insn); - return break_insn; - } -#endif - *lenptr = 0; - return NULL; -} - - /* Insert a breakpoint on targets that don't have any better breakpoint support. We read the contents of the target location and stash it, then overwrite it with a breakpoint instruction. ADDR is the target diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 96c4164..8b5861a 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -5119,19 +5119,6 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info) return print_insn_little_mips (memaddr, info); } -/* Old-style breakpoint macros. - The IDT board uses an unusual breakpoint value, and sometimes gets - confused when it sees the usual MIPS breakpoint instruction. */ - -#define BIG_BREAKPOINT {0, 0x5, 0, 0xd} -#define LITTLE_BREAKPOINT {0xd, 0, 0x5, 0} -#define PMON_BIG_BREAKPOINT {0, 0, 0, 0xd} -#define PMON_LITTLE_BREAKPOINT {0xd, 0, 0, 0} -#define IDT_BIG_BREAKPOINT {0, 0, 0x0a, 0xd} -#define IDT_LITTLE_BREAKPOINT {0xd, 0x0a, 0, 0} -#define MIPS16_BIG_BREAKPOINT {0xe8, 0xa5} -#define MIPS16_LITTLE_BREAKPOINT {0xa5, 0xe8} - /* This function implements the BREAKPOINT_FROM_PC macro. It uses the program counter value to determine whether a 16- or 32-bit breakpoint should be used. It returns a pointer to a string of bytes that encode a breakpoint @@ -5146,17 +5133,19 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) { if (pc_is_mips16 (*pcptr)) { - static unsigned char mips16_big_breakpoint[] = - MIPS16_BIG_BREAKPOINT; + static unsigned char mips16_big_breakpoint[] = {0xe8, 0xa5}; *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *lenptr = sizeof (mips16_big_breakpoint); return mips16_big_breakpoint; } else { - static unsigned char big_breakpoint[] = BIG_BREAKPOINT; - static unsigned char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT; - static unsigned char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT; + /* The IDT board uses an unusual breakpoint value, and + sometimes gets confused when it sees the usual MIPS + breakpoint instruction. */ + static unsigned char big_breakpoint[] = {0, 0x5, 0, 0xd}; + static unsigned char pmon_big_breakpoint[] = {0, 0, 0, 0xd}; + static unsigned char idt_big_breakpoint[] = {0, 0, 0x0a, 0xd}; *lenptr = sizeof (big_breakpoint); @@ -5174,19 +5163,16 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) { if (pc_is_mips16 (*pcptr)) { - static unsigned char mips16_little_breakpoint[] = - MIPS16_LITTLE_BREAKPOINT; + static unsigned char mips16_little_breakpoint[] = {0xa5, 0xe8}; *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *lenptr = sizeof (mips16_little_breakpoint); return mips16_little_breakpoint; } else { - static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT; - static unsigned char pmon_little_breakpoint[] = - PMON_LITTLE_BREAKPOINT; - static unsigned char idt_little_breakpoint[] = - IDT_LITTLE_BREAKPOINT; + static unsigned char little_breakpoint[] = {0xd, 0, 0x5, 0}; + static unsigned char pmon_little_breakpoint[] = {0xd, 0, 0, 0}; + static unsigned char idt_little_breakpoint[] = {0xd, 0x0a, 0, 0}; *lenptr = sizeof (little_breakpoint); @@ -6138,8 +6124,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: BADVADDR_REGNUM = %d\n", BADVADDR_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: CAUSE_REGNUM = %d\n", CAUSE_REGNUM); fprintf_unfiltered (file, @@ -6170,10 +6154,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: HI_REGNUM = %d\n", HI_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: IDT_BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, - "mips_dump_tdep: IDT_LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: IGNORE_HELPER_CALL # %s\n", XSTRING (IGNORE_HELPER_CALL (PC))); fprintf_unfiltered (file, @@ -6188,8 +6168,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: LAST_EMBED_REGNUM = %d\n", LAST_EMBED_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: LO_REGNUM = %d\n", LO_REGNUM); #ifdef MACHINE_CPROC_FP_OFFSET @@ -6210,13 +6188,9 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: MAKE_MIPS16_ADDR = FIXME!\n"); fprintf_unfiltered (file, - "mips_dump_tdep: MIPS16_BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: MIPS16_INSTLEN = %d\n", MIPS16_INSTLEN); fprintf_unfiltered (file, - "mips_dump_tdep: MIPS16_LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: MIPS_DEFAULT_ABI = FIXME!\n"); fprintf_unfiltered (file, "mips_dump_tdep: MIPS_EFI_SYMBOL_NAME = multi-arch!!\n"); @@ -6240,10 +6214,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: OP_LDGPR = used?\n"); fprintf_unfiltered (file, - "mips_dump_tdep: PMON_BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, - "mips_dump_tdep: PMON_LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: PRID_REGNUM = %d\n", PRID_REGNUM); fprintf_unfiltered (file, diff --git a/gdb/monitor.c b/gdb/monitor.c index ede61bb..eabbbd9 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -2098,7 +2098,7 @@ monitor_insert_breakpoint (CORE_ADDR addr, char *shadow) addr = ADDR_BITS_REMOVE (addr); /* Determine appropriate breakpoint size for this address. */ - bp = memory_breakpoint_from_pc (&addr, &bplen); + bp = gdbarch_breakpoint_from_pc (current_gdbarch, &addr, &bplen); for (i = 0; i < current_monitor->num_breakpoints; i++) { diff --git a/gdb/proc-api.c b/gdb/proc-api.c index 2d4fe81..208b984 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -574,16 +574,6 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) break; default: { -#ifdef BREAKPOINT - static unsigned char break_insn[] = BREAKPOINT; - - if (len == sizeof (break_insn) && - memcmp (arg, &break_insn, len) == 0) - fprintf (procfs_file ? procfs_file : stdout, - "write (<breakpoint at 0x%08lx>) \n", - (unsigned long) lseek_offset); - else -#endif if (rw_table[i].name) fprintf (procfs_file ? procfs_file : stdout, "write (%s) %s\n", diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index d1e3705..e290849 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -2251,13 +2251,13 @@ mips_mourn_inferior (void) /* We can write a breakpoint and read the shadow contents in one operation. */ -/* Insert a breakpoint. On targets that don't have built-in breakpoint - support, we read the contents of the target location and stash it, - then overwrite it with a breakpoint instruction. ADDR is the target - location in the target machine. CONTENTS_CACHE is a pointer to - memory allocated for saving the target contents. It is guaranteed - by the caller to be long enough to save sizeof BREAKPOINT bytes (this - is accomplished via BREAKPOINT_MAX). */ +/* Insert a breakpoint. On targets that don't have built-in + breakpoint support, we read the contents of the target location and + stash it, then overwrite it with a breakpoint instruction. ADDR is + the target location in the target machine. CONTENTS_CACHE is a + pointer to memory allocated for saving the target contents. It is + guaranteed by the caller to be long enough to save the breakpoint + length returned by BREAKPOINT_FROM_PC. */ static int mips_insert_breakpoint (CORE_ADDR addr, char *contents_cache) diff --git a/gdb/remote.c b/gdb/remote.c index 20becee..b892dda 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4624,11 +4624,12 @@ extended_remote_async_create_inferior (char *exec_file, char *args, char **env) } -/* On some machines, e.g. 68k, we may use a different breakpoint instruction - than other targets; in those use REMOTE_BREAKPOINT instead of just - BREAKPOINT. Also, bi-endian targets may define LITTLE_REMOTE_BREAKPOINT - and BIG_REMOTE_BREAKPOINT. If none of these are defined, we just call - the standard routines that are in mem-break.c. */ +/* On some machines, e.g. 68k, we may use a different breakpoint + instruction than other targets; in those use REMOTE_BREAKPOINT + instead of just BREAKPOINT_FROM_PC. Also, bi-endian targets may + define LITTLE_REMOTE_BREAKPOINT and BIG_REMOTE_BREAKPOINT. If none + of these are defined, we just call the standard routines that are + in mem-break.c. */ /* FIXME, these ought to be done in a more dynamic fashion. For instance, the choice of breakpoint instruction affects target program design and @@ -4652,13 +4653,13 @@ static unsigned char little_break_insn[] = LITTLE_REMOTE_BREAKPOINT; #endif /* REMOTE_BREAKPOINT */ -/* Insert a breakpoint on targets that don't have any better breakpoint - support. We read the contents of the target location and stash it, - then overwrite it with a breakpoint instruction. ADDR is the target - location in the target machine. CONTENTS_CACHE is a pointer to - memory allocated for saving the target contents. It is guaranteed - by the caller to be long enough to save sizeof BREAKPOINT bytes (this - is accomplished via BREAKPOINT_MAX). */ +/* Insert a breakpoint on targets that don't have any better + breakpoint support. We read the contents of the target location + and stash it, then overwrite it with a breakpoint instruction. + ADDR is the target location in the target machine. CONTENTS_CACHE + is a pointer to memory allocated for saving the target contents. + It is guaranteed by the caller to be long enough to save the number + of bytes returned by BREAKPOINT_FROM_PC. */ static int remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache) diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 14a7e22..a72c9be 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -305,14 +305,11 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety) /* Sequence of bytes for breakpoint instruction. */ -#define BIG_BREAKPOINT { 0x7d, 0x82, 0x10, 0x08 } -#define LITTLE_BREAKPOINT { 0x08, 0x10, 0x82, 0x7d } - const static unsigned char * rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size) { - static unsigned char big_breakpoint[] = BIG_BREAKPOINT; - static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT; + static unsigned char big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 }; + static unsigned char little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d }; *bp_size = 4; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) return big_breakpoint; diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index f836c1b..ded2508 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1825,9 +1825,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_struct_return (gdbarch, s390_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value); - /* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. */ + /* Amount PC must be decremented by after a breakpoint. This is + often the number of bytes returned by BREAKPOINT_FROM_PC but not + always. */ set_gdbarch_decr_pc_after_break (gdbarch, 2); set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame); /* Stack grows downward. */ diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index cf5d9c5..f278bd6 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -151,6 +151,14 @@ int deferred_stores = 0; /* Accumulated stores we want to do eventually. */ #endif +const unsigned char * +sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len) +{ + static const char breakpoint[] = {0x91, 0xd0, 0x20, 0x01}; + (*len) = sizeof (breakpoint); + return breakpoint; +} + /* Fetch a single instruction. Even on bi-endian machines such as sparc86x, instructions are always big-endian. */ @@ -3153,7 +3161,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* First set settings that are common for all sparc architectures. */ set_gdbarch_believe_pcc_promotion (gdbarch, 1); - set_gdbarch_breakpoint_from_pc (gdbarch, memory_breakpoint_from_pc); + set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address); diff --git a/gdb/target.h b/gdb/target.h index e757b67..cd82279 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -552,11 +552,11 @@ extern void print_section_info (struct target_ops *, bfd *); #define target_files_info() \ (*current_target.to_files_info) (¤t_target) -/* Insert a breakpoint at address ADDR in the target machine. - SAVE is a pointer to memory allocated for saving the - target contents. It is guaranteed by the caller to be long enough - to save "sizeof BREAKPOINT" bytes. Result is 0 for success, or - an errno value. */ +/* Insert a breakpoint at address ADDR in the target machine. SAVE is + a pointer to memory allocated for saving the target contents. It + is guaranteed by the caller to be long enough to save the number of + breakpoint bytes indicated by BREAKPOINT_FROM_PC. Result is 0 for + success, or an errno value. */ #define target_insert_breakpoint(addr, save) \ (*current_target.to_insert_breakpoint) (addr, save) @@ -1126,9 +1126,6 @@ extern int default_memory_remove_breakpoint (CORE_ADDR, char *); extern int default_memory_insert_breakpoint (CORE_ADDR, char *); -extern const unsigned char *memory_breakpoint_from_pc (CORE_ADDR *pcptr, - int *lenptr); - /* From target.c */ |