From 5e2039ea240228aedd95608a086c9ae835e9aa7d Mon Sep 17 00:00:00 2001 From: "J.T. Conklin" Date: Fri, 11 Aug 2000 14:47:38 +0000 Subject: [PATCH] * dcache.c (dcache_info): Don't print cache state if last_cache is NULL. --- gdb/ChangeLog | 5 +++++ gdb/dcache.c | 27 +++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2a3393a63..3da78bbc97 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2000-08-11 J.T. Conklin + + * dcache.c (dcache_info): Don't print cache state if last_cache + is NULL. + 2000-08-10 Andrew Cagney * config/mn10300/tm-mn10300.h, mn10300-tdep.c diff --git a/gdb/dcache.c b/gdb/dcache.c index 4081c920ce..a890979728 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 (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"); + } } }