Debugger crash after variable peek

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Debugger crash after variable peek

Postby Jason54 » November 5th, 2013, 5:50 am

Hi,

When I am debugging and I hold the mouse over a variable to peek at the value, the value is displayed, but if I hit F10 to step to the next line, or I continue, the debugger crashes. I.e. does not run step to the next line or continue. FireFox will display 'connection interrupted'

I can view variable values via the locals window, or a watch without a problem but it always crashes if I peek at the value.

I have the same issue in VS2012 & VS 2013, using either v1.9.4736 or v1.8.4704

Any ideas what is wrong?

Thanks
Jason54
 
Posts: 3
Joined: November 5th, 2013, 5:45 am

Re: Debugger crash after variable peek

Postby Miloslav Beno » November 5th, 2013, 2:30 pm

Hi Jason,

Do you have some code sample I can try to see the issue?

Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Debugger crash after variable peek

Postby Jason54 » November 5th, 2013, 10:33 pm

Hi There,

In trying to isolate when it happens, it seems to be to do with when there is an error handler.

Please try the code below.

Set a break point at the line "echo 'set break point here';".

When the debugger breaks, hold the mouse over 'aaa' to view the value. It should show you '22' but it shows 'null'. Now hit F10 and you won't get to the next line. If you were to hit F10 without mousing over the member, you would get to the next line no problem.

If I remove the 'exit()' from the end of the error function, it does not crash.

So it seems that the error function may be triggered in the background when peeking at a class member value, because without the 'exit()' we don't crash the debugger, but it still doesn't show the correct value of '22' it shows the member name 'aaa'.

Thanks,
Jason

Code: Select all
<?php
    function errorFunction($error_level, $error_message, $error_file, $error_line, $error_context)
    {
       echo 'error handling';
       exit();
    }
    set_error_handler('errorFunction');

    $a = new stdClass();
    $a->aaa = 22;
   
    echo 'set break point here';
    echo 'will not reach this line';
?>
Jason54
 
Posts: 3
Joined: November 5th, 2013, 5:45 am

Re: Debugger crash after variable peek

Postby Miloslav Beno » November 6th, 2013, 2:12 pm

Hi Jason,

Thank you so much for the code! I've been able to replicate the issue. It seems set_error_handler turns xdebug into some wrong state.

Anyway we've designed solution for this in our code and it will be available in the upcoming update.

Thanks again,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 202 guests

cron

User Control Panel

Login

Who is online

In total there are 202 users online :: 0 registered, 0 hidden and 202 guests (based on users active over the past 5 minutes)
Most users ever online was 487 on April 27th, 2024, 10:08 am

Users browsing this forum: No registered users and 202 guests