PHP-GTK real time debugging - mini how-to

From: Date: Sun, 15 May 2005 21:17:13 +0000
Subject: PHP-GTK real time debugging - mini how-to
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5860@lists.php.net to get a copy of this message
Hello everyone In couple of last weeks Im developing little app in php-gtk. I had few very hard moments caused for example by php references (or rather "lack of them" in object meaning) - in that concrete example I know that references was my problem just after I was able to realtime (step by step) debug my code - It was'nt easy. I was searching Internet very long and I found just scrap of informations but now I can finally realtime debug php-gtk code. I will give a few instructions on how to start. 1. Download xdebug extension to php from www.xdebug.org 2. Follow instructions on http://xdebug.org/install.php to activate xdebug extension 3. Follow instructions on http://xdebug.org/docs-debugger.php to configure "remote debugging" 4. You have to download, install and configure DBGp debugger protocol Client. I was searching tools for windows platform and I found two (Im using komodo): ActiveState Komodo - http://www.activestate.com/Products/Komodo/ Maguma Workbench - http://www.maguma.com/?article=wkb_benefits&id=2 You have to make sure that debugger client/server uses the same port - default if 9000 - I was have to change this setting in Komodo 5. Now, if all goes right way and you are running Komodo or Maguma with debugger in listening mode after you run your script it should stop on the first line and you can run your script line by line. When you go over to gtk::main() call you should "step into" that call and you are inside of gtk main loop - you can set breakpoint on some signal handler function, let the script go (debugger "play" button), make some action in GUI that will emits handled singal and you are again in Komodo or Maguma with script stopped - and again and again......... I hope that this little how-to will be helpful for anyone. btw. On xdebug site there is a DBGp Protocol text client which comunnicates in xml one way - you can try debug your script with this tool - I tried :) and after few seconds i was googling with "dbgp gui client" ;-) -- Pozdrawiam Łukasz Wojciechowski

« previous php.gtk.general (#5860) next »