* gdbarch.h, gdbarch.c: Regenerate.
* defs.h (breakpoint_from_pc_fn): Delete type definition.
* target.h (memory_breakpoint_from_pc): Update declaration.
* config/mcore/tm-mcore.h (mcore_breakpoint_from_p): Ditto.
* arch-utils.c (legacy_breakpoint_from_pc): Update return type.
* mcore-tdep.c (mcore_breakpoint_from_pc): Ditto.
* mem-break.c (memory_breakpoint_from_pc): Ditto.
* rs6000-tdep.c (rs6000_breakpoint_from_pc): Ditto.
* s390-tdep.c (s390_breakpoint_from_pc): Ditto
* xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Ditto.
* mn10300-tdep.c (mn10300_breakpoint_from_pc): Ditto.
* mips-tdep.c (mips_breakpoint_from_pc): Ditto.
* m68hc11-tdep.c (m68hc11_breakpoint_from_pc): Ditto.
* ia64-tdep.c (ia64_breakpoint_from_pc): Ditto.
* d10v-tdep.c (d10v_breakpoint_from_pc): Ditto.
* arch-utils.c (legacy_breakpoint_from_pc): Ditto..
* mem-break.c (default_memory_insert_breakpoint): Make `bp' a
const pointer.
* monitor.c (monitor_insert_breakpoint): Ditto.
* rs6000-tdep.c (rs6000_software_single_step): Ditto for `breakp'.
* config/mcore/tm-mcore.h: Update copyright.
* mem-break.c: Ditto.
* xstormy16-tdep.c: Ditto.
+2002-04-18 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (BREAKPOINT_FROM_PC): Return a const buffer.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * defs.h (breakpoint_from_pc_fn): Delete type definition.
+ * target.h (memory_breakpoint_from_pc): Update declaration.
+ * config/mcore/tm-mcore.h (mcore_breakpoint_from_p): Ditto.
+
+ * arch-utils.c (legacy_breakpoint_from_pc): Update return type.
+ * mcore-tdep.c (mcore_breakpoint_from_pc): Ditto.
+ * mem-break.c (memory_breakpoint_from_pc): Ditto.
+ * rs6000-tdep.c (rs6000_breakpoint_from_pc): Ditto.
+ * s390-tdep.c (s390_breakpoint_from_pc): Ditto
+ * xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Ditto.
+ * mn10300-tdep.c (mn10300_breakpoint_from_pc): Ditto.
+ * mips-tdep.c (mips_breakpoint_from_pc): Ditto.
+ * m68hc11-tdep.c (m68hc11_breakpoint_from_pc): Ditto.
+ * ia64-tdep.c (ia64_breakpoint_from_pc): Ditto.
+ * d10v-tdep.c (d10v_breakpoint_from_pc): Ditto.
+ * arch-utils.c (legacy_breakpoint_from_pc): Ditto..
+
+ * mem-break.c (default_memory_insert_breakpoint): Make `bp' a
+ const pointer.
+ * monitor.c (monitor_insert_breakpoint): Ditto.
+ * rs6000-tdep.c (rs6000_software_single_step): Ditto for `breakp'.
+
+ * config/mcore/tm-mcore.h: Update copyright.
+ * mem-break.c: Ditto.
+ * xstormy16-tdep.c: Ditto.
+
2002-04-18 Pierre Muller <muller@ics.u-strasbg.fr>
* p-exp.y: Add precedence rule for '^' token.
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+ Inc.
This file is part of GDB.
and optionally adjust the pc to point to the correct memory location
for inserting the breakpoint. */
-unsigned char *
+const unsigned char *
legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
/* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
/* Parameters for execution on a Motorola MCore.
- Copyright 1995, 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1995, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
/* BREAKPOINT_FROM_PC uses the program counter value to determine
the breakpoint that should be used. */
-extern breakpoint_from_pc_fn mcore_breakpoint_from_pc;
+extern const unsigned char *mcore_breakpoint_from_pc (CORE_ADDR *pcptr,
+ int *lenptr);
#define BREAKPOINT_FROM_PC(PCPTR, LENPTR) mcore_breakpoint_from_pc (PCPTR, LENPTR)
#define INNER_THAN(LHS,RHS) ((LHS) < (RHS))
}
-static unsigned char *
+static const unsigned char *
d10v_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] =
typedef int (use_struct_convention_fn) (int gcc_p, struct type * value_type);
extern use_struct_convention_fn generic_use_struct_convention;
-typedef unsigned char *(breakpoint_from_pc_fn) (CORE_ADDR * pcptr, int *lenptr);
\f
/* Annotation stuff. */
gdbarch->inner_than = inner_than;
}
-unsigned char *
+const unsigned char *
gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
if (gdbarch->breakpoint_from_pc == 0)
#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
#endif
-typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
-extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, 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 void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
#error "Non multi-arch definition of 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:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::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: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
/* We don't really want to use this, but remote.c needs to call it in order
to figure out if Z-packets are supported or not. Oh, well. */
-unsigned char *
+const unsigned char *
ia64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] =
return m68hc11_register_names[reg_nr];
}
-static unsigned char *
+static const unsigned char *
m68hc11_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = {0x0};
CORE_ADDR mcore_frame_chain (struct frame_info *fi);
-unsigned char *mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size);
+const unsigned char *mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size);
int mcore_use_struct_convention (int gcc_p, struct type *type);
instructions are 16 bits, this is all we need, regardless of
address. bpkt = 0x0000 */
-unsigned char *
+const unsigned char *
mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size)
{
static char breakpoint[] =
/* Simulate breakpoints by patching locations in the target system, for GDB.
- Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2000,
+ 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Support. Written by John Gilmore.
This file is part of GDB.
and optionally adjust the pc to point to the correct memory location
for inserting the breakpoint. */
-unsigned char *
+const unsigned char *
memory_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
/* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
default_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int val;
- unsigned char *bp;
+ const unsigned char *bp;
int bplen;
/* Determine appropriate breakpoint contents and size for this address. */
int
default_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
- unsigned char *bp;
+ const unsigned char *bp;
int bplen;
/* Determine appropriate breakpoint contents and size for this address. */
(if necessary) to point to the actual memory location where the
breakpoint should be inserted. */
-unsigned char *
+const unsigned char *
mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
so we need a single byte breakpoint. Matsushita hasn't defined
one, so we defined it ourselves. */
-static unsigned char *
+const static unsigned char *
mn10300_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{
static char breakpoint[] =
monitor_insert_breakpoint (CORE_ADDR addr, char *shadow)
{
int i;
- unsigned char *bp;
+ const unsigned char *bp;
int bplen;
monitor_debug ("MON inst bkpt %s\n", paddr (addr));
int
ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
- unsigned char *bp;
+ const unsigned char *bp;
int val;
int bplen;
char old_contents[BREAKPOINT_MAX];
#define BIG_BREAKPOINT { 0x7d, 0x82, 0x10, 0x08 }
#define LITTLE_BREAKPOINT { 0x08, 0x10, 0x82, 0x7d }
-static unsigned char *
+const static unsigned char *
rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{
static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
{
CORE_ADDR dummy;
int breakp_sz;
- char *breakp = rs6000_breakpoint_from_pc (&dummy, &breakp_sz);
+ const char *breakp = rs6000_breakpoint_from_pc (&dummy, &breakp_sz);
int ii, insn;
CORE_ADDR loc;
CORE_ADDR breaks[2];
-static unsigned char *
+const static unsigned char *
s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = { 0x0, 0x1 };
extern int default_memory_insert_breakpoint (CORE_ADDR, char *);
-extern breakpoint_from_pc_fn memory_breakpoint_from_pc;
+extern const unsigned char *memory_breakpoint_from_pc (CORE_ADDR *pcptr,
+ int *lenptr);
/* From target.c */
/* Target-dependent code for the Sanyo Xstormy16a (LC590000) processor.
- Copyright 2001, Free Software Foundation, Inc.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
return pc;
}
-static unsigned char *
+const static unsigned char *
xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = { 0x06, 0x0 };