开发者

Interactive Debugging and Breakpoints with Xdebug and the Zend Framework

I'm trying to get interactive debugging working with a Zend Framework application and Xdebug, using MacGDPp as the client debugger. I'm running to some problems setting breakpoints and was hoping

  1. Someone could solve my specific problem

  2. Someone could give me a high level overview of how this is supposed to work so I can track down the problem myself

MacGDPp has an option to start the debugger immediately whenever a request is made. This works. I load a page of the Zend Application and execution stops at the first line of the Zend index.php file.

However, if I attempt to set a break point in MacGDPp either a Controller or phtml template file, execution does NOT halt at those breakpoints.

Outside of Zend, if I setup a simple page with a single require, I can sucsefully set break points in the required file.

File: test.php
<?php
    echo "One <br>";
    echo "Two <br>";
    echo "Three <br>";
    echo "Four <br>";
    echo "Five <br>";
    echo "Six <br>";
    echo "Seven <br>";
    echo "Eight <br>";
    echo "Nine <br>";
    echo "Ten <br>";

    require_once('test2.php');  

File: test2.php
<?php       
    echo "Eight <br>";
    echo "Five <br>";
    echo "Four <br>";
    echo "Nine <br>";
    echo "One <br>";
    echo "Seven <br>";
    echo "Six <b开发者_如何学编程r>";
    echo "Ten <br>";
    echo "Three <br>";
    echo "Two <br>";    

So, I'm a bit at a loss on how to proceed. I don't know if my client is setting breakpoints wrong, or if there's something about Zend's autoloadng/instantiation patterns that prevents any interactive debugger from knowing how to hookup a files I select from the filesystem with a "remote" (localhost) URL I've executed.

If anyone has a solution and/or some pointers on how remote PHP debuggers work I'd appreciate it.


Holy crap - I was pulling my hair out - XAMPP 1.7.1 (php 5.2.9) with notepad++ and Xdebug was not stopping at breakpoints (only at the xdebug_break() lines). This was because the dumb debugger won't break if you place your breakpoint on a blank line! Man, I wish it said that somewhere in the manual. Oh yeah, I forgot; there is no manual...


Turns out I was setting break points on blank lines and MacGDPp skips over those.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