gwomacks / php-debug

Atom Text Editor package for PHP debugging
MIT License
119 stars 31 forks source link

0.3.3 keeps asking for path maps #285

Closed franksl closed 5 years ago

franksl commented 6 years ago

Hello, I upgraded to 0.3.3 but each time I run a debug it asks me to specify pah maps, no matter if I click on save each time. How should this options be specified to prevent the popup? Thanks, Frank

cchamplin commented 6 years ago

I would suggest trying to remove all of the PHP-Debug settings from config.cson and trying again, it's possible the setting got corrupted resulting in it prompting every time. Let me know.

franksl commented 6 years ago

I just tried but had no luck, I'm using a test webserver on localhost, I didn't have to specify any mappings on previous versions.

gregCleanSimpleDev commented 6 years ago

Having the same issue, is would be handy if there was a way to disable the Pathmaps are now configured for each project folder during connection feature and have the option to apply a default path mapping to new projects

cchamplin commented 6 years ago

Can you update to v0.3.4 and let me know if this is still an issue. If it is can you tell me if the value at the top of the path maps dialog for "Entry Point" is what you expect? Can you also provide your pathmaps value from config.cson. Thanks.

franksl commented 6 years ago

I tested v0.3.4 and these are the results:

This is my configuration actually ("/var/www/html/dev" is where index.php resides):

 "php-debug":
    MaxData: 4096
    ServerPort: 9001
    currentPanelMode: "bottom"
    noPackageInstallPrompt: [
      "ide-php"
      "atom-ide-ui"
    ]
    server:
      serverPort: 9001
    showWelcome: false
    xdebug:
      maxData: 4096
      pathMaps: "[{\"remotePath\":\"/var/www/html/dev\",\"localPath\":\"/var/www/html/dev\"}]"
gregCleanSimpleDev commented 6 years ago

@cchamplin it's working for me now, I was only asked for the path map once after updating. Cheers!

apm963 commented 6 years ago

I am having this "issue", although my setup is a bit different and I'm not sure if it's fixable. My entry point is an auto_prepend_file that is set up in my php.ini. The prepend file is located in /home and my code is /media/web_root. I am able to set up a map from my remote code path to my local directory and debugging works OK. However, every time a page is loaded I am prompted to set up a path map for /home because the prepend script is my entry point.

I temporarily got around this by hacking in the following at: https://github.com/gwomacks/php-debug/blob/d1f72f6e59f5eef938696de6289029bea82d985e/lib/engines/dbgp/debugging-context.js#L119

this._instance.setPathMap( (currentMaps.filter(v => v) || [])[0] ); return;

Which works OK for my particular situation but I'm sure this will break standard setups.

Sirfrummel commented 6 years ago

Sorry to post into the end of this but I'm new(er) to PHP and trying to setup the debugger. I had it working and then somehow it broke -- around the time it started prompting for Path Mappings. Are Path Mappings really needed if the entire project is running locally? (I'm using MAMP Pro). All I know is that I had it working for a couple minutes (was able to see variables etc), and then it broke.

I figured I would try to leave path mappings blank because I'm pretty sure it was working when I had it blank, but with it prompting it won't let me leave it blank. Can you offer any insight into this? Thanks.

Sirfrummel commented 6 years ago

I figured out my issue. It seems as part of the install, it had me install another debugging package, and basically this one debugging package doesn't tie in with php-debug. So if I go to Debugger->Toggle Breakpoint, it puts a blue breakpoint dot before the line number, and doesn't catch in code. On the other hand, I can click in the gutter after the line number to make a breakpoint dot, and this one will catch code.

AlbertPMarti commented 6 years ago

Just my two cents on this issue: I have a MacBook with MAMP and a Linux Mint Box at home with LAMP, both of them synced through a git server on a Raspberry at the office. Ever since I had to upgrade to this atom-debug-ui package debugging stopped to work. I've been struggling for days to make it work until today. First: I noticed that the problem was with my local .git folder. Delete it, and this pathmap dialog disappears and debugging works. But then I lose my git repositories, which is a no-no. Then today I tried to put the same path in Remote/Local pathmap dialog and, voilà, debugging is working again. (I tried everything before, even uninstalling & reinstalling Atom).

I still can't debug two projects at once & this debug-ui gave me nightmares with this 'debugger not attached' message, but at least now I'm able to debug (although not as before) with Atom again.

Hope this helps some of you guys.

cchamplin commented 6 years ago

@Sirfrummel you were likely interacting with the debugger for atom-ide-ui. If you are not using the debugger for atom-ide-ui for other projects I recommend you disable it from their settings.

cchamplin commented 6 years ago

@AlbertPMarti Same thing, if you're not using the atom-ide-ui debugger for other code bases I recommend you disable it, that part of the package is not compatible with PHP-Debug

Sirfrummel commented 6 years ago

@cchamplin Thank you, that helped my issue.

cchamplin commented 6 years ago

v0.3.5 has just landed and will hopefully help with some of the pathmaps issues

@apm963 you should be able to set the auto_prepend path to a "?" and it will be ignored and you will be able to set the pathmap based on breakpoints.

franksl commented 6 years ago

Hi, On my machine 0.3.5 works better, I had to add a lot of path mappings, even the mapping to the phpunit.phar I have on my pc (I use the debugger also from command line). The biggest problem actually is that debugger activates itself even when windows are closed (the relevant option ("Continue to listen...") is deactivated. I also tried disabling multiple sessions with no luck. This happens especially when I open a second Atom instance, it seems that the debugger stays always attached to the first instance. Frank

apm963 commented 6 years ago

@cchamplin Using the new "?" on the auto_prepend path in 0.3.5 worked perfectly. Thank you!