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.
This commit is contained in:
Andrew Cagney 2003-05-15 22:58:39 +00:00
parent e06963ffef
commit aaab4dba86
21 changed files with 113 additions and 200 deletions

View file

@ -1,5 +1,42 @@
2003-05-15 Andrew Cagney <cagney@redhat.com> 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. * symtab.h (DEPRECATED_SYMBOL_MATCHES_NAME): Delete macro.
* minsyms.c (lookup_minimal_symbol): Inline * minsyms.c (lookup_minimal_symbol): Inline
DEPRECATED_SYMBOL_MATCHES_NAME. Replace STREQ with strcmp. DEPRECATED_SYMBOL_MATCHES_NAME. Replace STREQ with strcmp.

View file

@ -48,49 +48,6 @@
#include "floatformat.h" #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 /* Implementation of extract return value that grubs around in the
register cache. */ register cache. */
void void

View file

@ -40,11 +40,6 @@ extern CORE_ADDR generic_cannot_extract_struct_value_address (char *dummy);
being passed */ being passed */
extern gdbarch_frame_num_args_ftype frame_num_args_unknown; 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 /* Implementation of extract return value that grubs around in the
register cache. */ register cache. */
extern gdbarch_extract_return_value_ftype legacy_extract_return_value; extern gdbarch_extract_return_value_ftype legacy_extract_return_value;

View file

@ -60,7 +60,8 @@ struct inferior_status;
/* Sequence of bytes for breakpoint instruction. */ /* 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 #define BREAKPOINT32 0x10004
extern int hppa_pc_requires_run_before_use (CORE_ADDR pc); extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);

View file

@ -97,9 +97,8 @@ extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
#define STACK_ALIGN(sp) hppa_stack_align (sp) #define STACK_ALIGN(sp) hppa_stack_align (sp)
#endif #endif
/* Amount PC must be decremented by after a breakpoint. /* Amount PC must be decremented by after a breakpoint. This is often
This is often the number of bytes in BREAKPOINT the number of bytes returned by BREAKPOINT_FROM_PC but not always.
but not always.
Not on the PA-RISC */ Not on the PA-RISC */

View file

@ -164,9 +164,8 @@ extern int sparc_intreg_size (void);
#define FUNCTION_START_OFFSET 0 #define FUNCTION_START_OFFSET 0
/* Amount PC must be decremented by after a breakpoint. /* Amount PC must be decremented by after a breakpoint. This is often
This is often the number of bytes in BREAKPOINT the number of bytes returned by BREAKPOINT_FROM_PC but not always. */
but not always. */
#define DECR_PC_AFTER_BREAK 0 #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). */ /* 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. /* Register numbers of various important registers.
Note that some of these values are "real" register numbers, Note that some of these values are "real" register numbers,

View file

@ -540,7 +540,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->store_return_value = legacy_store_return_value; current_gdbarch->store_return_value = legacy_store_return_value;
current_gdbarch->use_struct_convention = generic_use_struct_convention; current_gdbarch->use_struct_convention = generic_use_struct_convention;
current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p; 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_insert_breakpoint = default_memory_insert_breakpoint;
current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
current_gdbarch->decr_pc_after_break = -1; current_gdbarch->decr_pc_after_break = -1;
@ -701,7 +700,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->inner_than == 0)) && (gdbarch->inner_than == 0))
fprintf_unfiltered (log, "\n\tinner_than"); 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_insert_breakpoint, invalid_p == 0 */
/* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)

View file

@ -2163,11 +2163,6 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_
#endif #endif
#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); 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 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); extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);

View file

@ -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: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: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: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_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 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 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1

View file

@ -642,6 +642,14 @@ find_unwind_entry (CORE_ADDR pc)
return NULL; 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 /* Return the adjustment necessary to make for addresses on the stack
as presented by hpread.c. as presented by hpread.c.

View file

@ -543,9 +543,9 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
using the pattern seen below. */ using the pattern seen below. */
#if 0 #if 0
#define BREAKPOINT 0x00002000040LL #define IA64_BREAKPOINT 0x00002000040LL
#endif #endif
#define BREAKPOINT 0x00003333300LL #define IA64_BREAKPOINT 0x00003333300LL
static int static int
ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache) 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); instr = slotN_contents (bundle, slotnum);
memcpy(contents_cache, &instr, sizeof(instr)); memcpy(contents_cache, &instr, sizeof(instr));
replace_slotN_contents (bundle, BREAKPOINT, slotnum); replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum);
if (val == 0) if (val == 0)
target_write_memory (addr, bundle, BUNDLE_LEN); target_write_memory (addr, bundle, BUNDLE_LEN);

