code: public function stacktraceSqlAction()
      {
          if ($query = $this->_initQuery()) {
              $helper = Mage::helper('sheep_debug');
              $stripZendPath = $helper->canStripZendDbTrace() ? 'lib/Zend/Db/Adapter' : '';
              $trimPath = $helper->canTrimMagentoBaseDir() ? Mage::getBaseDir() . DS : '';
              $html = '<pre>' . Mage::helper('sheep_debug')->formatStacktrace($query->getStackTrace(), $stripZendPath, $trimPath) . '</pre>';
              $this->getResponse()->setBody($html);
          }
      }
docs: Returns stack trace for specified query