This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] const unsigned char *breakpoint_from_pc()


Hello,

Pretty straight forward.  Rebuilt for all the maintainer targets.
Committing in the next few hours.

Andrew
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'.

Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.51
diff -u -r1.51 arch-utils.c
--- arch-utils.c	6 Feb 2002 13:00:44 -0000	1.51
+++ arch-utils.c	18 Apr 2002 13:59:00 -0000
@@ -55,7 +55,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: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.36
diff -u -r1.36 d10v-tdep.c
--- d10v-tdep.c	12 Apr 2002 22:50:42 -0000	1.36
+++ d10v-tdep.c	18 Apr 2002 13:59:01 -0000
@@ -150,7 +150,7 @@
 }
 
 
-static unsigned char *
+static const unsigned char *
 d10v_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] =
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.87
diff -u -r1.87 defs.h
--- defs.h	12 Apr 2002 18:18:57 -0000	1.87
+++ defs.h	18 Apr 2002 13:59:01 -0000
@@ -384,7 +384,6 @@
 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.  */
 
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.126
diff -u -r1.126 gdbarch.sh
--- gdbarch.sh	17 Apr 2002 18:47:54 -0000	1.126
+++ gdbarch.sh	18 Apr 2002 13:59:05 -0000
@@ -544,7 +544,7 @@
 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: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.28
diff -u -r1.28 ia64-tdep.c
--- ia64-tdep.c	6 Apr 2002 00:02:50 -0000	1.28
+++ ia64-tdep.c	18 Apr 2002 13:59:06 -0000
@@ -601,7 +601,7 @@
 
 /* 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: m68hc11-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68hc11-tdep.c,v
retrieving revision 1.18
diff -u -r1.18 m68hc11-tdep.c
--- m68hc11-tdep.c	6 Apr 2002 00:02:50 -0000	1.18
+++ m68hc11-tdep.c	18 Apr 2002 13:59:07 -0000
@@ -270,7 +270,7 @@
   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: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.12
diff -u -r1.12 mcore-tdep.c
--- mcore-tdep.c	19 Sep 2001 20:43:53 -0000	1.12
+++ mcore-tdep.c	18 Apr 2002 13:59:07 -0000
@@ -62,7 +62,7 @@
 
 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 @@
    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: mem-break.c
===================================================================
RCS file: /cvs/src/src/gdb/mem-break.c,v
retrieving revision 1.5
diff -u -r1.5 mem-break.c
--- mem-break.c	5 Jan 2002 04:30:17 -0000	1.5
+++ mem-break.c	18 Apr 2002 13:59:07 -0000
@@ -40,7 +40,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 +86,7 @@
 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 +108,7 @@
 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: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.69
diff -u -r1.69 mips-tdep.c
--- mips-tdep.c	12 Apr 2002 18:18:57 -0000	1.69
+++ mips-tdep.c	18 Apr 2002 13:59:09 -0000
@@ -3712,7 +3712,7 @@
    (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: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.25
diff -u -r1.25 mn10300-tdep.c
--- mn10300-tdep.c	12 Apr 2002 18:18:57 -0000	1.25
+++ mn10300-tdep.c	18 Apr 2002 13:59:09 -0000
@@ -188,7 +188,7 @@
    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: monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.32
diff -u -r1.32 monitor.c
--- monitor.c	10 Feb 2002 04:08:41 -0000	1.32
+++ monitor.c	18 Apr 2002 13:59:10 -0000
@@ -2078,7 +2078,7 @@
 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: ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.14
diff -u -r1.14 ppc-linux-tdep.c
--- ppc-linux-tdep.c	22 Mar 2002 21:58:16 -0000	1.14
+++ ppc-linux-tdep.c	18 Apr 2002 13:59:10 -0000
@@ -759,7 +759,7 @@
 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: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.55
diff -u -r1.55 rs6000-tdep.c
--- rs6000-tdep.c	12 Apr 2002 19:48:36 -0000	1.55
+++ rs6000-tdep.c	18 Apr 2002 13:59:11 -0000
@@ -280,7 +280,7 @@
 #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 @@
 {
   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: s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.43
diff -u -r1.43 s390-tdep.c
--- s390-tdep.c	6 Apr 2002 00:02:50 -0000	1.43
+++ s390-tdep.c	18 Apr 2002 13:59:12 -0000
@@ -1700,7 +1700,7 @@
 
 
 
-static unsigned char *
+const static unsigned char *
 s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] = { 0x0, 0x1 };
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.23
diff -u -r1.23 target.h
--- target.h	10 Feb 2002 04:08:42 -0000	1.23
+++ target.h	18 Apr 2002 13:59:13 -0000
@@ -1184,7 +1184,8 @@
 
 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: xstormy16-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v
retrieving revision 1.2
diff -u -r1.2 xstormy16-tdep.c
--- xstormy16-tdep.c	22 Jan 2002 11:22:23 -0000	1.2
+++ xstormy16-tdep.c	18 Apr 2002 13:59:13 -0000
@@ -857,7 +857,7 @@
   return pc;
 }
 
-static unsigned char *
+const static unsigned char *
 xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] = { 0x06, 0x0 };
Index: config/mcore/tm-mcore.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mcore/tm-mcore.h,v
retrieving revision 1.9
diff -u -r1.9 tm-mcore.h
--- config/mcore/tm-mcore.h	29 Jan 2002 03:51:17 -0000	1.9
+++ config/mcore/tm-mcore.h	18 Apr 2002 13:59:13 -0000
@@ -62,7 +62,8 @@
 
 /* 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]