View file

@ -24,7 +24,8 @@
#include "defs.h" #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 "symtab.h"
#include "breakpoint.h" #include "breakpoint.h"
@ -32,50 +33,6 @@
#include "target.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 /* Insert a breakpoint on targets that don't have any better breakpoint
support. We read the contents of the target location and stash it, support. We read the contents of the target location and stash it,
then overwrite it with a breakpoint instruction. ADDR is the target then overwrite it with a breakpoint instruction. ADDR is the target

View file

@ -5119,19 +5119,6 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
return print_insn_little_mips (memaddr, 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 /* 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 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 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)) if (pc_is_mips16 (*pcptr))
{ {
static unsigned char mips16_big_breakpoint[] = static unsigned char mips16_big_breakpoint[] = {0xe8, 0xa5};
MIPS16_BIG_BREAKPOINT;
*pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
*lenptr = sizeof (mips16_big_breakpoint); *lenptr = sizeof (mips16_big_breakpoint);
return mips16_big_breakpoint; return mips16_big_breakpoint;
} }
else else
{ {
static unsigned char big_breakpoint[] = BIG_BREAKPOINT; /* The IDT board uses an unusual breakpoint value, and
static unsigned char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT; sometimes gets confused when it sees the usual MIPS
static unsigned char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT; 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); *lenptr = sizeof (big_breakpoint);
@ -5174,19 +5163,16 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{ {
if (pc_is_mips16 (*pcptr)) if (pc_is_mips16 (*pcptr))
{ {
static unsigned char mips16_little_breakpoint[] = static unsigned char mips16_little_breakpoint[] = {0xa5, 0xe8};
MIPS16_LITTLE_BREAKPOINT;
*pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
*lenptr = sizeof (mips16_little_breakpoint); *lenptr = sizeof (mips16_little_breakpoint);
return mips16_little_breakpoint; return mips16_little_breakpoint;
} }
else else
{ {
static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT; static unsigned char little_breakpoint[] = {0xd, 0, 0x5, 0};
static unsigned char pmon_little_breakpoint[] = static unsigned char pmon_little_breakpoint[] = {0xd, 0, 0, 0};
PMON_LITTLE_BREAKPOINT; static unsigned char idt_little_breakpoint[] = {0xd, 0x0a, 0, 0};
static unsigned char idt_little_breakpoint[] =
IDT_LITTLE_BREAKPOINT;
*lenptr = sizeof (little_breakpoint); *lenptr = sizeof (little_breakpoint);
@ -6137,8 +6123,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: BADVADDR_REGNUM = %d\n", "mips_dump_tdep: BADVADDR_REGNUM = %d\n",
BADVADDR_REGNUM); BADVADDR_REGNUM);
fprintf_unfiltered (file,
"mips_dump_tdep: BIG_BREAKPOINT = delete?\n");
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: CAUSE_REGNUM = %d\n", "mips_dump_tdep: CAUSE_REGNUM = %d\n",
CAUSE_REGNUM); CAUSE_REGNUM);
@ -6169,10 +6153,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: HI_REGNUM = %d\n", "mips_dump_tdep: HI_REGNUM = %d\n",
HI_REGNUM); 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, fprintf_unfiltered (file,
"mips_dump_tdep: IGNORE_HELPER_CALL # %s\n", "mips_dump_tdep: IGNORE_HELPER_CALL # %s\n",
XSTRING (IGNORE_HELPER_CALL (PC))); XSTRING (IGNORE_HELPER_CALL (PC)));
@ -6187,8 +6167,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: LAST_EMBED_REGNUM = %d\n", "mips_dump_tdep: LAST_EMBED_REGNUM = %d\n",
LAST_EMBED_REGNUM); LAST_EMBED_REGNUM);
fprintf_unfiltered (file,
"mips_dump_tdep: LITTLE_BREAKPOINT = delete?\n");
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: LO_REGNUM = %d\n", "mips_dump_tdep: LO_REGNUM = %d\n",
LO_REGNUM); LO_REGNUM);
@ -6209,13 +6187,9 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
#endif #endif
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: MAKE_MIPS16_ADDR = FIXME!\n"); "mips_dump_tdep: MAKE_MIPS16_ADDR = FIXME!\n");
fprintf_unfiltered (file,
"mips_dump_tdep: MIPS16_BIG_BREAKPOINT = delete?\n");
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: MIPS16_INSTLEN = %d\n", "mips_dump_tdep: MIPS16_INSTLEN = %d\n",
MIPS16_INSTLEN); MIPS16_INSTLEN);
fprintf_unfiltered (file,
"mips_dump_tdep: MIPS16_LITTLE_BREAKPOINT = delete?\n");
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: MIPS_DEFAULT_ABI = FIXME!\n"); "mips_dump_tdep: MIPS_DEFAULT_ABI = FIXME!\n");
fprintf_unfiltered (file, fprintf_unfiltered (file,
@ -6239,10 +6213,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: OP_LDFPR = used?\n"); "mips_dump_tdep: OP_LDFPR = used?\n");
fprintf_unfiltered (file, fprintf_unfiltered (file,
"mips_dump_tdep: OP_LDGPR = used?\n"); "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, fprintf_unfiltered (file,
"mips_dump_tdep: PRID_REGNUM = %d\n", "mips_dump_tdep: PRID_REGNUM = %d\n",
PRID_REGNUM); PRID_REGNUM);

View file

@ -2098,7 +2098,7 @@ monitor_insert_breakpoint (CORE_ADDR addr, char *shadow)
addr = ADDR_BITS_REMOVE (addr); addr = ADDR_BITS_REMOVE (addr);
/* Determine appropriate breakpoint size for this address. */ /* 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++) for (i = 0; i < current_monitor->num_breakpoints; i++)
{ {

View file

@ -574,16 +574,6 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
break; break;
default: 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) if (rw_table[i].name)
fprintf (procfs_file ? procfs_file : stdout, fprintf (procfs_file ? procfs_file : stdout,
"write (%s) %s\n", "write (%s) %s\n",

View file

@ -2251,13 +2251,13 @@ mips_mourn_inferior (void)
/* We can write a breakpoint and read the shadow contents in one /* We can write a breakpoint and read the shadow contents in one
operation. */ operation. */
/* Insert a breakpoint. On targets that don't have built-in breakpoint /* Insert a breakpoint. On targets that don't have built-in
support, we read the contents of the target location and stash it, breakpoint support, we read the contents of the target location and
then overwrite it with a breakpoint instruction. ADDR is the target stash it, then overwrite it with a breakpoint instruction. ADDR is
location in the target machine. CONTENTS_CACHE is a pointer to the target location in the target machine. CONTENTS_CACHE is a
memory allocated for saving the target contents. It is guaranteed pointer to memory allocated for saving the target contents. It is
by the caller to be long enough to save sizeof BREAKPOINT bytes (this guaranteed by the caller to be long enough to save the breakpoint
is accomplished via BREAKPOINT_MAX). */ length returned by BREAKPOINT_FROM_PC. */
static int static int
mips_insert_breakpoint (CORE_ADDR addr, char *contents_cache) mips_insert_breakpoint (CORE_ADDR addr, char *contents_cache)

View file

@ -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 /* On some machines, e.g. 68k, we may use a different breakpoint
than other targets; in those use REMOTE_BREAKPOINT instead of just instruction than other targets; in those use REMOTE_BREAKPOINT
BREAKPOINT. Also, bi-endian targets may define LITTLE_REMOTE_BREAKPOINT instead of just BREAKPOINT_FROM_PC. Also, bi-endian targets may
and BIG_REMOTE_BREAKPOINT. If none of these are defined, we just call define LITTLE_REMOTE_BREAKPOINT and BIG_REMOTE_BREAKPOINT. If none
the standard routines that are in mem-break.c. */ 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, /* FIXME, these ought to be done in a more dynamic fashion. For instance,
the choice of breakpoint instruction affects target program design and 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 */ #endif /* REMOTE_BREAKPOINT */
/* Insert a breakpoint on targets that don't have any better breakpoint /* Insert a breakpoint on targets that don't have any better
support. We read the contents of the target location and stash it, breakpoint support. We read the contents of the target location
then overwrite it with a breakpoint instruction. ADDR is the target and stash it, then overwrite it with a breakpoint instruction.
location in the target machine. CONTENTS_CACHE is a pointer to ADDR is the target location in the target machine. CONTENTS_CACHE
memory allocated for saving the target contents. It is guaranteed is a pointer to memory allocated for saving the target contents.
by the caller to be long enough to save sizeof BREAKPOINT bytes (this It is guaranteed by the caller to be long enough to save the number
is accomplished via BREAKPOINT_MAX). */ of bytes returned by BREAKPOINT_FROM_PC. */
static int static int
remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache) remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache)

