Bug 387347 - kdev-xdebug missing current-step row indicator [remote debugging]
Summary: kdev-xdebug missing current-step row indicator [remote debugging]
Status: REPORTED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (other bugs)
Version First Reported In: 5.2.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-27 09:01 UTC by Adriano Foschi
Modified: 2019-03-12 11:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Active debug session without step indicator (45.88 KB, image/png)
2017-11-27 09:01 UTC, Adriano Foschi
Details
Test environment under docker container (1.80 KB, application/gzip)
2017-11-29 10:32 UTC, Adriano Foschi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adriano Foschi 2017-11-27 09:01:45 UTC
Created attachment 109076 [details]
Active debug session without step indicator

I'm trying to remote debugging my PHP server application using kdevelop with kdev-executebrowser and kdev-xdebug plugins.

The web application configuration:

apache | localhost:8080
xdebug | localhost:9091

To reproduce the bug:

1) Configure properly executebrowser host and xdebug with path mappings.

2) Launch browser manually with parameter "&XDEBUG_SESSION_START=kdev".
I launch it manually becouse in execute-browser settings I cannot set "8080" port, it seems to accept only port 80.

3) Set a breakpoint and start debug session pressing F9

4) Do something into the browser to trigger breakpoint. It works well, the execution locks on the breakpoint.

5) Press "F10" to go on the next step. The BUG is here, the stack is updated but I cannot see the current step-row indicator (usually a green play icon).
Comment 1 Adriano Foschi 2017-11-28 10:07:26 UTC
Konsole log:

