summaryrefslogtreecommitdiff
path: root/gdb/i386-stub.c
diff options
context:
space:
mode:
authorJ.T. Conklin <jtc@redback.com>2001-03-01 22:45:42 +0000
committerJ.T. Conklin <jtc@redback.com>2001-03-01 22:45:42 +0000
commit3f2a1387861b631a21f26d3b451e7fb5537f0ec6 (patch)
tree982773fb2f32a51a4ba32aafb50a0a1d9ff0550f /gdb/i386-stub.c
parentdad33a95c3da166ef06dda9c98cbf208b3590862 (diff)
downloadgdb-3f2a1387861b631a21f26d3b451e7fb5537f0ec6.tar.gz
* i386-stub.c (handle_exception): Use 'T' response packet.
Diffstat (limited to 'gdb/i386-stub.c')
-rw-r--r--gdb/i386-stub.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/gdb/i386-stub.c b/gdb/i386-stub.c
index 7aa5da9369c..1251567e912 100644
--- a/gdb/i386-stub.c
+++ b/gdb/i386-stub.c
@@ -758,10 +758,29 @@ handle_exception (int exceptionVector)
/* reply to host that an exception has occurred */
sigval = computeSignal (exceptionVector);
- remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
+
+ ptr = remcomOutBuffer;
+
+ *ptr++ = 'T'; /* notify gdb with signo, PC, FP and SP */
+ *ptr++ = hexchars[sigval >> 4];
+ *ptr++ = hexchars[sigval & 0xf];
+
+ *ptr++ = hexchars[ESP];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[ESP], ptr, 4, 0); /* SP */
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[EBP];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[EBP], ptr, 4, 0); /* FP */
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[PC];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[PC], ptr, 4, 0); /* PC */
+ *ptr++ = ';';
+
+ *ptr = '\0'
putpacket (remcomOutBuffer);