aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorJackie Smith Cashion <jsmith@redhat.com>1995-09-01 15:33:14 +0000
committerJackie Smith Cashion <jsmith@redhat.com>1995-09-01 15:33:14 +0000
commit180fd370b16504faa5de1995e89494b75218acb6 (patch)
tree85c301c6f29817262b2f6b7debef5310459204a4 /gdb/remote-mips.c
parent8343d9d80694678c0274a27f5baaddbe76ccf997 (diff)
downloadgdb-180fd370b16504faa5de1995e89494b75218acb6.zip
gdb-180fd370b16504faa5de1995e89494b75218acb6.tar.gz
gdb-180fd370b16504faa5de1995e89494b75218acb6.tar.bz2
Ideally the "remote-mips.c" prompt spotting code should be updated to
spot different prompts at run-time, so as to avoid having target specific versions of gdb. This is a pending TODO. Fri Sep 1 08:25:50 1995 James G. Smith <jsmith@beauty.cygnus.com> * configure (mips64*vr4300*-*-elf): Support added. * remote-mips.c (mips_readchar): Change to allow build-time prompt string. * config/mips/tm-mips.h: Added TARGET_MONITOR_PROMPT. * config/mips/{vr4300.mt, vr4300el.mt, tm-vr4300.h, tm-vr4300el.h}: Added.
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r--gdb/remote-mips.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 9129498..bfbfc53 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -327,13 +327,19 @@ mips_error (va_alist)
convenient for DejaGnu when you only have one connected serial
port. */
+/* CYGNUS LOCAL jsmith */
+/* The old code assumed a 5 character identification string, making it
+ a chore to change the string value. However, we need to ensure
+ that the method of ascertaining the length of the string is
+ completely portable, without resorting to calling strlen(). */
+
static int
mips_readchar (timeout)
int timeout;
{
int ch;
static int state = 0;
- static char nextstate[5] = { '<', 'I', 'D', 'T', '>' };
+ static char nextstate[] = TARGET_MONITOR_PROMPT; /* CYGNUS LOCAL jsmith */
#ifdef MAINTENANCE_CMDS
int i;
@@ -342,7 +348,7 @@ mips_readchar (timeout)
i = watchdog;
#endif
- if (state == 5)
+ if (state == (sizeof(nextstate) / sizeof(char))) /* CYGNUS LOCAL jsmith */
timeout = 1;
ch = SERIAL_READCHAR (mips_desc, timeout);
#ifdef MAINTENANCE_CMDS
@@ -372,7 +378,7 @@ mips_readchar (timeout)
(which is not echoed) is always an @ unless the packet is more
than 64 characters long, which ours never are. */
if ((ch == SERIAL_TIMEOUT || ch == '@')
- && state == 5
+ && state == (sizeof(nextstate) / sizeof(char)) /* CYGNUS LOCAL jsmith */
&& ! mips_initializing)
{
if (sr_get_debug () > 0)