How to "step into" code with xdebug & netbeans

Hi,

I have setup xdebug on my server and its workings with netbeans on my ubuntu box.

However when I run it I can only step through the index.php file.

It does not show me steps inside a controller file.

I have also put break points in the controller files but I can never get there.

Any ideas?

Keyvan

Shift+F5 = Start Debug

F8 = Step Over (I think this is your case)

F7 = Step Into (What you need)

Ctrl+F7 = Step Out

F4 = Run To Cursor

I hope this helps you.

Regards from Colombia.

Ricardo

It is possible that some error occures before your controller code is executed. Try to debug through yii’s code to find where execution breaks.

Try to disable Ajax validation.

Good day.

I have the same problem as described in the first post.

I think the problem is not with Ajax checks.

Raised the topic that describes the problem:

http://www.yiiframework.com/forum/index.php?/topic/14968-how-to-make-a-breakpoint-in-my-controller/

I think that there are some XDebug issues caused by this issue, I can see that (presumably for efficiency reasons) there are lots of ‘non braced if statements’ i.e.

LN 132: framework/db/CDbCommand.php



	public function setText($value)


	{


		if($this->_connection->tablePrefix!==null && $value!='')


			$this->_text=preg_replace('/{{(.*?)}}/',$this->_connection->tablePrefix.'\1',$value);


		else


			$this->_text=$value;


		$this->cancel();


		return $this;


	}

XDebug seems to have problems stepping into these, Derick Rethans (Author of Xdebug) suggests that ‘un braced’ code cannot be stepped into as the bytecode will lack the required EXT_STMT opcode at the appropriate location.

Please see the post below for more details…

http://www.xdebug.org/archives/xdebug-general/1822.html

Hi kevan,

This is more of a Netbeans-XDebug problem, because I have encountered this problem first with a non-Yii (actually, non-frameworked) codes in my Ubuntu 10. Googling around, I fixed the problem by downloading the suitable xdebug driver based on my phpinfo (this is a very cool tool), and followed the steps that was given there. I restarted apache and tested the debugging with breakpoints, and it worked.

If I’m not mistaken, it all boils down to the xdebug driver and your php.ini configuration. I did the same thing with my XAMPP-Yii-Netbeans setup in my Windows XP, and worked like a charm.

Hi,

I have XDebug installed with Netbeans on a Wamp platform and can step into code without problems. However I can’t see any attributes within my object models. Is this expected behaviour when model attributes are private - or have I perhaps not got XDebug set up correctly?

I can see my Objects under the Variables tab and they look expandable, but nothing happens when I click the ‘+’ to try to expand them.

Has anyone managed to see object contents successfully?