aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2008-06-24 00:50:23 +0000
committerMichael Snyder <msnyder@vmware.com>2008-06-24 00:50:23 +0000
commitbce625cd0d23ff90391d3866a86e4cf401f5d4f3 (patch)
tree8614dce813b9fa559da5dbd0fbe00fb2a9a6020f
parent17ef5343b95845285252c3d9853c4cafa572a2b6 (diff)
downloadgdb-bce625cd0d23ff90391d3866a86e4cf401f5d4f3.zip
gdb-bce625cd0d23ff90391d3866a86e4cf401f5d4f3.tar.gz
gdb-bce625cd0d23ff90391d3866a86e4cf401f5d4f3.tar.bz2
2008-06-23 Michael Snyder <msnyder@specifix.com>
* configure.srv: Add configuration for mips64-linux. * gdbfreeplay-mips64.c: New file, back-end for mips64.
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/configure.srv1
-rw-r--r--gdb/gdbserver/gdbfreeplay-mips64.c115
3 files changed, 121 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 290715f..bee26c9 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -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'
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 3e543fb..b241c4f 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -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
index 0000000..3e3978a
--- /dev/null
+++ b/gdb/gdbserver/gdbfreeplay-mips64.c
@@ -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;
+}