summaryrefslogtreecommitdiff
path: root/gdb/dcache.c
diff options
context:
space:
mode:
authorJ.T. Conklin <jtc@redback.com>2000-08-11 14:47:38 +0000
committerJ.T. Conklin <jtc@redback.com>2000-08-11 14:47:38 +0000
commit243094bc673d934f22c54654330d640066fb5b65 (patch)
tree934f014069ee816221738c9e6b256a3601f74357 /gdb/dcache.c
parent73eb722c8c901118d19b4651a932a3df9782ecb9 (diff)
downloadgdb-243094bc673d934f22c54654330d640066fb5b65.tar.gz
* dcache.c (dcache_info): Don't print cache state if last_cache
is NULL.
Diffstat (limited to 'gdb/dcache.c')
-rw-r--r--gdb/dcache.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gdb/dcache.c b/gdb/dcache.c
index 4081c920ceb..a8909797288 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -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 (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 ("%02x", p->data[j] & 0xFF);
- 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");
+ for (j = 0; j < LINE_SIZE; j++)
+ printf_filtered (" %2x", p->state[j]);
+ printf_filtered ("\n");
+ }
}
}