Page 1 of 1

Debugging custom code

Posted: Mon Jan 21, 2013 6:22 pm
by martbarr
I normally use Netbeans or Phpstorm for php debugging.
Netbeans does a great job of remote xdebugging and can do all the usual stepping/watching etc .

Which is fine for most things, but it doesn't seem to want to work for stepping into eval code.
Which is a shame as it would be brilliant for debugging activity procedures.
Some folks reckon you can xdebug_break() in the procedure code and that works but I can't get it to work sadly.
It does step the code as I get the output I expect per 'step' using F7/F8, but I can't actually see the eval code or vars as I'm stepping through.

I don't really want to return to var_dump having experienced the luxury of stepping through server side code, but wondered what you guys all did for this sort of thing?

I suppose I could comment the eval line in runprocedure and dump the hash processed code into it just for the debugging work.
But does anyone known of anything decent that lets you step into and play with eval code via a remote debugger.
It would save me a load of time as I need to write and carefully test a whole series of activity procedures.

Thanks as ever !
Martin

Re: Debugging custom code

Posted: Tue Jan 22, 2013 6:51 pm
by martbarr
Have discovered that copying the eval'd code is quite quick for my purposes.

I just put an echo statement to get the hash processed string in runprocedure.php, and then replaced the eval with the code and a die;
and now I can step/test using netbeans and xdebug.

Saved me loads of time today!

cheers
Martin

Re: Debugging custom code

Posted: Wed Jan 23, 2013 11:58 pm
by admin
Martin,

You can echo a value to zzsys_trap using nuDebug();

http://wiki.nubuilder.com/tiki-index.ph ... g_pString_

Steven