]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2008-06-23 Michael Snyder <msnyder@specifix.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 24 Jun 2008 03:05:27 +0000 (03:05 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 24 Jun 2008 03:05:27 +0000 (03:05 +0000)
* gdbfreeplay.h: Replace all address values with unsigned long long.
* gdbfreeplay-i386.c: Ditto.
* gdbfreeplay-mips64.c: Ditto.
* gdbfreeplay-back.c: Ditto.
* remote-break.c: Ditto.
* remote-break.h: Ditto.

gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/gdbfreeplay-back.c
gdb/gdbserver/gdbfreeplay-i386.c
gdb/gdbserver/gdbfreeplay-mips64.c
gdb/gdbserver/gdbfreeplay.h
gdb/gdbserver/remote-breakpoint.c
gdb/gdbserver/remote-breakpoint.h

index bee26c90cf72a6ff29e0aa32bd61ebd575790a81..70b3306feeff89308857e089365a38b3094b515e 100644 (file)
@@ -1,7 +1,15 @@
 2008-06-23  Michael Snyder  <msnyder@specifix.com>
 
+       * gdbfreeplay.h: Replace all address values with unsigned long long.
+       * gdbfreeplay-i386.c: Ditto.
+       * gdbfreeplay-mips64.c: Ditto.
+       * gdbfreeplay-back.c: Ditto.
+       * remote-break.c: Ditto.
+       * remote-break.h: Ditto.
+
        * configure.srv: Add configuration for mips64-linux.
        * gdbfreeplay-mips64.c: New file, back-end for mips64.
+       * Makefile.in: Add rules for mips and intel back-ends.
 
 2008-06-21  Michael Snyder  <msnyder@specifix.com>
 
index fdf40a1ca273382f36e827b59fcd6d5fe87a1c4b..8039bbadd861586b13798d42564f1bf379ace559 100644 (file)
@@ -299,8 +299,11 @@ target.o: target.c $(server_h)
 thread-db.o: thread-db.c $(server_h) $(gdb_proc_service_h)
 utils.o: utils.c $(server_h)
 gdbreplay.o: gdbreplay.c config.h
-gdbfreeplay-front.o: gdbfreeplay-front.c gdbfreeplay.h
-gdbfreeplay-back.o:  gdbfreeplay-back.c  gdbfreeplay.h
+gdbfreeplay-front.o:  gdbfreeplay-front.c gdbfreeplay.h
+gdbfreeplay-back.o:   gdbfreeplay-back.c  gdbfreeplay.h remote-breakpoint.h
+gdbfreeplay-i386.o:   gdbfreeplay-i386.c  gdbfreeplay.h remote-breakpoint.h
+gdbfreeplay-mips64.o: gdbfreeplay-mips64.c  gdbfreeplay.h remote-breakpoint.h
+remote-breakpoint.o:  remote-breakpoint.c remote-breakpoint.h
 
 signals.o: ../signals/signals.c $(server_h)
        $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
index a270d1cff02909ffb5e4df8581f12866317f68e4..bcfe49bfc17a64f4560905ad76b9365e2d8600d7 100644 (file)
@@ -21,11 +21,11 @@ typedef struct STOPFRAME {
   /* frame_id -- a unique identifier per stop frame.  */
   unsigned int frame_id;
   /* pc -- address of the next instruction to be "executed".  */
-  unsigned long pc;
-  /* predecr_pc -- address that will be reported by a breakpoint.
+  unsigned long long pc;
+  /* FIXME remove! predecr_pc -- address that will be reported by a breakpoint.
      These two are different on some targets, see gdb source code,
      DECR_PC_AFTER_BREAK.  */
-  unsigned long predecr_pc;
+  unsigned long long predecr_pc;
   unsigned long eventpos;
   unsigned long Opos;
 } StopFrame;
@@ -58,7 +58,7 @@ scan_gdbreplay_file (FILE *infile)
   /* Make a pass over the entire file -- cache the record positions.  */
   char *line, *p;
   unsigned long nextpos;
-  unsigned long GPC;
+  unsigned long long GPC;
 
   /* First skip empty lines.  */
   do {
@@ -79,7 +79,7 @@ scan_gdbreplay_file (FILE *infile)
       {
        /* See if we need to grab the PC from this packet.  */
        if (stopframe[last_cached_frame].pc == 0 ||
-           stopframe[last_cached_frame].pc == (unsigned long) -1)
+           stopframe[last_cached_frame].pc == (unsigned long long) -1)
          {
            nextpos = ftell (infile);
            line = fgets (inbuf, sizeof (inbuf), infile);
@@ -92,13 +92,14 @@ scan_gdbreplay_file (FILE *infile)
       {
        GPC = target_pc_from_G (p);
        if (stopframe[last_cached_frame].pc == 0 ||
-           stopframe[last_cached_frame].pc == (unsigned long) -1)
+           stopframe[last_cached_frame].pc == (unsigned long long) -1)
          {
            /* Unlikely, but if we need to, we can just grab this PC.  */
            stopframe[last_cached_frame].pc = GPC;
          }
        else if (stopframe[last_cached_frame].pc == GPC + 1)
          {
+           /* FIXME remove!  */
            /* OK, this is gdb decrementing the PC after a breakpoint.  */
            stopframe[last_cached_frame].predecr_pc =
              stopframe[last_cached_frame].pc;
@@ -640,6 +641,10 @@ add_checksum (char *inbuf)
   int cksum = 0;
   char *p = inbuf;
 
+  /* Sanity check.  */
+  if (inbuf == NULL)
+    return NULL;
+
   /* If the string doesn't start with a '$', it's broken.  */
   if (*p++ != '$')
     return inbuf;
@@ -708,7 +713,7 @@ static char E01[8]   = "$E01#a6";
 static char *
 handle_special_case (FILE *infile, int fd, char *request)
 {
-  unsigned long addr;
+  unsigned long long addr;
   unsigned long len;
   int next_event_frame;
   char *p;
@@ -932,7 +937,7 @@ handle_special_case (FILE *infile, int fd, char *request)
     {
       if (p[3] == ',')
        {
-         addr = strtoul (p + 4, &p, 16);
+         addr = strtoull (p + 4, &p, 16);
          if (p[0] == ',')
            {
              len = strtoul (p + 1, NULL, 16);
@@ -947,7 +952,7 @@ handle_special_case (FILE *infile, int fd, char *request)
     {
       if (p[3] == ',')
        {
-         addr = strtoul (p + 4, &p, 16);
+         addr = strtoull (p + 4, &p, 16);
          if (p[0] == ',')
            {
              len = strtoul (p + 1, NULL, 16);
index aaeb8cff6dc3f0c0a83d9e43b520b0b1f40b1fe2..f2ae4ba6a3346086b034e7b47e3638f0c8a31004 100644 (file)
@@ -79,10 +79,10 @@ ix86_unsigned_long_to_hex (unsigned long value)
  * target_pc_from_T
  *
  * Extract the PC value from the gdb protocol 'T' packet.
- * Returns PC as host unsigned long.
+ * Returns PC as host unsigned long long.
  */
 
-unsigned long
+unsigned long long
 target_pc_from_T (char *tpacket)
 {
   char *p;
@@ -90,43 +90,43 @@ target_pc_from_T (char *tpacket)
   if (tpacket[0] == '$' && tpacket[1] == 'T' &&
       (p = strstr (tpacket, ";08:")) != NULL)
     {
-      return ix86_hex_to_unsigned_long (p + 4);
+      return (unsigned long long) ix86_hex_to_unsigned_long (p + 4);
     }
 
   /* Fail -- just assume no legitimate PC will ever be -1...  */
-  return (unsigned long) -1;
+  return (unsigned long long) -1;
 }
 
 /*
  * ix86_pc_from_registers
  * 
  * Extract the PC value from a gdb protocol registers file.
- * Returns PC as host unsigned long.
+ * Returns PC as host unsigned long long.
  */
 
-static unsigned long
+static unsigned long long
 ix86_pc_from_registers (char *regs)
 {
-  return ix86_hex_to_unsigned_long (regs + 64);
+  return (unsigned long long) ix86_hex_to_unsigned_long (regs + 64);
 }
 
 /*
  * target_pc_from_G
  *
  * Extract the PC value from the gdb protocol 'G' packet.
- * Returns PC as host unsigned long.
+ * Returns PC as host unsigned long long.
  */
 
-unsigned long
+unsigned long long
 target_pc_from_G (char *gpacket)
 {
   if (gpacket[0] == '$' && gpacket[1] == 'G')
     {
-      return ix86_pc_from_registers (gpacket + 2);
+      return (unsigned long long) ix86_pc_from_registers (gpacket + 2);
     }
 
   /* Fail -- just assume no legitimate PC will ever be -1...  */
-  return (unsigned long) -1;
+  return (unsigned long long) -1;
 }
 
 /*
@@ -202,10 +202,10 @@ expand_rle (char *input)
  * Unlike the two above, this function accepts a FILE pointer
  * rather than a char pointer, and must read data from the file.
  *
- * Returns PC as host unsigned long.
+ * Returns PC as host unsigned long long.
  */
 
-unsigned long
+unsigned long long
 target_pc_from_g (char *gpacket)
 {
   if (gpacket[0] == 'r' && gpacket[1] == ' ')
@@ -217,7 +217,7 @@ target_pc_from_g (char *gpacket)
        gpacket++;
     }
 
-  return ix86_pc_from_registers (expand_rle (gpacket));
+  return (unsigned long long) ix86_pc_from_registers (expand_rle (gpacket));
 }
 
 /*
@@ -248,10 +248,10 @@ target_pc_from_g (char *gpacket)
 
 char *
 target_compose_T_packet (char *origTpacket, 
-                        unsigned long instruction_pc,
+                        unsigned long long instruction_pc,
                         int breakpoint_p)
 {
-  unsigned long origTpacket_pc = target_pc_from_T (origTpacket);
+  unsigned long long origTpacket_pc = target_pc_from_T (origTpacket);
   static char reply_buf[128];
   char *p;
 
index 3e3978a6a4707d8b859c1cd0eaf687330f154da4..3a9ce1ba2a82ce1d169dc33645ac43f43d4c0882 100644 (file)
  * target_pc_from_T
  *
  * Extract the PC value from the gdb protocol 'T' packet.
- * Returns PC as host unsigned long.
+ * Returns PC as host unsigned long long.
  */
 
-unsigned long
+unsigned long long
 target_pc_from_T (char *tpacket)
 {
   /* Unimplimented -- make caller fall back to using g packet.  */
-  return -1;
+  return (unsigned long long) -1;
 }
 
 /*
  * target_pc_from_G
  *
  * Extract the PC value from the gdb protocol 'G' packet.
- * Returns PC as host unsigned long.
+ * Returns PC as host unsigned long long.
  */
 
-unsigned long
+unsigned long long
 target_pc_from_G (char *gpacket)
 {
   char localbuf [24];
 
   if (gpacket[0] == '$' && gpacket[1] == 'G')
     {
-      strncpy (localbuf, gpacket + 592, 8);
+      strncpy (localbuf, gpacket + 592, 16);
       localbuf[16] = '\0';
       return strtoul (localbuf, NULL, 16);
     }
 
   /* Fail -- just assume no legitimate PC will ever be -1...  */
-  return (unsigned long) -1;
+  return (unsigned long long) -1;
 }
 
 /*
@@ -55,10 +55,10 @@ target_pc_from_G (char *gpacket)
  * Unlike the two above, this function accepts a FILE pointer
  * rather than a char pointer, and must read data from the file.
  *
- * Returns PC as host unsigned long.
+ * Returns PC as host unsigned long long.
  */
 
-unsigned long
+unsigned long long
 target_pc_from_g (char *gpacket)
 {
   char localbuf [24];
@@ -72,9 +72,9 @@ target_pc_from_g (char *gpacket)
        gpacket++;
     }
 
-  strncpy (localbuf, gpacket + 592, 8);
+  strncpy (localbuf, gpacket + 592, 16);
   localbuf[16] = '\0';
-  return strtoul (localbuf, NULL, 16);
+  return strtoull (localbuf, NULL, 16);
 }
 
 
@@ -89,7 +89,7 @@ target_pc_from_g (char *gpacket)
 
 char *
 target_compose_T_packet (char *origTpacket, 
-                        unsigned long instruction_pc,
+                        unsigned long long instruction_pc,
                         int breakpoint_p)
 {
   return origTpacket;
index d9c70c540080ecbba6068b2c52c8b7dc4a417093..7d38651814b56587522f365f296fd3d5efb32bb0 100644 (file)
@@ -12,12 +12,12 @@ extern int verbose;
 extern enum successcode gdbfreeplay_open (char *filename);
 extern void gdbfreeplay (int socket_fd);
 
-extern unsigned long target_pc_from_T (char *tpacket);
-extern unsigned long target_pc_from_G (char *gpacket);
-extern unsigned long target_pc_from_g (char *gpacket);
+extern unsigned long long target_pc_from_T (char *tpacket);
+extern unsigned long long target_pc_from_G (char *gpacket);
+extern unsigned long long target_pc_from_g (char *gpacket);
 
 extern char *target_compose_T_packet (char *origTpacket, 
-                                     unsigned long pc,
+                                     unsigned long long pc,
                                      int breakpoint_p);
 extern char *target_compose_g_packet (char *origTpacket);
 
index 53089327f53837e9fa2a2a37cc91a6d8c1f140ef..adebf9ff677d3d230e49c0728fef613a00952895 100644 (file)
@@ -23,7 +23,7 @@ extern int verbose;
 
 static enum successcode
 insert_breakpoint (enum breakpoint_type bptype,
-                  unsigned long        addr,
+                  unsigned long long   addr,
                   unsigned long        len)
 {
   breakpoint *this_bp;
@@ -55,7 +55,7 @@ insert_breakpoint (enum breakpoint_type bptype,
 
 static int
 unlink_breakpoint (enum breakpoint_type bptype,
-                  unsigned long        addr,
+                  unsigned long long   addr,
                   unsigned long        len)
 {
   breakpoint *this_bp, *tmp;
@@ -104,7 +104,7 @@ unlink_breakpoint (enum breakpoint_type bptype,
 
 extern enum successcode
 remote_remove_breakpoint (enum breakpoint_type bptype,
-                         unsigned long        addr,
+                         unsigned long long   addr,
                          unsigned long        len)
 {
   if (verbose)
@@ -120,7 +120,7 @@ remote_remove_breakpoint (enum breakpoint_type bptype,
 
 extern enum successcode
 remote_set_breakpoint (enum breakpoint_type bptype,
-                      unsigned long        addr,
+                      unsigned long long   addr,
                       unsigned long        len)
 {
   if (verbose)
@@ -145,7 +145,7 @@ remote_set_breakpoint (enum breakpoint_type bptype,
 
 enum successcode 
 remote_breakpoint_here_p (enum breakpoint_type bptype,
-                         unsigned long addr)
+                         unsigned long long addr)
 {
   breakpoint *bp = bplist[bptype];
 
index d98a659b6e01fcaf633247ad46546f195c375dbf..10d746ae20342a414e670b7da28f5e354084999c 100644 (file)
@@ -6,7 +6,7 @@
 #define REMOTE_BREAKPOINT_H
 
 typedef struct BREAKPOINT {
-  unsigned long addr;
+  unsigned long long addr;
   unsigned long len;
   struct BREAKPOINT *next;
 } breakpoint;
@@ -31,15 +31,15 @@ enum direction_code {
 };
 
 extern enum successcode remote_remove_breakpoint (enum breakpoint_type,
-                                                 unsigned long,
+                                                 unsigned long long,
                                                  unsigned long);
 
 extern enum successcode remote_set_breakpoint    (enum breakpoint_type,
-                                                 unsigned long,
+                                                 unsigned long long,
                                                  unsigned long);
 
 extern enum successcode remote_breakpoint_here_p (enum breakpoint_type,
-                                                 unsigned long);
+                                                 unsigned long long);
 
 #endif