diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-04-18 18:09:09 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-04-18 18:09:09 +0000 |
commit | 12b510cab546e7f909b87f5a7550da51e3c9db39 (patch) | |
tree | 1d32618d6322f4a2e03badc3fd10bb6ce376e133 | |
parent | 9bd4e73b7a69fa1b1bf1631fbe0cde428475e059 (diff) | |
download | gdb-12b510cab546e7f909b87f5a7550da51e3c9db39.tar.gz |
* 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.
-rw-r--r-- | gdb/ChangeLog | 31 | ||||
-rw-r--r-- | gdb/arch-utils.c | 6 | ||||
-rw-r--r-- | gdb/config/mcore/tm-mcore.h | 6 | ||||
-rw-r--r-- | gdb/d10v-tdep.c | 2 | ||||
-rw-r--r-- | gdb/defs.h | 1 | ||||
-rw-r--r-- | gdb/gdbarch.c | 2 | ||||
-rw-r--r-- | gdb/gdbarch.h | 4 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 2 | ||||
-rw-r--r-- | gdb/ia64-tdep.c | 2 | ||||
-rw-r--r-- | gdb/m68hc11-tdep.c | 2 | ||||
-rw-r--r-- | gdb/mcore-tdep.c | 4 | ||||
-rw-r--r-- | gdb/mem-break.c | 12 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 2 | ||||
-rw-r--r-- | gdb/mn10300-tdep.c | 2 | ||||
-rw-r--r-- | gdb/monitor.c | 2 | ||||
-rw-r--r-- | gdb/ppc-linux-tdep.c | 2 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 4 | ||||
-rw-r--r-- | gdb/s390-tdep.c | 2 | ||||
-rw-r--r-- | gdb/target.h | 3 | ||||
-rw-r--r-- | gdb/xstormy16-tdep.c | 5 |
20 files changed, 67 insertions, 29 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c0689e5b41c..4d76ef9db27 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 5612ddf841c..8e2d99a1fab 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -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 diff --git a/gdb/config/mcore/tm-mcore.h b/gdb/config/mcore/tm-mcore.h index 7ce63733d3b..df62c21e76a 100644 --- a/gdb/config/mcore/tm-mcore.h +++ b/gdb/config/mcore/tm-mcore.h @@ -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)) diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index df3567934bb..2060c93186f 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -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[] = diff --git a/gdb/defs.h b/gdb/defs.h index 15bb2bc9a98..ab66d731182 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -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); /* Annotation stuff. */ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 1775d8b27bc..646b238349e 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -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) diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index ada28e3a8ad..7e665226fc1 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -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" diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 5c7f5c01eb1..32a68fc28b4 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -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 diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 18cd6ff0b64..4b141526389 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -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[] = diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 4e73fcf5fff..6d00ab1faf5 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -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}; diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 184f7b57e50..0e6ffc80a68 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -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[] = diff --git a/gdb/mem-break.c b/gdb/mem-break.c index a67e2a5cbbf..9cf638e4c62 100644 --- a/gdb/mem-break.c +++ b/gdb/mem-break.c @@ -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. */ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 3de03faffcd..3729b9c8699 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -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) diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index ceb97adc4aa..0a5704b1704 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -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[] = diff --git a/gdb/monitor.c b/gdb/monitor.c index e760d43745a..81340d4be02 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -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)); diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 7e0a70a33d0..667170cda05 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -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]; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 814056500a2..265ecd6de0e 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -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]; diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 158ef2646a6..d888ae3ea95 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -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 }; diff --git a/gdb/target.h b/gdb/target.h index b5d036ba5de..1797fc1d3e3 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -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 */ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 918a19e78f4..f8c20b70f28 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -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 }; |