aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2001-05-14 19:02:00 +0000
committerMichael Snyder <msnyder@vmware.com>2001-05-14 19:02:00 +0000
commit234fa6d16b6340b4051d8bcac143702fcb508f47 (patch)
tree6fd0c4882c4dfd9caba0b161cdeafb7a89800eb9
parentcaadab2cfad7745956579147ce2d97254af33f1f (diff)
downloadgdb-234fa6d16b6340b4051d8bcac143702fcb508f47.zip
gdb-234fa6d16b6340b4051d8bcac143702fcb508f47.tar.gz
gdb-234fa6d16b6340b4051d8bcac143702fcb508f47.tar.bz2
2001-05-14 Michael Snyder <msnyder@redhat.com>
* remote.c (hex2bin): Make first argument const. Require explicit count, don't accept null-terminated str. (remote_resume, remote_async_resume): White space fix-up.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/remote.c16
2 files changed, 14 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0fbd941..e1088e1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-14 Michael Snyder <msnyder@redhat.com>
+
+ * remote.c (hex2bin): Make first argument const.
+ Require explicit count, don't accept null-terminated str.
+ (remote_resume, remote_async_resume): White space fix-up.
+ (remote_write_bytes): Set nr_bytes to return value of bin2hex.
+
2001-05-13 Mark Kettenis <kettenis@gnu.org>
* symtab.c (lookup_symtab_1): Use lbasename (NAME) instead of
@@ -9,8 +16,6 @@
2001-05-14 Michael Snyder <msnyder@redhat.com>
* solib.c, solib.h: Add comment for function no_shared_libraries.
- * remote.c (remote_write_bytes): Set nr_bytes to return value of
- bin2hex.
2001-05-14 Kevin Buettner <kevinb@redhat.com>
diff --git a/gdb/remote.c b/gdb/remote.c
index 8ec75d2..1f7a763 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -190,6 +190,8 @@ static int fromhex (int a);
static int hex2bin (const char *hex, char *bin, int);
+static int bin2hex (const char *bin, char *hex, int);
+
static int putpkt_binary (char *buf, int cnt);
static void check_binary_download (CORE_ADDR addr);
@@ -2346,10 +2348,6 @@ hex2bin (const char *hex, char *bin, int count)
{
int i;
- /* May use a length, or a nul-terminated string as input. */
- if (count == 0)
- count = strlen (hex) / 2;
-
for (i = 0; i < count; i++)
{
if (hex[0] == 0 || hex[1] == 0)
@@ -2376,7 +2374,7 @@ tohex (int nib)
}
static int
-bin2hex (char *bin, char *hex, int count)
+bin2hex (const char *bin, char *hex, int count)
{
int i;
/* May use a length, or a nul-terminated string as input. */
@@ -2449,7 +2447,7 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal)
putpkt (buf);
getpkt (buf, PBUFSIZ, 0);
- if (packet_ok(buf, &remote_protocol_E) == PACKET_OK)
+ if (packet_ok (buf, &remote_protocol_E) == PACKET_OK)
return;
}
}
@@ -2467,7 +2465,7 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal)
putpkt (buf);
getpkt (buf, PBUFSIZ, 0);
- if (packet_ok(buf, &remote_protocol_e) == PACKET_OK)
+ if (packet_ok (buf, &remote_protocol_e) == PACKET_OK)
return;
}
}
@@ -2537,7 +2535,7 @@ remote_async_resume (ptid_t ptid, int step, enum target_signal siggnal)
putpkt (buf);
getpkt (buf, PBUFSIZ, 0);
- if (packet_ok(buf, &remote_protocol_E) == PACKET_OK)
+ if (packet_ok (buf, &remote_protocol_E) == PACKET_OK)
goto register_event_loop;
}
}
@@ -2555,7 +2553,7 @@ remote_async_resume (ptid_t ptid, int step, enum target_signal siggnal)
putpkt (buf);
getpkt (buf, PBUFSIZ, 0);
- if (packet_ok(buf, &remote_protocol_e) == PACKET_OK)
+ if (packet_ok (buf, &remote_protocol_e) == PACKET_OK)
goto register_event_loop;
}
}