New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xdebug Context blank #172

Open
zono50 opened this Issue Jun 8, 2017 · 25 comments

Comments

@zono50

zono50 commented Jun 8, 2017

I have been working on this issue for about a week now. I have Xdebug show up in phpinfo, all the modules are loaded correctly. I'm trying to run Xdebug on localhost. The port i'm using for xdebug is open, yet xdebug always shows blank on Xdebug Context, where before it would show data about the session. Any help on this would be great.

Here is my Xdebug.ini

[xdebug]
zend_extension="/etc/php/conf.d/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_log="/Backup/xdebug.log"
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.idekey=sublime.xdebug

and my xdebug files.

Assignment1.sublime-project -

{

"folders":
[
	{

		"follow_symlinks": true,
		"path": "."


	}



],

"settings": {

	"xdebug": {
		"path_mapping": {
    "/srv/http/Assignment1.php" : "/srv/http/Assignment1.php",
    
},

		"url": "http://localhost/Assignment1.php",
		"ide_key": "sublime.xdebug",
		"port": 9000,
		"super_globals": true


	}


}

}

Xdebug.sublime-settings -

{
"path_mapping": {
"/srv/http/Assignment1.php" : "/srv/http/Assignment1.php",

},

"url": "http://localhost/Assignment1.php",
"super_globals": true,
"close_on_stop": true

}

@joshbrown81

This comment has been minimized.

joshbrown81 commented Jul 14, 2017

I have the same issue with the following xdebug.sublime-settings
{ "max_depth": 10, "max_children": 64, "max_data": 4096, "super_globals": false }

Any update on this?

@dschiera95

This comment has been minimized.

dschiera95 commented Jul 18, 2017

@joshbrown81, I was having this same problem too. Weird thing is that different projects behave differently.
On the project where the Xdebug Context was blank, I updated the "max-depth" from 3 to 1, and then it worked.

@johnwilhite

This comment has been minimized.

johnwilhite commented Oct 12, 2017

I had this problem on one of my virtual machines, and I was able to figure out that it was on a dev version of XDebug that wasn't properly escaping xml quotes. Downgrading to latest stable version fixed the issue.

@soifou

This comment has been minimized.

soifou commented Feb 7, 2018

I have the same problem and I think it is a bug with Xdebug not this package

  • PHP 7.1 - Xdebug 2.5.5 => OK w. super_globals true/false
  • PHP 7.2 - Xdebug 2.6.0 => KO w. super_globals true, OK w. super_globals false

I looked at xdebug.log for both version and as @jbwilhite said it is a problem about escaping xml quotes

Xdebug 2.6.0 return this (looked at the fullname property not escaping correctly):

<response command="context_get" context="1" transaction_id="16" xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug">
    <property children="1" fullname="$_COOKIE" name="$_COOKIE" numchildren="2" page="0" pagesize="32" type="array">
        <property encoding="base64" fullname="$_COOKIE[&quot;XDEBUG_SESSION&quot;]" name="XDEBUG_SESSION" size="14" type="string">
            <![CDATA[c3VibGltZS54ZGVidWc=]]>
        </property>
        [...]
    </property>
[...]
</response>

Instead of this (Xdebug 2.5.5)

<response command="context_get" context="1" transaction_id="16" xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug">
    <property children="1" fullname="$_COOKIE" name="$_COOKIE" numchildren="2" page="0" pagesize="32" type="array">
        <property encoding="base64" fullname="$_COOKIE['XDEBUG_SESSION']" name="XDEBUG_SESSION" size="14" type="string">
            <![CDATA[c3VibGltZS54ZGVidWc=]]>
        </property>
        [...]
    </property>
[...]
</response>
@adc91

This comment has been minimized.

adc91 commented Feb 14, 2018

There is an error when parsing the XML when the super_globals field is true.
The solution for now is to put super_globals in false.

In Sublime click Tool -> Xdebug -> Settings - User

{
    "super_globals": false,
}
@megusta420

This comment has been minimized.

megusta420 commented Apr 24, 2018

@martomo hello!
Will it be the update for xdebug >=2.60? I have the same issue as people above, see no any local variables, just variables passed through parameters to the function:

image
image

@tealborder

This comment has been minimized.

tealborder commented May 14, 2018

Super_globals toggling doesnt do anything for me. I'm on
Debian contrib-stretch64, php7.2, opcache turned off

PHP 7.2.4-1+0~20180405085422.20+stretch~1.gbpbff9f0 (cli) (built: Apr  5 2018 08:54:25) ( NTS )
...
Zend Engine v3.2.0, ...
    with Zend OPcache v7.2.4-1+0~20180405085422.20+stretch~1.gbpbff9f0, ...
    with Xdebug v2.6.0, ...

Reported as issue at xdebug tracker. Total noob here if I'm doing this wrong https://bugs.xdebug.org/view.php?id=1550

So double quote is translated to quote; here
https://github.com/martomo/SublimeTextXdebug/blob/master/xdebug/elementtree/ElementTree.py
Lines 761, 822

@joshbrown81

This comment has been minimized.

joshbrown81 commented May 16, 2018

I found after some experimenting, that the max_depth can be a culprit. I decreased mine from 10 to 4 to begin with and the context variables began to appear again. Now, mine sits at 8 and I haven't had an issue since. (MacBook pro, VS Code, has worked with PHP 5.5, 5.6 and 7.1)