kdevplatform.shell: Can't load plugin "kdevgdb" because a factory to load the plugin could not be obtained: "Cannot load library /usr/lib/qt/plugins/kdevplatform/30/kdevgdb.so: (libokteta2gui.so.2: impossibile aprire il file oggetto condiviso: File o directory non esistente)"
kdevplatform.shell: Can't load plugin "kdevokteta" because a factory to load the plugin could not be obtained: "Cannot load library /usr/lib/qt/plugins/kdevplatform/30/kdevokteta.so: (libkasten3okteta1controllers.so.1: impossibile aprire il file oggetto condiviso: File o directory non esistente)"
kf5.kio.core: KSambaShare: Could not find smb.conf!
kdevelop.plugins.welcomepage: "Last fetch of news feed was on mar nov 28 10:49:17 2017 GMT+0100"
Error loading text-to-speech plug-in "speechd"
kdevplatform.shell: non-killable job BrowserAppJob(0x55f218aa6b30) registered - this might lead to crashes on shutdown.
kdevplatform.shell: non-killable job BrowserAppJob(0x55f217e908a0) registered - this might lead to crashes on shutdown.
launching? QUrl("http://localhost/frontend/web/index.php?r=site/login")
idekey "kdev"
"feature_get -n encoding -i 1"
"stderr -c 1 -i 2"
"stdout -c 1 -i 3"
1
1
breakpoint kind 0
"breakpoint_set -i 4 -t line -f file:///frontend/controllers/SiteController.php -n 141"
1
"run -i 5"
2
2
2
4
4
4
"stop -i 6"
5
5
5
QAbstractSocket::RemoteHostClosedError
0
0
0
idekey "kdev"
"feature_get -n encoding -i 1"
"stderr -c 1 -i 2"
"stdout -c 1 -i 3"
1
1
breakpoint kind 0
"breakpoint_set -i 4 -t line -f file:///frontend/controllers/SiteController.php -n 141"
1
"run -i 5"
2
2
2
3
3
"breakpoint_list -i 6"
3
"stack_get -i 7"
"stack_get -i 8"
idekey "kdev"
"feature_get -n encoding -i 1"
"stderr -c 1 -i 2"
"stdout -c 1 -i 3"
1
1
breakpoint kind 0
"breakpoint_set -i 4 -t line -f file:///frontend/controllers/SiteController.php -n 141"
1
"run -i 5"
2
2
2
3
3
"breakpoint_list -i 6"
3
"stack_get -i 7"
idekey "kdev"
"feature_get -n encoding -i 1"
"stderr -c 1 -i 2"
"stdout -c 1 -i 3"
1
1
breakpoint kind 0
"breakpoint_set -i 4 -t line -f file:///frontend/controllers/SiteController.php -n 141"
1
"run -i 5"
2
2
2
3
3
"breakpoint_list -i 6"
3
"stack_get -i 7"
"property_get -i 8 -n Yii::$app -d 0"
3
"<?xml version='1.0' encoding='iso-8859-1'?>\n<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" transaction_id=\"8\" reason=\"ok\" command=\"property_get\" status=\"break\">\n <error code=\"300\">\n  <message><![CDATA[can not get property]]></message>\n </error>\n</response>\n"
"can not get property"
"property_get -i 9 -n if -d 0"
3
"<?xml version='1.0' encoding='iso-8859-1'?>\n<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" transaction_id=\"9\" reason=\"ok\" command=\"property_get\" status=\"break\">\n <error code=\"300\">\n  <message><![CDATA[can not get property]]></message>\n </error>\n</response>\n"
"can not get property"
"context_names -i 10 -d 0"
"context_get -i 11 -c 0 -d 0"
"context_get -i 12 -c 1 -d 0"
"context_get -i 13 -c 2 -d 0"
has more KDevelop::Variable(0x55f217df5750)
has more KDevelop::Variable(0x55f217df2c20)
has more KDevelop::Variable(0x55f217d86ed0)
has more KDevelop::Variable(0x55f2181378c0)
has more KDevelop::Variable(0x55f218e502d0)
has more KDevelop::Variable(0x55f218e50bd0)
has more KDevelop::Variable(0x55f218e51750)
has more KDevelop::Variable(0x55f218614300)
has more KDevelop::Variable(0x55f2186146f0)
has more KDevelop::Variable(0x55f218614d80)
has more KDevelop::Variable(0x55f2186153d0)
has more KDevelop::Variable(0x55f218615a20)
has more KDevelop::Variable(0x55f218e5a930)
has more KDevelop::Variable(0x55f218e5af80)
has more KDevelop::Variable(0x55f218e5b650)
has more KDevelop::Variable(0x55f218e5bc00)
"property_get -i 14 -n else -d 0"
3
"<?xml version='1.0' encoding='iso-8859-1'?>\n<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" transaction_id=\"14\" reason=\"ok\" command=\"property_get\" status=\"break\">\n <error code=\"300\">\n  <message><![CDATA[can not get property]]></message>\n </error>\n</response>\n"
"can not get property"
"step_over -i 15"
2
2
2
3
3
"breakpoint_list -i 16"
3
"stack_get -i 17"
"context_names -i 18 -d 0"
"context_get -i 19 -c 0 -d 0"
"context_get -i 20 -c 1 -d 0"
"context_get -i 21 -c 2 -d 0"
"step_over -i 22"
2
2
2
3
3
"breakpoint_list -i 23"
3
"stack_get -i 24"
"context_names -i 25 -d 0"
"context_get -i 26 -c 0 -d 0"
"context_get -i 27 -c 1 -d 0"
"context_get -i 28 -c 2 -d 0"
"run -i 29"
2
2
2
4
4
4
"stop -i 30"
5
5
5
QAbstractSocket::RemoteHostClosedError
0
0
0
Comment 2 Sven Brauch 2017-11-28 11:07:15 UTC
Git commit 8ff83dbcb2b7c48f6bef5805d3f2478c9893fec7 by Sven Brauch.
Committed on 28/11/2017 at 11:07.
Pushed by brauch into branch 'master'.

allow configuring port as well

M  +4    -1    browserappconfig.cpp
M  +28   -11   browserappconfig.ui
M  +2    -0    executebrowserplugin.cpp
M  +1    -0    executebrowserplugin.h

