diff options
author | Fernando Nasser <fnasser@redhat.com> | 1999-01-26 21:57:10 +0000 |
---|---|---|
committer | Fernando Nasser <fnasser@redhat.com> | 1999-01-26 21:57:10 +0000 |
commit | a61e26e2d2cbca16358156c33a7c23dc54522f80 (patch) | |
tree | 2b1f2874e22de65ba0eb8699403a78b8a6511af9 | |
parent | 223fff6650cdc99ee3044881ba5886fd8edde3f8 (diff) | |
download | gdb-a61e26e2d2cbca16358156c33a7c23dc54522f80.zip gdb-a61e26e2d2cbca16358156c33a7c23dc54522f80.tar.gz gdb-a61e26e2d2cbca16358156c33a7c23dc54522f80.tar.bz2 |
Tue Jan 26 16:53:54 1999 Fernando Nasser <fnasser@cygnus.com>
* remote.c (remote_query): fix maximum packet size to account for
remote_debug use.
(putpkt): add comment to alert about extra byte need.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/remote.c | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 776c920..c51755b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Tue Jan 26 16:53:54 1999 Fernando Nasser <fnasser@cygnus.com> + + * remote.c (remote_query): fix maximum packet size to account for + remote_debug use. + (putpkt): add comment to alert about extra byte need. + Mon Jan 25 19:55:30 1999 Mark Alexander <marka@cygnus.com> * sh-tdep.c (sh_target_architecture_hook): Return immediately diff --git a/gdb/remote.c b/gdb/remote.c index b9b314c..69690ed 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -223,7 +223,7 @@ static void remote_fetch_registers PARAMS ((int regno)); static void remote_resume PARAMS ((int pid, int step, enum target_signal siggnal)); -static int remote_start_remote PARAMS ((char *dummy)); +static int remote_start_remote PARAMS ((PTR)); static void remote_open PARAMS ((char *name, int from_tty)); @@ -1354,7 +1354,7 @@ get_offsets () static int remote_start_remote (dummy) - char *dummy; + PTR dummy; { immediate_quit = 1; /* Allow user to interrupt it */ @@ -1471,7 +1471,7 @@ serial device is attached to the remote system (e.g. /dev/ttya)."); /* Start the remote connection; if error (0), discard this target. In particular, if the user quits, be sure to discard it (we'd be in an inconsistent state otherwise). */ - if (!catch_errors (remote_start_remote, (char *)0, + if (!catch_errors (remote_start_remote, NULL, "Couldn't establish connection to remote target\n", RETURN_MASK_ALL)) { @@ -2379,7 +2379,9 @@ print_packet (buf) /* Send a packet to the remote machine, with error checking. The data - of the packet is in BUF. */ + of the packet is in BUF. The string in BUF can be at most PBUFSIZ - 5 + to account for the $, # and checksum, and for a possible /0 if we are + debugging (remote_debug) and want to print the sent packet as a string */ int putpkt (buf) @@ -2682,7 +2684,7 @@ remote_kill () /* Use catch_errors so the user can quit from gdb even when we aren't on speaking terms with the remote system. */ - catch_errors (putpkt, "k", "", RETURN_MASK_ERROR); + catch_errors ((catch_errors_ftype*) putpkt, "k", "", RETURN_MASK_ERROR); /* Don't wait for it to die. I'm not really sure it matters whether we do or not. For the existing stubs, kill is a noop. */ @@ -3016,9 +3018,10 @@ remote_query (query_type, buf, outbuf, bufsiz) /* we used one buffer char for the remote protocol q command and another for the query type. As the remote protocol encapsulation uses 4 chars - we have PBUFZIZ -6 left to pack the query string */ + plus one extra in case we are debugging (remote_debug), + we have PBUFZIZ - 7 left to pack the query string */ i = 0; - while ( buf[i] && (i < (PBUFSIZ - 7)) ) + while ( buf[i] && (i < (PBUFSIZ - 8)) ) { /* bad caller may have sent forbidden characters */ if ( (!isprint(buf[i])) || (buf[i] == '$') || (buf[i] == '#') ) |