xdebug / vscode-php-debug

PHP Debug Adapter for Visual Studio Code 🐞⛔
MIT License
768 stars 175 forks source link

The "stopOnEntry" option does not seem to work #896

Closed lexman1958 closed 9 months ago

lexman1958 commented 1 year ago

PHP version: 8.1.12 Xdebug version: 3.2.1 VS Code extension version: 1.32.1

Your launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch built-in server and debug",
      "type": "php",
      "request": "launch",
      "runtimeArgs": ["-S", "localhost:8000", "-t", "."],
      "port": 9003,
      "serverReadyAction": {
        "action": "openExternally"
      }
    },
    {
      "name": "Debug current script in console",
      "type": "php",
      "request": "launch",
      "program": "${file}",
      "cwd": "${fileDirname}",
      "externalConsole": false,
      "port": 9003,
      "stopOnEntry": true
    },
    {
      "name": "Listen for Xdebug",
      "type": "php",
      "request": "launch",
      "port": 9003
    }
  ]
}

Xdebug php.ini config: Using XAMPP

[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
xdebug.mode=develop,debug
xdebug.start_with_request=yes

When the debug starts it does not stop on entry.

zobo commented 1 year ago

Oh top of your php file try adding xdebug_info(); and see the log messages there for clues.

lexman1958 commented 1 year ago

@zobo

Looks like nothing in the log.

xdebug

zobo commented 1 year ago

Really strange. It claims it is connected, so it should work. Try to add log: true to your launch.json configuration and then a xdebug_break(); somewhere on top of your php script.

Dom the contents of the DEBUG CONSOLE here and let's analyze.

zobo commented 9 months ago

No feedback. Reopen if this is still a problem.

lexman1958 commented 9 months ago

@zobo

I stopped using XDebug temporarily. Decided to use Kint plugin and debug the old way. Agreed. Lets keep this closed for the time being. Thank you for the follow-up.