https://commits.kde.org/kdev-executebrowser/8ff83dbcb2b7c48f6bef5805d3f2478c9893fec7
Comment 3 Sven Brauch 2017-11-28 11:07:39 UTC
For the record, I tried this yesterday, and I cannot reproduce the issue. Can you try if it happens for you when debugging C++ code as well?
Comment 4 Adriano Foschi 2017-11-28 19:05:17 UTC
I tried c++ debbuger and it works.
I tried the php xdebug setup with a local server setup as follow:

webserver: localhost:80
xdebug: localhost: 9000

And it works. It seems to be an issue with docker container or remote debugging.
Comment 5 Adriano Foschi 2017-11-28 19:09:42 UTC
I did two tests:

1) local webserver (OK)
2) docker container webserver (NOK)

I tested the debuggers with:
- the same ports (localhost:80, localhost:9000)
- the same plugins settings
- the same php file 

# executebrowser plugin settings
server: localhost
path: index.php
arguments: empty
browser: empty

# xdebug plugin settings
path_mappings: empty
xdebug.remote_host: empty
xdebug.remote_port: 9000

# xdebug php.ini snippet (the file is the same except for the parameter xdebug.remote_host that is 127.0.0.1 on local web server test instead of host machine ip address in docker container test)
xdebug.remote_enable=on
xdebug.remote_autostart=on
xdebug.remote_handler=dbgp
xdebug.remote_host=192.168.1.3
xdebug.remote_port=9000


It still doesn't work on docker container setup.
It works well as "remote debugging" with other editors/ide as vscode.

Probably I miss some configuration into plugin as path mappings?
Comment 6 Sven Brauch 2017-11-28 21:58:18 UTC
The "can not get property" looks related to me. Unfortunately I'm not at all familiar with the xdebug protocol, maybe somebody knows about this ...?
Comment 7 Adriano Foschi 2017-11-29 10:16:27 UTC
(In reply to Sven Brauch from comment #6)
> The "can not get property" looks related to me. Unfortunately I'm not at all
> familiar with the xdebug protocol, maybe somebody knows about this ...?

The "can not get property" error was related to my php script, ignore it.
Comment 8 Adriano Foschi 2017-11-29 10:32:20 UTC
Created attachment 109113 [details]
Test environment under docker container

This attachment is the test environment for remote debugging under docker (it is my real case too).
It contains:

- the docker config files usefull to setup a simple php+xdebug+apache environment into docker container.
The container exposes webserver on localhost:80 and xdebug on locahost:9000.

- config/php.ini to enable remote debugging. 
There you MUST CHANGE the xdebug.remote_host parameter with your host machine address.

- a simple index.php script with 2 lines.
You should try to debug it.

- a readme with details about the test.
You should try to debug index.php using this kdevelop that you find there.

# Browser Application launch settings:
    Server: localhost
    Port: 80
    
# XDebug launche settings:
    Path mappings: 
        Remote Path: /var/www/html, Local Path: /path/to/the/project/folder
    xdebug.remote_host: empty
    xdebug.remote_port: 9000



I executed the test under docker and local server, the output of kdevelop is the same, there is no errors:

## START LOG
launching? QUrl("http://localhost:80/")
idekey "kdev"
"feature_get -n encoding -i 1"
"stderr -c 1 -i 2"
"stdout -c 1 -i 3"
1
1
breakpoint kind 0
"breakpoint_set -i 4 -t line -f file:///index.php -n 3"
1
"run -i 5"
2
2
2
3
3
"breakpoint_list -i 6"
3
"stack_get -i 7"
"stack_get -i 8"
### END LOG


It works under docker with other IDEs. 
I suspect that there is a bug ONLY in remote debugging mode.
Comment 9 Nicholas 2019-03-12 11:03:56 UTC
I may have the same issue, where the debugging works - but the GUI doesn't show the line with remote debugging.

I worked around my issue by adding trailing slashes to the paths in the directory map i.e.
/var/www/html => /home/nicholas/someProject
to
/var/www/html/ => /home/nicholas/someProject/