* dcache.c (dcache_info): Don't print cache state if last_cache
authorJ.T. Conklin <jtc@acorntoolworks.com>
Fri, 11 Aug 2000 14:47:38 +0000 (14:47 +0000)
committerJ.T. Conklin <jtc@acorntoolworks.com>
Fri, 11 Aug 2000 14:47:38 +0000 (14:47 +0000)
is NULL.

gdb/ChangeLog
gdb/dcache.c

index e2a3393a636b3c43ab008b66318593a4138b1445..3da78bbc9768181912ee0bed6120a422bd26f765 100644 (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
index 4081c920ceb2b39e3c46587e1fa589a21b66d9c9..a890979728800c665b3708b78e9c0127af9b1b3a 100644 (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 (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");
+       }
     }
 }