/* Remote target communications for serial-line targets using SDS' protocol.
- Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free Software
+ Foundation, Inc.
This file is part of GDB.
static void sds_resume (ptid_t, int, enum target_signal);
-static int sds_start_remote (PTR);
+static int sds_start_remote (void *);
static void sds_open (char *, int);
static void sds_mourn (void);
-static void sds_create_inferior (char *, char *, char **);
-
static void sds_load (char *, int);
static int getmessage (unsigned char *, int);
static void sds_kill (void);
-static int tohex (int);
-
static int fromhex (int);
static void sds_detach (char *, int);
/* Clean up connection to a remote debugger. */
-/* ARGSUSED */
static void
sds_close (int quitting)
{
/* Stub for catch_errors. */
static int
-sds_start_remote (PTR dummy)
+sds_start_remote (void *dummy)
{
int c;
unsigned char buf[200];
error ("Reply contains invalid hex digit %d", a);
}
-/* Convert number NIB to a hex digit. */
-
-static int
-tohex (int nib)
-{
- if (nib < 10)
- return '0' + nib;
- else
- return 'a' + nib - 10;
-}
-
static int
tob64 (unsigned char *inbuf, char *outbuf, int len)
{
Give up (and stop debugging it)? "))
{
target_mourn_inferior ();
- return_to_top_level (RETURN_QUIT);
+ throw_exception (RETURN_QUIT);
}
target_terminal_inferior ();
/* Read the remote registers into the block REGS. */
/* Currently we just read all the registers, so we don't use regno. */
-/* ARGSUSED */
static void
sds_fetch_registers (int regno)
{
unsigned char buf[PBUFSIZ];
int i, retlen;
- char regs[REGISTER_BYTES];
+ char *regs = alloca (DEPRECATED_REGISTER_BYTES);
/* Unimplemented registers read as all bits zero. */
- memset (regs, 0, REGISTER_BYTES);
+ memset (regs, 0, DEPRECATED_REGISTER_BYTES);
buf[0] = 18;
buf[1] = 1;
/* (should warn about reply too short) */
for (i = 0; i < NUM_REGS; i++)
- supply_register (i, ®s[REGISTER_BYTE (i)]);
+ supply_register (i, ®s[DEPRECATED_REGISTER_BYTE (i)]);
}
/* Prepare to store registers. Since we may send them all, we have to
sds_prepare_to_store (void)
{
/* Make sure the entire registers array is valid. */
- read_register_bytes (0, (char *) NULL, REGISTER_BYTES);
+ deprecated_read_register_bytes (0, (char *) NULL, DEPRECATED_REGISTER_BYTES);
}
/* Store register REGNO, or all registers if REGNO == -1, from the contents
*p++ = 0;
*p++ = 0;
for (i = 0; i < 4 * 6; i++)
- *p++ = registers[i + 4 * 32 + 8 * 32];
+ *p++ = deprecated_registers[i + 4 * 32 + 8 * 32];
for (i = 0; i < 4 * 1; i++)
*p++ = 0;
for (i = 0; i < 4 * 4; i++)
*p++ = 0;
*p++ = 0;
for (i = 0; i < 4 * 32; i++)
- *p++ = registers[i];
+ *p++ = deprecated_registers[i];
sds_send (buf, p - buf);
if SHOULD_WRITE is nonzero. Returns length of data written or
read; 0 for error. TARGET is unused. */
-/* ARGSUSED */
static int
sds_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int should_write,
- struct mem_attrib *attrib ATTRIBUTE_UNUSED,
- struct target_ops *target ATTRIBUTE_UNUSED)
+ struct mem_attrib *attrib, struct target_ops *target)
{
int res;
/* Try the whole thing again. */
retry:
/* need to do something here */
+ ;
}
/* We have tried hard enough, and just can't receive the packet. Give up. */
}
static void
-sds_create_inferior (char *exec_file, char *args, char **env)
+sds_create_inferior (char *exec_file, char *args, char **env, int from_tty)
{
inferior_ptid = pid_to_ptid (42000);