Is there any template debugging technique similar to Twig debugging? David Rothstein pointed out in the comments that as of Drupal 7.33, this functionality has been back-ported to Drupal 7.



Is there any template debugging technique similar to Twig debugging?
As reported in Working with template suggestions, yes.


  As of Drupal 7.33, Drupal core has a theme debug mode that can be enabled and disabled via the theme_debug variable. Theme debug mode can be used to see possible template suggestions and the locations of template files right in your HTML markup (as HTML comments). To enable it, add this line to your settings.php:

$conf['theme_debug'] = TRUE;



As said in that page, you can use Drush to enable/disable it, respectively with drush vset theme_debug 1 and drush vset theme_debug 0.

After you set theme_debug to TRUE, the source of the page will appear as follows.

&lt;!-- THEME DEBUG --&gt;
&lt;!-- CALL: theme('page') --&gt;
&lt;!-- FILE NAME SUGGESTIONS:
   * page--front.tpl.php
   * page--node.tpl.php
   x page.tpl.php
--&gt;
&lt;!-- BEGIN OUTPUT from 'modules/system/page.tpl.php' --&gt;

&lt;!-- END OUTPUT from 'modules/system/page.tpl.php' --&gt;