You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Remote communication protocol.
"0* " means the same as "0000". */
#include "defs.h"
-#include <string.h>
+#include "gdb_string.h"
#include <fcntl.h>
#include "frame.h"
#include "inferior.h"
/* Prototypes for local functions */
static int
-remote_write_bytes PARAMS ((CORE_ADDR memaddr, unsigned char *myaddr, int len));
+remote_remove_breakpoint PARAMS ((CORE_ADDR, char *));
static int
-remote_read_bytes PARAMS ((CORE_ADDR memaddr, unsigned char *myaddr, int len));
+remote_insert_breakpoint PARAMS ((CORE_ADDR, char *));
+
+static void
+remote_mourn PARAMS ((void));
+
+static void
+remote_kill PARAMS ((void));
+
+static int
+read_frame PARAMS ((char *));
+
+static void
+boot_board PARAMS ((char *, int));
+
+static int
+remote_write_bytes PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
+
+static int
+remote_read_bytes PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
static void
remote_files_info PARAMS ((struct target_ops *ignore));
be plenty. */
static int remote_timeout = 2;
-#if 0
-int icache;
-#endif
-
/* 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
starts. */
/* Query the remote side for the text, data and bss offsets. */
+#if 0
+
static void
get_offsets ()
{
objfile_relocate (symfile_objfile, offs);
}
+#endif /* unused */
+
#define INBUFSIZE 10
-void
-boot_board()
+static void
+boot_board (dummy1, dummy2)
+ char *dummy1;
+ int dummy2;
{
char c;
char buf[INBUFSIZE];
remote_start_remote (dummy)
char *dummy;
{
- int timeout;
-
immediate_quit = 1; /* Allow user to interrupt it */
/* Ack any packet which the remote side has already sent. */
{
unsigned char *p1;
- regno = strtol (p, &p1, 16); /* Read the register number */
+ regno = strtol (p, (char **) &p1, 16); /* Read the register number */
if (p1 == p)
warning ("Remote sent badly formed register number: %s\nPacket: '%s'\n",
/* Use of the data cache is disabled because it loses for looking at
and changing hardware I/O ports and the like. Accepting `volatile'
- would perhaps be one way to fix it, but a better way which would
- win for more cases would be to use the executable file for the text
- segment, like the `icache' code below but done cleanly (in some
- target-independent place, perhaps in target_xfer_memory, perhaps
- based on assigning each target a speed or perhaps by some simpler
- mechanism). */
+ would perhaps be one way to fix it. Another idea would be to use the
+ executable file for the text segment (for all SEC_CODE sections?
+ For all SEC_READONLY sections?). This has problems if you want to
+ actually see what the memory contains (e.g. self-modifying code,
+ clobbered memory, user downloaded the wrong thing). */
/* Read a word from remote address ADDR and return it.
This goes through the data cache. */
remote_fetch_word (addr)
CORE_ADDR addr;
{
-#if 0
- if (icache)
- {
- extern CORE_ADDR text_start, text_end;
-
- if (addr >= text_start && addr < text_end)
- {
- int buffer;
- xfer_core_file (addr, &buffer, sizeof (int));
- return buffer;
- }
- }
-#endif
return dcache_fetch (remote_dcache, addr);
}
static int
remote_write_bytes (memaddr, myaddr, len)
CORE_ADDR memaddr;
- unsigned char *myaddr;
+ char *myaddr;
int len;
{
char buf[PBUFSIZ];
static int
remote_read_bytes (memaddr, myaddr, len)
CORE_ADDR memaddr;
- unsigned char *myaddr;
+ char *myaddr;
int len;
{
char buf[PBUFSIZ];
xfersize = len;
if (should_write)
- bytes_xferred = remote_write_bytes (memaddr,
- (unsigned char *)myaddr, xfersize);
+ bytes_xferred = remote_write_bytes (memaddr, myaddr, xfersize);
else
- bytes_xferred = remote_read_bytes (memaddr,
- (unsigned char *)myaddr, xfersize);
+ bytes_xferred = remote_read_bytes (memaddr, myaddr, xfersize);
/* If we get an error, we are done xferring. */
if (bytes_xferred == 0)
case '$':
if (started_error_output)
{
- putc_unfiltered ('\n');
+ putchar_unfiltered ('\n');
started_error_output = 0;
}
}
started_error_output = 1;
printf_unfiltered ("putpkt: Junk: ");
}
- putc_unfiltered (ch & 0177);
+ putchar_unfiltered (ch & 0177);
}
continue;
}
char *buf;
int forever;
{
- char *bp;
int c;
int tries;
int timeout;
than other targets. */
static unsigned char break_insn[] = REMOTE_BREAKPOINT;
-/* Check that it fits in BREAKPOINT_MAX bytes. */
-static unsigned char check_break_insn_size[BREAKPOINT_MAX] = REMOTE_BREAKPOINT;
-
#else /* No REMOTE_BREAKPOINT. */
/* Same old breakpoint instruction. This code does nothing different
remote_mourn, /* to_mourn_inferior */
0, /* to_can_run */
0, /* to_notice_signals */
+ 0, /* to_thread_alive */
0, /* to_stop */
process_stratum, /* to_stratum */
NULL, /* to_next */