* 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.
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.
#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
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;
/* 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);
#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 */
#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
/* 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,
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;
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)
#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);
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
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.
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)
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);
#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"
#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
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
{
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);
{
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);
fprintf_unfiltered (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,
"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,
"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);
#endif
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: OP_LDFPR = used?\n");
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);
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++)
{
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",
/* 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)
}
\f
-/* 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
#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)
/* 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;
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. */
#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. */
/* 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);
#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)
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 */