---
 cores/monitor/rtl/gdbstub.rom |   58 ++++++++++++++++++++--------------------
 software/gdbstub/gdbstub.c    |    9 +++---
 2 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/cores/monitor/rtl/gdbstub.rom b/cores/monitor/rtl/gdbstub.rom
index f79e5f2..3ae21fd 100644
--- a/cores/monitor/rtl/gdbstub.rom
+++ b/cores/monitor/rtl/gdbstub.rom
@@ -159,7 +159,7 @@ c3e00000
 78011000
 38211800
 78021000
-38421e6c
+38421e74
 44220004
 58200000
 34210004
@@ -404,7 +404,7 @@ c3a00000
 5b8b0008
 5b9d0004
 78021000
-38421b25
+38421b29
 b8205800
 5b820014
 37810014
@@ -508,15 +508,15 @@ fbffff67
 780e1000
 78121000
 3a101804
-398c1b24
+398c1b28
 3af71800
-3ad61b27
+3ad61b2b
 39ef0f68
 3ab50f70
 3a730f64
-396b1e48
-39ce1e44
-3a521e5c
+396b1e50
+39ce1e4c
+3a521e64
 32000000
 34190024
 34180023
@@ -532,7 +532,7 @@ b681a000
 b5910800
 30220000
 36310001
-3408031e
+3408031f
 229400ff
 4d11fff6
 b5918800
@@ -614,12 +614,12 @@ ba001000
 34030094
 e0000032
 78011000
-38211b25
+38211b29
 b9a01000
 34030094
 e0000040
 78011000
-38211b25
+38211b29
 5b810050
 3782004c
 37810050
@@ -651,7 +651,7 @@ e0000002
 fbffff08
 e000011c
 78011000
-38211b25
+38211b29
 5b810050
 3782004c
 37810050
@@ -665,7 +665,7 @@ b5a10800
 fbfffe33
 e000010e
 78011000
-38211b25
+38211b29
 5b810050
 3782004c
 37810050
@@ -699,7 +699,7 @@ fbfffece
 fbfffe9f
 e00000ee
 78011000
-38211b25
+38211b29
 5b810050
 3782004c
 37810050
@@ -708,12 +708,12 @@ fbfffe3e
 2b81004c
 59a10080
 78011000
-38211b24
+38211b28
 10220000
 34010073
 5c4100e0
 78011000
-38211e44
+38211e4c
 28210000
 38210001
 d1010000
@@ -764,7 +764,7 @@ e0000063
 d2010000
 78011000
 38840001
-38211e4c
+38211e54
 59640000
 58230000
 e000008e
@@ -776,7 +776,7 @@ e000008e
 d2210000
 78011000
 38840002
-38211e4c
+38211e54
 59640000
 58230004
 e0000082
@@ -788,7 +788,7 @@ e0000082
 d2410000
 78011000
 38840004
-38211e4c
+38211e54
 59640000
 58230008
 e0000076
@@ -800,7 +800,7 @@ e0000076
 d2610000
 78011000
 38840008
-38211e4c
+38211e54
 59640000
 5823000c
 e000006a
@@ -809,7 +809,7 @@ e000006a
 20810001
 44200008
 78011000
-38211e4c
+38211e54
 28210000
 5c230004
 d2000000
@@ -818,7 +818,7 @@ e000001b
 20810002
 44200008
 78011000
-38211e4c
+38211e54
 28210004
 5c230004
 d2200000
@@ -827,7 +827,7 @@ e0000012
 20810004
 44200008
 78011000
-38211e4c
+38211e54
 28210008
 5c230004
 d2400000
@@ -836,7 +836,7 @@ e0000009
 20810008
 4420004d
 78011000
-38211e4c
+38211e54
 2821000c
 5c230049
 d2600000
@@ -903,7 +903,7 @@ d1040000
 e0000009
 78081000
 34420004
-39081e6c
+39081e74
 44480007
 3ca50001
 3c210002
@@ -922,13 +922,13 @@ e000003c
 e000000e
 78021000
 78031000
-38421b25
+38421b29
 38630f74
 40440000
 40610000
 5c810007
 78081000
-39081b2d
+39081b31
 4448002b
 34420001
 34630001
@@ -992,8 +992,8 @@ e0001030
 64000000
 5061636b
 65745369
-7a653d38
-30300000
+7a653d33
+32300000
 00050b05
 0b080201
 30313233
@@ -1001,7 +1001,7 @@ e0001030
 38396162
 63646566
 00000000
-7fe16218
+4b5fadb1
 00000000
 00000000
 00000000
diff --git a/software/gdbstub/gdbstub.c b/software/gdbstub/gdbstub.c
index 692ff3a..6b227cd 100644
--- a/software/gdbstub/gdbstub.c
+++ b/software/gdbstub/gdbstub.c
@@ -60,10 +60,11 @@ enum lm32_regnames {
 
 /* BUFMAX defines the maximum number of characters in inbound/outbound buffers 
*/
 #define BUFMAX 800
+#define BUFMAX_HEX 320  /* keep this in sync with BUFMAX */
 
 /* I/O packet buffers */
-static char remcom_in_buffer[BUFMAX];
-static char remcom_out_buffer[BUFMAX];
+static char remcom_in_buffer[BUFMAX + 1];
+static char remcom_out_buffer[BUFMAX + 1];
 
 /* Remember breakpoint and watchpoint addresses */
 #ifdef SUPPORT_Z_CMD
@@ -257,7 +258,7 @@ static char *get_packet(void)
         count = 0;
 
         /* now, read until a # or end of buffer is found */
-        while (count < BUFMAX - 1) {
+        while (count < BUFMAX) {
             ch = get_debug_char();
             if (ch == '$') {
                 goto retry;
@@ -659,7 +660,7 @@ static void cmd_reg_set(unsigned int *registers)
 static void cmd_query(void)
 {
     if (memcmp(&remcom_in_buffer[1], "Supported", 9) == 0) {
-        strcpy(remcom_out_buffer, "PacketSize=" STRINGY(BUFMAX));
+        strcpy(remcom_out_buffer, "PacketSize=" STRINGY(BUFMAX_HEX));
     }
 }
 #endif
-- 
1.7.2.3

_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode
Twitter: www.twitter.com/milkymistvj
Ideas? http://milkymist.uservoice.com

Reply via email to