* dcache.c (dcache_info): Don't print cache state if last_cache

is NULL.
This commit is contained in:
J.T. Conklin 2000-08-11 14:47:38 +00:00
parent 1630fd2bf1
commit 5e2039ea24
2 changed files with 20 additions and 12 deletions

View file

@ -1,3 +1,8 @@
2000-08-11 J.T. Conklin <jtc@redback.com>
* dcache.c (dcache_info): Don't print cache state if last_cache
is NULL.
2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
* config/mn10300/tm-mn10300.h, mn10300-tdep.c

View file

@ -461,21 +461,24 @@ dcache_info (char *exp, int tty)
printf_filtered ("Dcache enabled, line width %d, depth %d\n",
LINE_SIZE, DCACHE_SIZE);
printf_filtered ("Cache state:\n");
for (p = last_cache->valid_head; p; p = p->p)
if (last_cache)
{
int j;
printf_filtered ("Line at %s, referenced %d times\n",
paddr (p->addr), p->refs);
printf_filtered ("Cache state:\n");
for (j = 0; j < LINE_SIZE; j++)
printf_filtered ("%02x", p->data[j] & 0xFF);
printf_filtered ("\n");
for (p = last_cache->valid_head; p; p = p->p)
{
int j;
printf_filtered ("Line at %s, referenced %d times\n",
paddr (p->addr), p->refs);
for (j = 0; j < LINE_SIZE; j++)
printf_filtered (" %2x", p->state[j]);
printf_filtered ("\n");
for (j = 0; j < LINE_SIZE; j++)
printf_filtered ("%02x", p->data[j] & 0xFF);
printf_filtered ("\n");
for (j = 0; j < LINE_SIZE; j++)
printf_filtered (" %2x", p->state[j]);
printf_filtered ("\n");
}
}
}