]> 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 00:50:23 +0000 (00:50 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 24 Jun 2008 00:50:23 +0000 (00:50 +0000)
* configure.srv: Add configuration for mips64-linux.
* gdbfreeplay-mips64.c: New file, back-end for mips64.

gdb/gdbserver/ChangeLog
gdb/gdbserver/configure.srv
gdb/gdbserver/gdbfreeplay-mips64.c [new file with mode: 0644]

index 290715f2c8465e6ede8c30717806462f36e435b3..bee26c90cf72a6ff29e0aa32bd61ebd575790a81 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-23  Michael Snyder  <msnyder@specifix.com>
+
+       * configure.srv: Add configuration for mips64-linux.
+       * gdbfreeplay-mips64.c: New file, back-end for mips64.
+
 2008-06-21  Michael Snyder  <msnyder@specifix.com>
 
        * gdbfreeplay-back.c (scan_gdbreplay_file): Add support for 'W'
index 3e543fbbd0e06832942ee1a34b04f1bfca7cc4ab..b241c4fb20df6bfb43be5ea0e7163c07691da883 100644 (file)
@@ -99,6 +99,7 @@ case "${target}" in
                        srv_linux_regsets=yes
                        srv_linux_usrregs=yes
                        srv_linux_thread_db=yes
+                       freeplay_tgtobj="gdbfreeplay-mips64.o"
                        ;;
   mips*-*-linux*)      srv_regobj=mips-linux.o
                        srv_tgtobj="linux-low.o linux-mips-low.o"
diff --git a/gdb/gdbserver/gdbfreeplay-mips64.c b/gdb/gdbserver/gdbfreeplay-mips64.c
new file mode 100644 (file)
index 0000000..3e3978a
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * gdbfreeplay-mips64.c
+ *
+ * Target-dependent component of gdbfreeplay for mips64.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "gdbfreeplay.h"
+
+/*
+ * target_pc_from_T
+ *
+ * Extract the PC value from the gdb protocol 'T' packet.
+ * Returns PC as host unsigned long.
+ */
+
+unsigned long
+target_pc_from_T (char *tpacket)
+{
+  /* Unimplimented -- make caller fall back to using g packet.  */
+  return -1;
+}
+
+/*
+ * target_pc_from_G
+ *
+ * Extract the PC value from the gdb protocol 'G' packet.
+ * Returns PC as host unsigned long.
+ */
+
+unsigned long
+target_pc_from_G (char *gpacket)
+{
+  char localbuf [24];
+
+  if (gpacket[0] == '$' && gpacket[1] == 'G')
+    {
+      strncpy (localbuf, gpacket + 592, 8);
+      localbuf[16] = '\0';
+      return strtoul (localbuf, NULL, 16);
+    }
+
+  /* Fail -- just assume no legitimate PC will ever be -1...  */
+  return (unsigned long) -1;
+}
+
+/*
+ * target_pc_from_g
+ *
+ * Extract the PC value from the gdb protocol 'g' packet reply.
+ * 
+ * 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.
+ */
+
+unsigned long
+target_pc_from_g (char *gpacket)
+{
+  char localbuf [24];
+
+  if (gpacket[0] == 'r' && gpacket[1] == ' ')
+    {
+      gpacket += 2;
+      if (gpacket[0] == '+')
+       gpacket++;
+      if (gpacket[0] == '$')
+       gpacket++;
+    }
+
+  strncpy (localbuf, gpacket + 592, 8);
+  localbuf[16] = '\0';
+  return strtoul (localbuf, NULL, 16);
+}
+
+
+
+/*
+ * target_compose_T_packet
+ *
+ * On targets where DECR_PC_AFTER_BREAK is zero, this is a no-op.
+ * We just send back the T packet that was sent to us.
+ *
+ */
+
+char *
+target_compose_T_packet (char *origTpacket, 
+                        unsigned long instruction_pc,
+                        int breakpoint_p)
+{
+  return origTpacket;
+}
+
+
+
+/*
+ * target_compose_g_packet
+ *
+ * Take the registers from the 'T' packet, and compose them into a 
+ * 'g' packet response.  Registers for which we have no values will
+ * be filled in with 'xxxx', in the manner of tracepoints.
+ *
+ * Returns: string, g packet reply.
+ */
+
+char *
+target_compose_g_packet (char *tpac)
+{
+  /* stub */
+  return NULL;
+}