+Wed Jun 29 13:11:45 1994 Steve Chamberlain (sac@cirdan.cygnus.com)
+
+ * remote-e7000.c (e7000_open): Don't try a tcp open if we're
+ using go32.
+ * remote-hms.c (flush): New function.
+ (expect): Get edge case right.
+ (hms_read_inferior_memory): Be more tolerant of line noise.
+
Tue Jun 28 14:17:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* configure.in: Use i386m3.mh and i386m3.mt as names of host and
hms_open knows that we don't have a file open when the program
starts. */
-int is_open = 0;
+static int before = 0xdead;
+static int is_open = 0;
+static int after = 0xdead;
int
check_open ()
{
+if (before != 0xdead
+ || after != 0xdead)
+ printf("OUTCH! \n");
if (!is_open)
{
error ("remote device not open");
return buf & 0x7f;
}
+static void flush()
+{
+ while (1)
+ {
+ int b = SERIAL_READCHAR (desc, 0);
+ if (b == SERIAL_TIMEOUT)
+ return;
+ }
+}
+
static int
readchar_nofail ()
{
char *string;
{
char *p = string;
-
+ char c;
immediate_quit = 1;
while (1)
{
- if (readchar () == *p)
+ c = readchar();
+ if (c == *p)
{
p++;
if (*p == '\0')
return;
}
}
- else
- p = string;
+ else
+ {
+ p = string;
+ if (c == *p)
+ p++;
+ }
}
}
printf_filtered ("Connected to remote board running HMS monitor.\n");
add_commands ();
- hms_drain ();
+/* hms_drain ();*/
}
/* Close out all files and local state before this target loses control. */
abort ();
sprintf (buffer, "m %4x %4x", start & 0xffff, end & 0xffff);
+
+ flush();
hms_write_cr (buffer);
/* drop the echo and newline*/
for (i = 0; i < 13; i++)
buffer[0] = readchar ();
if (buffer[0] == 'M')
break;
- for (i = 1; i < 66; i++)
+
+ for (i = 1; i < 60; i++) {
buffer[i] = readchar ();
+ }
+ /* sometimes we loose characters in the ascii representation of the
+ data. I don't know where. So just scan for the end of line */
+ i = readchar();
+ while (i != '\n' && i != '\r')
+ i = readchar();
/* Now parse the line */
byte[p] = gethex (2, buffer + idx, &ok);
byte[p + 1] = gethex (2, buffer + idx + 2, &ok);
idx += 5;
-
}
for (p = 0; p < 16; p++)
hms_drain (args, fromtty)
char *args;
int fromtty;
-
{
int c;
while (1)
add_commands ()
{
- add_com ("hmsdrain", class_obscure, hms_drain,
+ add_com ("hms_drain", class_obscure, hms_drain,
"Drain pending hms text buffers.");
}