aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJ.T. Conklin <jtc@acorntoolworks.com>2000-08-10 18:54:27 +0000
committerJ.T. Conklin <jtc@acorntoolworks.com>2000-08-10 18:54:27 +0000
commitf1d7622b957e12c8130c24fe4c46882f70b59b1c (patch)
tree00b4defbb759d34bc6ef4db5dc670b7fc5702473 /gdb
parente84d946b3ae38920c124cba665158104049c8665 (diff)
downloadfsf-binutils-gdb-f1d7622b957e12c8130c24fe4c46882f70b59b1c.zip
fsf-binutils-gdb-f1d7622b957e12c8130c24fe4c46882f70b59b1c.tar.gz
fsf-binutils-gdb-f1d7622b957e12c8130c24fe4c46882f70b59b1c.tar.bz2
* monitor.c (monitor_open): If a dcache has already been created,
invalidate it rather than creating another. * ocd.c (ocd_open): Likewise. * remote-nindy.c (nindy_open): Likewise. * remote-sds.c (sds_open): Likewise. * remote-utils.c (gr_open): Likewise. * remote.c (remote_open_1, remote_cisco_open): Likewise. * dcache.c (dcache_alloc): Changed to take address of line as an argument, and to invalidate cache line before returning. (dcache_peek_byte): Updated. (dcache_poke_byte): Updated. -------------------------------------------------------------------
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/dcache.c24
-rw-r--r--gdb/monitor.c13
-rw-r--r--gdb/ocd.c5
-rw-r--r--gdb/remote-nindy.c6
-rw-r--r--gdb/remote-sds.c5
-rw-r--r--gdb/remote-utils.c7
-rw-r--r--gdb/remote.c10
8 files changed, 63 insertions, 22 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 47148e9..157684a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+2000-08-10 J.T. Conklin <jtc@redback.com>
+
+ * monitor.c (monitor_open): If a dcache has already been created,
+ invalidate it rather than creating another.
+ * ocd.c (ocd_open): Likewise.
+ * remote-nindy.c (nindy_open): Likewise.
+ * remote-sds.c (sds_open): Likewise.
+ * remote-utils.c (gr_open): Likewise.
+ * remote.c (remote_open_1, remote_cisco_open): Likewise.
+
+ * dcache.c (dcache_alloc): Changed to take address of line as an
+ argument, and to invalidate cache line before returning.
+ (dcache_peek_byte): Updated.
+ (dcache_poke_byte): Updated.
+
2000-08-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From Greg McGary <greg@mcgary.org>:
diff --git a/gdb/dcache.c b/gdb/dcache.c
index 7e5a755..4081c92 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -157,7 +157,7 @@ static struct dcache_block *dcache_hit (DCACHE * dcache, CORE_ADDR addr);
static int dcache_write_line (DCACHE * dcache, struct dcache_block *db);
-static struct dcache_block *dcache_alloc (DCACHE * dcache);
+static struct dcache_block *dcache_alloc (DCACHE * dcache, CORE_ADDR addr);
static int dcache_writeback (DCACHE * dcache);
@@ -267,15 +267,10 @@ dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
/* Get a free cache block, put or keep it on the valid list,
- and return its address. The caller should store into the block
- the address and data that it describes, then remque it from the
- free list and insert it into the valid list. This procedure
- prevents errors from creeping in if a memory retrieval is
- interrupted (which used to put garbage blocks in the valid
- list...). */
+ and return its address. */
static struct dcache_block *
-dcache_alloc (DCACHE *dcache)
+dcache_alloc (DCACHE *dcache, CORE_ADDR addr)
{
register struct dcache_block *db;
@@ -297,6 +292,11 @@ dcache_alloc (DCACHE *dcache)
dcache_write_line (dcache, db);
}
+ db->addr = MASK(addr);
+ db->refs = 0;
+ db->anydirty = 0;
+ memset (db->state, ENTRY_BAD, sizeof (db->data));
+
/* append this line to end of valid list */
if (!dcache->valid_head)
dcache->valid_head = db;
@@ -327,9 +327,9 @@ dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
dcache_write_line (dcache, db);
}
else
- db = dcache_alloc (dcache);
+ db = dcache_alloc (dcache, addr);
+
immediate_quit++;
- db->addr = MASK (addr);
while (done < LINE_SIZE)
{
int try =
@@ -379,9 +379,7 @@ dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
if (!db)
{
- db = dcache_alloc (dcache);
- db->addr = MASK (addr);
- memset (db->state, ENTRY_BAD, sizeof (db->data));
+ db = dcache_alloc (dcache, addr);
}
db->data[XFORM (addr)] = *ptr;
diff --git a/gdb/monitor.c b/gdb/monitor.c
index e3fa1c8..b57365e 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -838,10 +838,17 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
monitor_printf (current_monitor->line_term);
- if (current_monitor->flags & MO_HAS_BLOCKWRITES)
- remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory_block);
+ if (!remote_dcache)
+ {
+ if (current_monitor->flags & MO_HAS_BLOCKWRITES)
+ remote_dcache = dcache_init (monitor_read_memory,
+ monitor_write_memory_block);
+ else
+ remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory);
+ }
else
- remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory);
+ dcache_flush (remote_dcache);
+
start_remote ();
}
diff --git a/gdb/ocd.c b/gdb/ocd.c
index 1a50978..5c29919 100644
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -292,7 +292,10 @@ device the OCD device is attached to (e.g. /dev/ttya).");
unpush_target (current_ops);
- ocd_dcache = dcache_init (ocd_read_bytes, ocd_write_bytes);
+ if (!ocd_dcache)
+ ocd_dcache = dcache_init (ocd_read_bytes, ocd_write_bytes);
+ else
+ dcache_flush (ocd_dcache);
if (strncmp (name, "wiggler", 7) == 0)
{
diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c
index ed89be3..adf1484 100644
--- a/gdb/remote-nindy.c
+++ b/gdb/remote-nindy.c
@@ -187,7 +187,11 @@ nindy_open (char *name, /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
nindy_close (0);
have_regs = regs_changed = 0;
- nindy_dcache = dcache_init (ninMemGet, ninMemPut);
+
+ if (!nindy_dcache)
+ nindy_dcache = dcache_init (ninMemGet, ninMemPut);
+ else
+ dcache_flush (nindy_dcache);
/* Allow user to interrupt the following -- we could hang if there's
no NINDY at the other end of the remote tty. */
diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c
index 5d49152..ce6f5f6 100644
--- a/gdb/remote-sds.c
+++ b/gdb/remote-sds.c
@@ -203,7 +203,10 @@ device is attached to the remote system (e.g. /dev/ttya).");
unpush_target (&sds_ops);
- sds_dcache = dcache_init (sds_read_bytes, sds_write_bytes);
+ if (!sds_dcache)
+ sds_dcache = dcache_init (sds_read_bytes, sds_write_bytes);
+ else
+ dcache_flush (sds_dcache);
sds_desc = SERIAL_OPEN (name);
if (!sds_desc)
diff --git a/gdb/remote-utils.c b/gdb/remote-utils.c
index 795ae39..a31da1c 100644
--- a/gdb/remote-utils.c
+++ b/gdb/remote-utils.c
@@ -154,13 +154,18 @@ gr_generic_checkin (void)
void
gr_open (char *args, int from_tty, struct gr_settings *gr)
{
+ DCACHE *dcache;
+
target_preopen (from_tty);
sr_scan_args (gr->ops->to_shortname, args);
unpush_target (gr->ops);
gr_settings = gr;
- gr_set_dcache (dcache_init (gr->readfunc, gr->writefunc));
+ if ((dcache = gr_get_dcache()) == NULL)
+ gr_set_dcache (dcache_init (gr->readfunc, gr->writefunc));
+ else
+ dcache_flush (dcache);
if (sr_get_desc () != NULL)
gr_close (0);
diff --git a/gdb/remote.c b/gdb/remote.c
index 9fe2a29..557ab46 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2057,7 +2057,10 @@ serial device is attached to the remote system\n\
unpush_target (target);
- remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+ if (!remote_dcache)
+ remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+ else
+ dcache_flush (remote_dcache);
remote_desc = SERIAL_OPEN (name);
if (!remote_desc)
@@ -5034,7 +5037,10 @@ device is attached to the remote system (e.g. host:port).");
unpush_target (&remote_cisco_ops);
- remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+ if (!remote_dcache)
+ remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+ else
+ dcache_flush (remote_dcache);
remote_desc = SERIAL_OPEN (name);
if (!remote_desc)