View file

@ -305,14 +305,11 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety)
/* Sequence of bytes for breakpoint instruction. */ /* Sequence of bytes for breakpoint instruction. */
#define BIG_BREAKPOINT { 0x7d, 0x82, 0x10, 0x08 }
#define LITTLE_BREAKPOINT { 0x08, 0x10, 0x82, 0x7d }
const static unsigned char * const static unsigned char *
rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size) rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{ {
static unsigned char big_breakpoint[] = BIG_BREAKPOINT; static unsigned char big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 };
static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT; static unsigned char little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d };
*bp_size = 4; *bp_size = 4;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return big_breakpoint; return big_breakpoint;

View file

@ -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_store_struct_return (gdbarch, s390_store_struct_return);
set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value);
set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value);
/* Amount PC must be decremented by after a breakpoint. /* Amount PC must be decremented by after a breakpoint. This is
This is often the number of bytes in BREAKPOINT often the number of bytes returned by BREAKPOINT_FROM_PC but not
but not always. */ always. */
set_gdbarch_decr_pc_after_break (gdbarch, 2); set_gdbarch_decr_pc_after_break (gdbarch, 2);
set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame); set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame);
/* Stack grows downward. */ /* Stack grows downward. */

View file

@ -151,6 +151,14 @@ int deferred_stores = 0; /* Accumulated stores we want to do eventually. */
#endif #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 /* Fetch a single instruction. Even on bi-endian machines
such as sparc86x, instructions are always big-endian. */ 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. */ /* First set settings that are common for all sparc architectures. */
set_gdbarch_believe_pcc_promotion (gdbarch, 1); 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_decr_pc_after_break (gdbarch, 0);
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address);

View file

@ -552,11 +552,11 @@ extern void print_section_info (struct target_ops *, bfd *);
#define target_files_info() \ #define target_files_info() \
(*current_target.to_files_info) (&current_target) (*current_target.to_files_info) (&current_target)
/* Insert a breakpoint at address ADDR in the target machine. /* Insert a breakpoint at address ADDR in the target machine. SAVE is
SAVE is a pointer to memory allocated for saving the a pointer to memory allocated for saving the target contents. It
target contents. It is guaranteed by the caller to be long enough is guaranteed by the caller to be long enough to save the number of
to save "sizeof BREAKPOINT" bytes. Result is 0 for success, or breakpoint bytes indicated by BREAKPOINT_FROM_PC. Result is 0 for
an errno value. */ success, or an errno value. */
#define target_insert_breakpoint(addr, save) \ #define target_insert_breakpoint(addr, save) \
(*current_target.to_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 int default_memory_insert_breakpoint (CORE_ADDR, char *);
extern const unsigned char *memory_breakpoint_from_pc (CORE_ADDR *pcptr,
int *lenptr);
/* From target.c */ /* From target.c */