+
+ printf_filtered (_("Contains data for %s\n"),
+ target_pid_to_str (last_cache->ptid));
+
+ refcount = 0;
+
+ n = splay_tree_min (last_cache->tree);
+ i = 0;
+
+ while (n)
+ {
+ struct dcache_block *db = (struct dcache_block *) n->value;
+
+ printf_filtered (_("Line %d: address %s [%d hits]\n"),
+ i, paddress (target_gdbarch (), db->addr), db->refs);
+ i++;
+ refcount += db->refs;
+
+ n = splay_tree_successor (last_cache->tree, n->key);
+ }
+
+ printf_filtered (_("Cache state: %d active lines, %d hits\n"), i, refcount);
+}
+
+static void
+set_dcache_size (char *args, int from_tty,
+ struct cmd_list_element *c)
+{
+ if (dcache_size == 0)
+ {
+ dcache_size = DCACHE_DEFAULT_SIZE;
+ error (_("Dcache size must be greater than 0."));
+ }
+ if (last_cache)
+ dcache_invalidate (last_cache);
+}
+
+static void
+set_dcache_line_size (char *args, int from_tty,
+ struct cmd_list_element *c)
+{
+ if (dcache_line_size < 2
+ || (dcache_line_size & (dcache_line_size - 1)) != 0)
+ {
+ unsigned d = dcache_line_size;
+ dcache_line_size = DCACHE_DEFAULT_LINE_SIZE;
+ error (_("Invalid dcache line size: %u (must be power of 2)."), d);
+ }
+ if (last_cache)
+ dcache_invalidate (last_cache);
+}
+
+static void
+set_dcache_command (char *arg, int from_tty)
+{
+ printf_unfiltered (
+ "\"set dcache\" must be followed by the name of a subcommand.\n");
+ help_list (dcache_set_list, "set dcache ", -1, gdb_stdout);
+}
+
+static void
+show_dcache_command (char *args, int from_tty)
+{
+ cmd_show_list (dcache_show_list, from_tty, "");