Index: includes/theme.inc
===================================================================
--- includes/theme.inc	(revision 51)
+++ includes/theme.inc	(working copy)
@@ -453,10 +453,14 @@
           $themes[] = $theme;
         }
       }
+      // debugging list_themes()
+      watchdog('d6_theming_debug', 'Fetched theme settings from database: '.htmlspecialchars(print_r($themes, true)));
     }
     else {
       // Scan the installation when the database should not be read.
       $themes = _system_theme_data();
+      // debugging list_themes()
+      watchdog('d6_theming_debug', 'Fetched theme settings without db connection (info files): '.htmlspecialchars(print_r($themes, true)));
     }
 
     foreach ($themes as $theme) {

