aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-hms.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1995-06-21 21:47:06 +0000
committerSteve Chamberlain <sac@cygnus>1995-06-21 21:47:06 +0000
commit45993f6118fb8065ed70d448f4e741763cb8fe4d (patch)
tree5d0efb4afc2f3a4edde351181b04a8dd37a1fad4 /gdb/remote-hms.c
parent65b175c5e61b058aa7de9660c720371b11b95c45 (diff)
downloadgdb-45993f6118fb8065ed70d448f4e741763cb8fe4d.zip
gdb-45993f6118fb8065ed70d448f4e741763cb8fe4d.tar.gz
gdb-45993f6118fb8065ed70d448f4e741763cb8fe4d.tar.bz2
Hmm.. The ChangeLog went in, but not the code....
* monitor.c: Turn on caching. (monitor_printf): If a ^C was sent, don't expect to see its echo. (monitor_open): Enable caching. (monitor_resume, monitor_load): Flush cache. (monitor_xfer_memory): Call cache routine. (monitor_dump_regs): New. (monitor_fetch_registers): If monitor_dump_regs available then use it. (monitor_load): Don't ref exec_bfd if it's NULL. (monitor_load_srec): Use new monitor_make_srec calling convention. (monitor_make_srec): Rewrite to cope with two, three and four byte addresses. * remote-hms.c (hms_cmds): Initialze end-of-command delim. * dcache.h, dcache.h: Rewritten. * remote.c: Reenable caching. (getpkt): Reduce MAX_TRIES to 3. (remote_xfer_memory): Use dcache_xfer_memory. * defs.h (error_hook): New. * top.c (error_hook): New definition. * utils.c (error): Use error_hook if initialized. * sparcl-tdep.c (HAVE_SOCKETS): Don't define if GO32 or WIN32. Use HAVE_SOCKETS in place of #ifndef GO32.
Diffstat (limited to 'gdb/remote-hms.c')
-rw-r--r--gdb/remote-hms.c95
1 files changed, 1 insertions, 94 deletions
diff --git a/gdb/remote-hms.c b/gdb/remote-hms.c
index 5ec9fef..0d42aa9 100644
--- a/gdb/remote-hms.c
+++ b/gdb/remote-hms.c
@@ -131,7 +131,7 @@ static struct monitor_ops hms_cmds =
"tl\r", /* download command */
NULL, /* load response */
">", /* monitor command prompt */
- NULL, /* end-of-command delimitor */
+ "\r", /* end-of-command delimitor */
NULL, /* optional command terminator */
&hms_ops, /* target operations */
SERIAL_1_STOPBITS, /* number of stop bits */
@@ -202,9 +202,6 @@ static void remove_commands ();
static int quiet = 1; /* FIXME - can be removed after Dec '94 */
-DCACHE *dcache_ptr;
-int remote_dcache;
-serial_t desc;
/***********************************************************************
@@ -532,7 +529,6 @@ hms_close (quitting)
SERIAL_CLOSE (desc);
}
is_open = 0;
- remote_dcache = 0;
}
/* Terminate the open connection to the remote debugger. Use this
@@ -561,8 +557,6 @@ hms_resume (pid, step, sig)
enum target_signal
sig;
{
- dcache_flush (dcache_ptr);
-
if (step)
{
hms_write_cr ("s");
@@ -1034,26 +1028,6 @@ translate_addr (addr)
}
-/* Read a word from remote address ADDR and return it.
- * This goes through the data cache.
- */
-int
-hms_fetch_word (addr)
- CORE_ADDR addr;
-{
- return dcache_fetch (dcache_ptr, addr);
-}
-
-/* Write a word WORD into remote address ADDR.
- This goes through the data cache. */
-
-void
-hms_store_word (addr, word)
- CORE_ADDR addr;
- int word;
-{
- dcache_poke (dcache_ptr, addr, word);
-}
int
hms_xfer_inferior_memory (memaddr, myaddr, len, write, target)
@@ -1063,73 +1037,6 @@ hms_xfer_inferior_memory (memaddr, myaddr, len, write, target)
int write;
struct target_ops *target; /* ignored */
{
- register int i;
-
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr;
-
- /* Round ending address up; get number of longwords that makes. */
- register int count;
-
- /* Allocate buffer of that many longwords. */
- register int *buffer;
-
- memaddr &= 0xffff;
- addr = memaddr & -sizeof (int);
- count = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
-
- buffer = (int *) alloca (count * sizeof (int));
-
- if (write)
- {
- /* Fill start and end extra bytes of buffer with existing memory data. */
-
- if (addr != memaddr || len < (int) sizeof (int))
- {
- /* Need part of initial word -- fetch it. */
- buffer[0] = hms_fetch_word (addr);
- }
-
- if (count > 1) /* FIXME, avoid if even boundary */
- {
- buffer[count - 1]
- = hms_fetch_word (addr + (count - 1) * sizeof (int));
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- hms_store_word (addr, buffer[i]);
- if (errno)
- {
- return 0;
- }
-
- }
- }
- else
- {
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- buffer[i] = hms_fetch_word (addr);
- if (errno)
- {
- return 0;
- }
- QUIT;
- }
-
- /* Copy appropriate bytes out of the buffer. */
- memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
- }
return len;
}