aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorJackie Smith Cashion <jsmith@redhat.com>1995-10-23 16:09:58 +0000
committerJackie Smith Cashion <jsmith@redhat.com>1995-10-23 16:09:58 +0000
commit0e3a4b1e8e1a70001f793e8070da38c791e58851 (patch)
tree0837d57bdf5882954261fa932ce0146a30c00e4b /gdb/remote-mips.c
parentbef54404791c11a7bd26f4c570ec1fd2a886024a (diff)
downloadgdb-0e3a4b1e8e1a70001f793e8070da38c791e58851.zip
gdb-0e3a4b1e8e1a70001f793e8070da38c791e58851.tar.gz
gdb-0e3a4b1e8e1a70001f793e8070da38c791e58851.tar.bz2
The revision 2.48 change (grossman 1995/10/16) had unfortunately
broken the prompt spotting for the <RISQ> variant of the IDT monitor. Also took this opportunity to add the vr4300 configure.in options.
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r--gdb/remote-mips.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 8761cbf..fde8f23 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -330,7 +330,7 @@ mips_expect (string)
{
/* Must use SERIAL_READCHAR here cuz mips_readchar would get confused if we
- were waiting for "<IDT>"... */
+ were waiting for the TARGET_MONITOR_PROMPT... */
c = SERIAL_READCHAR (mips_desc, 2);
@@ -357,31 +357,25 @@ mips_expect (string)
/* Read a character from the remote, aborting on error. Returns
SERIAL_TIMEOUT on timeout (since that's what SERIAL_READCHAR
- returns). FIXME: If we see the string "<IDT>" from the board, then
- we are debugging on the main console port, and we have somehow
- dropped out of remote debugging mode. In this case, we
- automatically go back in to remote debugging mode. This is a hack,
- put in because I can't find any way for a program running on the
- remote board to terminate without also ending remote debugging
+ returns). FIXME: If we see the string TARGET_MONITOR_PROMPT from
+ the board, then we are debugging on the main console port, and we
+ have somehow dropped out of remote debugging mode. In this case,
+ we automatically go back in to remote debugging mode. This is a
+ hack, put in because I can't find any way for a program running on
+ the remote board to terminate without also ending remote debugging
mode. I assume users won't have any trouble with this; for one
thing, the IDT documentation generally assumes that the remote
debugging port is not the console port. This is, however, very
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[] = TARGET_MONITOR_PROMPT; /* CYGNUS LOCAL jsmith */
+ static char nextstate[] = TARGET_MONITOR_PROMPT;
#ifdef MAINTENANCE_CMDS
int i;
@@ -390,7 +384,7 @@ mips_readchar (timeout)
i = watchdog;
#endif
- if (state == (sizeof(nextstate) / sizeof(char))) /* CYGNUS LOCAL jsmith */
+ if (state == (sizeof(nextstate) / sizeof(char)))
timeout = 1;
ch = SERIAL_READCHAR (mips_desc, timeout);
#ifdef MAINTENANCE_CMDS
@@ -414,13 +408,13 @@ mips_readchar (timeout)
printf_unfiltered ("Timed out in read\n");
}
- /* If we have seen <IDT> and we either time out, or we see a @
- (which was echoed from a packet we sent), reset the board as
- described above. The first character in a packet after the SYN
- (which is not echoed) is always an @ unless the packet is more
- than 64 characters long, which ours never are. */
+ /* If we have seen TARGET_MONITOR_PROMPT and we either time out, or
+ we see a @ (which was echoed from a packet we sent), reset the
+ board as described above. The first character in a packet after
+ the SYN (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 == (sizeof(nextstate) / sizeof(char)) /* CYGNUS LOCAL jsmith */
+ && state == (sizeof(nextstate) / sizeof(char))
&& ! mips_initializing)
{
if (sr_get_debug () > 0)
@@ -1788,14 +1782,14 @@ mips_load (file, from_tty)
int from_tty;
{
int err;
+ static char prompt[] = TARGET_MONITOR_PROMPT;
/* Get the board out of remote debugging mode. */
mips_request ('x', (unsigned int) 0, (unsigned int) 0, &err,
mips_receive_wait);
-
- if (!mips_expect ("\015\012<IDT>"))
+ if (!mips_expect ("\015\012") || !mips_expect (prompt))
error ("mips_load: Couldn't get into monitor mode.");
mips_load_srec (file);