* remote.c: Define remote_debug to 0 and #if 0 baud_rate. Temporary

hack so this file compiles again.

	* remote-utils.c (gr_multi_scan): Cast return value from alloca.
	(gr_multi_scan): #if 0 never-reached return(-1).
This commit is contained in:
Jim Kingdon 1993-09-14 01:08:22 +00:00
parent 02ff0cd370
commit 55fea07b55
3 changed files with 49 additions and 5 deletions

View file

@ -1,3 +1,13 @@
Mon Sep 13 16:06:43 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
* remote.c: Define remote_debug to 0 and #if 0 baud_rate. Temporary
hack so this file compiles again.
* remote-utils.c (gr_multi_scan): Cast return value from alloca.
(gr_multi_scan): #if 0 never-reached return(-1).
* remote-udi.c (udi_wait): Return inferior_pid not 0.
Mon Sep 13 14:14:35 1993 K. Richard Pixley (rich@sendai.cygnus.com) Mon Sep 13 14:14:35 1993 K. Richard Pixley (rich@sendai.cygnus.com)
Collect some remote things into remote-utils. Collect some remote things into remote-utils.

View file

@ -535,7 +535,7 @@ gr_multi_scan (list, passthrough)
swallowed_p = swallowed = alloca(max_length << 1); swallowed_p = swallowed = alloca(max_length << 1);
/* and a list of pointers to current scan points. */ /* and a list of pointers to current scan points. */
plist = alloca(string_count * sizeof(*plist)); plist = (char **) alloca (string_count * sizeof(*plist));
/* and initialize */ /* and initialize */
for (i = 0; i < string_count; ++i) for (i = 0; i < string_count; ++i)
@ -579,8 +579,10 @@ gr_multi_scan (list, passthrough)
swallowed_p = swallowed; swallowed_p = swallowed;
} }
} }
#if 0
/* Never reached. */
return(-1); return(-1);
#endif
} }
/* Get ready to modify the registers array. On machines which store /* Get ready to modify the registers array. On machines which store

View file

@ -220,6 +220,10 @@ static int timeout = 2;
int icache; int icache;
#endif #endif
/* FIXME: This is a hack which lets this file compile. It should be getting
this setting from remote-utils.c. */
#define remote_debug (0)
/* Descriptor for I/O to remote machine. Initialize it to NULL so that /* Descriptor for I/O to remote machine. Initialize it to NULL so that
remote_open knows that we don't have a file open when the program remote_open knows that we don't have a file open when the program
starts. */ starts. */
@ -293,6 +297,8 @@ device is attached to the remote system (e.g. /dev/ttya).");
if (!remote_desc) if (!remote_desc)
perror_with_name (name); perror_with_name (name);
#if 0
/* FIXME: This should be using remote-utils.c. */
if (baud_rate) if (baud_rate)
{ {
int rate; int rate;
@ -304,6 +310,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
perror_with_name (name); perror_with_name (name);
} }
} }
#endif
SERIAL_RAW (remote_desc); SERIAL_RAW (remote_desc);
@ -576,6 +583,9 @@ remote_wait (status)
return 0; return 0;
} }
/* Number of bytes of registers this stub implements. */
static int register_bytes_found;
/* Read the remote registers into the block REGS. */ /* Read the remote registers into the block REGS. */
/* Currently we just read all the registers, so we don't use regno. */ /* Currently we just read all the registers, so we don't use regno. */
/* ARGSUSED */ /* ARGSUSED */
@ -591,6 +601,9 @@ remote_fetch_registers (regno)
sprintf (buf, "g"); sprintf (buf, "g");
remote_send (buf); remote_send (buf);
/* Unimplemented registers read as all bits zero. */
memset (regs, 0, REGISTER_BYTES);
/* Reply describes registers byte by byte, each byte encoded as two /* Reply describes registers byte by byte, each byte encoded as two
hex characters. Suck them all up, then supply them to the hex characters. Suck them all up, then supply them to the
register cacheing/storage mechanism. */ register cacheing/storage mechanism. */
@ -598,11 +611,29 @@ remote_fetch_registers (regno)
p = buf; p = buf;
for (i = 0; i < REGISTER_BYTES; i++) for (i = 0; i < REGISTER_BYTES; i++)
{ {
if (p[0] == 0 || p[1] == 0) if (p[0] == 0)
error ("Remote reply is too short: %s", buf); break;
if (p[1] == 0)
{
warning ("Remote reply is of odd length: %s", buf);
/* Don't change register_bytes_found in this case, and don't
print a second warning. */
goto supply_them;
}
regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]); regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]);
p += 2; p += 2;
} }
if (i != register_bytes_found)
{
register_bytes_found = i;
#ifdef REGISTER_BYTES_OK
if (!REGISTER_BYTES_OK (i))
warning ("Remote reply is too short: %s", buf);
#endif
}
supply_them:
for (i = 0; i < NUM_REGS; i++) for (i = 0; i < NUM_REGS; i++)
supply_register (i, &regs[REGISTER_BYTE(i)]); supply_register (i, &regs[REGISTER_BYTE(i)]);
} }
@ -635,7 +666,8 @@ remote_store_registers (regno)
each byte encoded as two hex characters. */ each byte encoded as two hex characters. */
p = buf + 1; p = buf + 1;
for (i = 0; i < REGISTER_BYTES; i++) /* remote_prepare_to_store insures that register_bytes_found gets set. */
for (i = 0; i < register_bytes_found; i++)
{ {
*p++ = tohex ((registers[i] >> 4) & 0xf); *p++ = tohex ((registers[i] >> 4) & 0xf);
*p++ = tohex (registers[i] & 0xf); *p++ = tohex (registers[i] & 0xf);