* remote.c: Include "gdb_assert.h".
(tty_input): Wire buffer to 400 bytes. (readsocket): Check tty_input doesn't overflow. (build_remote_gdbarch_data, _initialize_remote): Don't multi-arch tty_input.
This commit is contained in:
parent
86884b3733
commit
1ff9c3d6f7
2 changed files with 13 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2001-11-14 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
|
* remote.c: Include "gdb_assert.h".
|
||||||
|
(tty_input): Wire buffer to 400 bytes.
|
||||||
|
(readsocket): Check tty_input doesn't overflow.
|
||||||
|
(build_remote_gdbarch_data, _initialize_remote): Don't multi-arch
|
||||||
|
tty_input.
|
||||||
|
|
||||||
2001-11-14 Michael Snyder <msnyder@redhat.com>
|
2001-11-14 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
* d10v-tdep.c (d10v_pointer_to_address): Use new type flag
|
* d10v-tdep.c (d10v_pointer_to_address): Use new type flag
|
||||||
|
|
11
gdb/remote.c
11
gdb/remote.c
|
@ -37,6 +37,7 @@
|
||||||
#include "remote.h"
|
#include "remote.h"
|
||||||
#include "regcache.h"
|
#include "regcache.h"
|
||||||
#include "value.h"
|
#include "value.h"
|
||||||
|
#include "gdb_assert.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -5404,8 +5405,9 @@ enum
|
||||||
}
|
}
|
||||||
minitelnet_return;
|
minitelnet_return;
|
||||||
|
|
||||||
/* shared between readsocket() and readtty() */
|
/* Shared between readsocket() and readtty(). The size is arbitrary,
|
||||||
static char *tty_input;
|
however all targets are known to support a 400 character packet. */
|
||||||
|
static char tty_input[400];
|
||||||
|
|
||||||
static int escape_count;
|
static int escape_count;
|
||||||
static int echo_check;
|
static int echo_check;
|
||||||
|
@ -5451,6 +5453,7 @@ readsocket (void)
|
||||||
{
|
{
|
||||||
if (tty_input[echo_check] == data)
|
if (tty_input[echo_check] == data)
|
||||||
{
|
{
|
||||||
|
gdb_assert (echo_check <= sizeof (tty_input));
|
||||||
echo_check++; /* Character matched user input: */
|
echo_check++; /* Character matched user input: */
|
||||||
continue; /* Continue without echoing it. */
|
continue; /* Continue without echoing it. */
|
||||||
}
|
}
|
||||||
|
@ -5787,9 +5790,6 @@ static void
|
||||||
build_remote_gdbarch_data (void)
|
build_remote_gdbarch_data (void)
|
||||||
{
|
{
|
||||||
build_remote_packet_sizes ();
|
build_remote_packet_sizes ();
|
||||||
|
|
||||||
/* Cisco stuff */
|
|
||||||
tty_input = xmalloc (PBUFSIZ);
|
|
||||||
remote_address_size = TARGET_ADDR_BIT;
|
remote_address_size = TARGET_ADDR_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5819,7 +5819,6 @@ _initialize_remote (void)
|
||||||
|
|
||||||
/* architecture specific data */
|
/* architecture specific data */
|
||||||
build_remote_gdbarch_data ();
|
build_remote_gdbarch_data ();
|
||||||
register_gdbarch_swap (&tty_input, sizeof (&tty_input), NULL);
|
|
||||||
register_remote_packet_sizes ();
|
register_remote_packet_sizes ();
|
||||||
register_gdbarch_swap (&remote_address_size,
|
register_gdbarch_swap (&remote_address_size,
|
||||||
sizeof (&remote_address_size), NULL);
|
sizeof (&remote_address_size), NULL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue