Here are some hacks that can be added into drupal core code to track down tricky bugs:

If drupal_get_path starts erroring out

****** /includes/module.inc **********
LINE 285
+ // if (!function_exists('drupal_get_path')) { return FALSE; }
$file = './'. drupal_get_path('module', $module) ."/$name.$type";

If you start getting "unserialize" errors in the DB

***** bootstrap.inc (includes/bootstrap.inc) *****
LINE 569
while ($variable = db_fetch_object($result)) {
+ $value = unserialize($variable->value);
+ if ($value===FALSE && $variable->value != serialize(FALSE)) {
+   global $base_url;
+   trigger_error('Malformed variable: ' . $variable->name . ' - ' . $variable_value . ' in DB for ' . $base_url);
+ }