* gdbarch.sh (BREAKPOINT_FROM_PC): Return a const buffer.
authorAndrew Cagney <cagney@redhat.com>
Thu, 18 Apr 2002 18:09:09 +0000 (18:09 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 18 Apr 2002 18:09:09 +0000 (18:09 +0000)
* 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.

20 files changed:
gdb/ChangeLog
gdb/arch-utils.c
gdb/config/mcore/tm-mcore.h
gdb/d10v-tdep.c
gdb/defs.h
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/ia64-tdep.c
gdb/m68hc11-tdep.c
gdb/mcore-tdep.c
gdb/mem-break.c
gdb/mips-tdep.c
gdb/mn10300-tdep.c
gdb/monitor.c
gdb/ppc-linux-tdep.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/target.h
gdb/xstormy16-tdep.c

index c0689e5..4d76ef9 100644 (file)
@@ -1,3 +1,34 @@
+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.
index 5612ddf..8e2d99a 100644 (file)
@@ -1,5 +1,7 @@
 /* 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.
 
@@ -55,7 +57,7 @@
    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
index 7ce6373..df62c21 100644 (file)
@@ -1,5 +1,6 @@
 /* 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.
 
@@ -62,7 +63,8 @@ extern char *mcore_register_names[];
 
 /* 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))
index df35679..2060c93 100644 (file)
@@ -150,7 +150,7 @@ d10v_use_struct_convention (int gcc_p, struct type *type)
 }
 
 
-static unsigned char *
+static const unsigned char *
 d10v_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] =
index 15bb2bc..ab66d73 100644 (file)
@@ -384,7 +384,6 @@ struct type;
 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.  */
 
index 1775d8b..646b238 100644 (file)
@@ -3840,7 +3840,7 @@ set_gdbarch_inner_than (struct gdbarch *gdbarch,
   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)
index ada28e3..7e66522 100644 (file)
@@ -1690,8 +1690,8 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_
 #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"
index 5c7f5c0..32a68fc 100755 (executable)
@@ -544,7 +544,7 @@ F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_
 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
index 18cd6ff..4b14152 100644 (file)
@@ -601,7 +601,7 @@ ia64_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
 
 /* 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[] =
index 4e73fcf..6d00ab1 100644 (file)
@@ -270,7 +270,7 @@ m68hc11_register_name (int reg_nr)
   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};
index 184f7b5..0e6ffc8 100644 (file)
@@ -62,7 +62,7 @@ CORE_ADDR mcore_skip_prologue (CORE_ADDR pc);
 
 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);
 
@@ -182,7 +182,7 @@ mcore_dump_insn (char *commnt, CORE_ADDR pc, int insn)
    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[] =
index a67e2a5..9cf638e 100644 (file)
@@ -1,6 +1,8 @@
 /* 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.
@@ -40,7 +42,7 @@
    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
@@ -86,7 +88,7 @@ int
 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.  */
@@ -108,7 +110,7 @@ default_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
 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.  */
index 3de03fa..3729b9c 100644 (file)
@@ -3712,7 +3712,7 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
    (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)
index ceb97ad..0a5704b 100644 (file)
@@ -188,7 +188,7 @@ mn10300_use_struct_convention (int gcc_p, struct type *type)
    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[] =
index e760d43..81340d4 100644 (file)
@@ -2078,7 +2078,7 @@ static int
 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));
index 7e0a70a..667170c 100644 (file)
@@ -759,7 +759,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
 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];
index 8140565..265ecd6 100644 (file)
@@ -280,7 +280,7 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety)
 #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;
@@ -301,7 +301,7 @@ rs6000_software_single_step (enum target_signal signal,
 {
   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];
index 158ef26..d888ae3 100644 (file)
@@ -1700,7 +1700,7 @@ s390_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 
 
 
-static unsigned char *
+const static unsigned char *
 s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] = { 0x0, 0x1 };
index b5d036b..1797fc1 100644 (file)
@@ -1184,7 +1184,8 @@ extern int default_memory_remove_breakpoint (CORE_ADDR, char *);
 
 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 */
index 918a19e..f8c20b7 100644 (file)
@@ -1,5 +1,6 @@
 /* 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.
 
@@ -857,7 +858,7 @@ xstormy16_saved_pc_after_call (struct frame_info *ignore)
   return pc;
 }
 
-static unsigned char *
+const static unsigned char *
 xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] = { 0x06, 0x0 };