"xdebugSettings": { "max_children": 4096, "max_data": 268435456, "max_depth": 8 }

I think it can really struggle when you have, say a large multidimensional array.

@madebycaliper

This comment has been minimized.

madebycaliper commented May 17, 2018

I really don't know enough about Python or ST3's inner workings to know what's happening but it seems like it might be related to the loading the context into memory. The breakpoint/error line will get focused in the editor window but then xdebug seems to "freeze" and not populate or update the context/watch windows.

@BigsonLvrocha

This comment has been minimized.

BigsonLvrocha commented May 24, 2018

I also get this error, using it in windows 7 with globals set to false and max_depth > 1 and even that, when I get the stack call higher than 8 the context gets blank

@longelas

This comment has been minimized.

longelas commented May 25, 2018

Until martomo solves this issue with the plugin, I advise you all to switch to atom instead of sublime and install the php-debug package for it. Also, almost all sublime plugins has an atom substitute and debugging in atom just works fine with xdebug 2.6.0+. Not the ideal solution, but still a better option than seeing nothing in the context window.

@mkd1994

This comment has been minimized.

mkd1994 commented May 28, 2018

XDebug Settings: max_depth: 1 and super_globals: false and it works with no issues, if you ask me why i dont know ... -_-

@orchie

This comment has been minimized.

orchie commented Jul 15, 2018

xdebug 2.6 ,
set super_globals = false ,in users.setting
then its ok.

@johnpicozzi

This comment has been minimized.

johnpicozzi commented Jul 25, 2018

Having the same issue and "max_depth": 1, & "super_globals": false did not work. Strange thing is my breakpoints still work, I can get xdebug to connect and stop at breakpoints. Just no info in any of the windows.

@joshbrown81

This comment has been minimized.

joshbrown81 commented Jul 25, 2018

@johnpicozzi What about your max data and max children? I found it's best to try and start with the absolute minimum and then slowly work up to see how far you can stretch it.

I switched to VS code some time ago now and still haven't had an issue like this just fyi.

@johnpicozzi

This comment has been minimized.

johnpicozzi commented Jul 25, 2018

@joshbrown81 - Those are both set to default.

LOL - My co-workers recommended that. Maybe I will give that a go

@darby3

This comment has been minimized.

darby3 commented Jul 25, 2018

I think I tried the stretch-up approach myself and never got anywhere with it. Getting minimal versions of Drupal arrays wouldn't be of much use (to me) in any case.

@joshbrown81

This comment has been minimized.

joshbrown81 commented Jul 25, 2018

@darby3 Yeah, especially when you get arrays full of objects that contain more arrays!
@johnpicozzi My reaction was the same when a colleague of mine suggested. I was very uncertain at first but I can honestly say it's made my development so much easier, especially with xdebug.

@mercurykd

This comment has been minimized.

mercurykd commented Aug 4, 2018

protocol.py after line 135 paste this:
elif text[1:-1] == 'quot':
text = "'"

rioastamal added a commit to rioastamal/SublimeTextXdebug that referenced this issue Aug 12, 2018

@rioastamal

This comment has been minimized.

rioastamal commented Aug 12, 2018

@mercurykd Thanks. I've made PR based on your code #186

@andresmrg

This comment has been minimized.

andresmrg commented Sep 8, 2018

FINALLY WORKING!

This is needed so urgent! We are just struggling to get this working... After several hours I finally came here to see the problem was not my xdebug installation, neither a configuration issue.

On High Sierra:
For those who super_globals = false didn't work and max_depth = 1 (my case). Here is what I did.

  1. I uninstall xdebug client for sublime text
  2. I download the repository from the instructions https://github.com/martomo/SublimeTextXdebug#installation
  3. Edited the file as suggested #184
  4. On sublimeText, Preference > Browse Packages and move the folder there. Quit Sublime and Open it again.
  5. It works now.

I hope these instructions just help a newbie like me.

@stychos

This comment has been minimized.

stychos commented Sep 8, 2018

But there's another issue for me, I don't know how to look at the multi-level arrays content from context.
screen shot 2018-09-08 at 12 48 29 pm
Any solution? But I think better to create new issue for this, will try to fix it first myself.

@andresmrg

This comment has been minimized.

andresmrg commented Sep 8, 2018

That's not an issue. Open Sublime and go to Tool > Xdebug > Setting - User and update max_depth to any number > 2. The default settings use 1, so you should work with a number over 3, the larger the number, the longer it will take while debugging. After you apply the changes, close sublime and open it again, they should have taken effect. @stychos

{
  "max_depth": 6,

  // Maximum amount of array children
  // and object's properties to return.
  "max_children": 50,

  // Maximum amount of
  // variable data to initially retrieve.
  "max_data": 5048,
}
@stychos

This comment has been minimized.

stychos commented Sep 8, 2018

Hm.. this time it's worked. I could been sure that when last time I've tried it (before this "quot" fix), it wasn't worked for me. Getting my words back. Thank you!

@am3000

This comment has been minimized.

am3000 commented Nov 1, 2018

I´m having this bug with PHP 7.29
super_globals = false worked
But I want to see the super_globals
Will this bug be fixed soon?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment