question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variables and stacktrace are not shown

See original GitHub issue

I recently observed, that php-debug for atom stopped showing variables and stacktrace, though working. It successfully connects to xdebug server, and breakpoints are working. But I can’t see any useful output. I tested xdebug with another client - and it worked fine, showing everything I needed. An error appears in the developer console in Atom at the moment, when the actual trace should be displayed. Here it is:

dbgp-instance.coffee:66 Error: Invalid attribute name
Line: 1
Column: 306672
Char: "
    at error (/home/eugen/.atom/packages/php-debug/node_modules/sax/lib/sax.js:667:10)
    at strictFail (/home/eugen/.atom/packages/php-debug/node_modules/sax/lib/sax.js:693:7)
    at Object.write (/home/eugen/.atom/packages/php-debug/node_modules/sax/lib/sax.js:1413:13)
    at Parser.exports.Parser.Parser.parseString (/home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:508:31)
    at Parser.parseString (/home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:7:59)
    at exports.parseString (/home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:540:19)
    at DbgpInstance.module.exports.DbgpInstance.parse (/home/eugen/.atom/packages/php-debug/lib/engines/dbgp/dbgp-instance.coffee:64:15)
    at DbgpInstance.parse (/home/eugen/.atom/packages/php-debug/lib/engines/dbgp/dbgp-instance.coffee:1:1)
    at DbgpInstance.module.exports.DbgpInstance.stuff (/home/eugen/.atom/packages/php-debug/lib/engines/dbgp/dbgp-instance.coffee:89:26)
    at Socket.<anonymous> (/home/eugen/.atom/packages/php-debug/lib/engines/dbgp/dbgp-instance.coffee:1:1)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:531:20)
(anonymous function) @ dbgp-instance.coffee:66
(anonymous function) @ /home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:493
emitOne @ events.js:90
emit @ events.js:182
(anonymous function) @ /home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:311
emit @ /home/eugen/.atom/packages/php-debug/node_modules/sax/lib/sax.js:640
error @ /home/eugen/.atom/packages/php-debug/node_modules/sax/lib/sax.js:669
strictFail @ /home/eugen/.atom/packages/php-debug/node_modules/sax/lib/sax.js:693
write @ /home/eugen/.atom/packages/php-debug/node_modules/sax/lib/sax.js:1413
exports.Parser.Parser.parseString @ /home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:508
(anonymous function) @ /home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:7
exports.parseString @ /home/eugen/.atom/packages/php-debug/node_modules/xml2js/lib/xml2js.js:540
module.exports.DbgpInstance.parse @ dbgp-instance.coffee:64
(anonymous function) @ dbgp-instance.coffee:1
module.exports.DbgpInstance.stuff @ dbgp-instance.coffee:89
(anonymous function) @ dbgp-instance.coffee:1
emitOne @ events.js:90
emit @ events.js:182
readableAddChunk @ _stream_readable.js:153
Readable.push @ _stream_readable.js:111
onread @ net.js:531

Also, here is my xdebug config:

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true

Everything else in xdebug is set by default.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
zmorriscommented, Jan 15, 2017

SOLVED

The problem is due to case sensitivity.

Mac OS X 10.11.6 (15G1212) 1.13.0 x64 php-debug 0.2.4

  1. Setting a breakpoint in app/Http/routes.php and reloading works but stack is not shown
  2. Setting a breakpoint in Public/index.php works but…
  3. …debugger opens in public/index.php (which is not found by Atom when I right click in the file and choose “Reveal in Tree View”). Variable stack now works
  4. Variable stack still shown when continuing to old breakpoint in app/Http/routes.php but variable stack is stale (showing $test as 2 instead of $test as 1)

screen shot 2017-01-15 at 3 58 46 pm screen shot 2017-01-15 at 3 58 59 pm screen shot 2017-01-15 at 3 59 11 pm screen shot 2017-01-15 at 3 59 17 pm

The issue seems to be that php-debug isn’t recognizing paths like Public/index.php but is recognizing paths like public/index.php. These paths are the same on both my local Mac OS X and remote Vagrant Debian Jessie so I don’t know why it’s not recognizing them. I also don’t know why it can map Public to public but not Http to http.

This problem has cost me countless hours of frustration, but I’m not pointing any fingers, I’m just glad it’s over. My personal preference is that case-insensitivity is a very good thing in the daily workflow of humans but that developers almost never check if the filesystem is case-sensitive as they do their string comparisons. Hope this helps you get this fixed.

0reactions
mattkattcommented, May 15, 2018

Currently still experiencing this bug with a fresh install of Atom 1.26.1 and php-debug 0.3.4. php-debug will work for about half a dozen runs, then will stop working for a while. Removing and reinstalling fixes the issue for a time, as does restarting my entire machine (but not closing Atom and restarting my VM)

NB: Working on a windows machine, and path names definitely have uppercase letters in them

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eclipse prints stack trace but doesn't show variables. Bug?
In Eclipse, when having set a breakpoint at that exception, I only get a stack trace in console, but no variables are seen...
Read more >
Variables and stack trace panes disappeared
I'm running 10.5.2. When running JUnit tests, with the Debug button pressed I have only Watches and Debugger tabs.
Read more >
Stacktrace is not shown when errors in module level variables
Due to design constraints, source files of module level variables could not be retrieved from generated classes (module level variables are ...
Read more >
Documentation » Stack Traces - Xdebug
Variables in Stack Traces ... By default Xdebug will now show variable information in the stack traces that it produces. Variable information can...
Read more >
Showing Variables Using the Windows Debugging API
If we compile the example program with no optimising and with debug symbols ("/Zi") from the command line then, with the stackTrace function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found