Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

Does vscode and eclipse not support remote connection debugging with gdbserver --multi start

liu_wei67
Beginner
1,760 Views

hi:

I used vscode and eclipse to try remote debugging, when I started with gdbserver --multi, both vscode and eclipsep configured remote connection to gdbserver for remote debugging didn't work, it reported the following error, I googled it, there is no relevant answer that can really solve this problem. So I want to know clearly if this kind of remote debugging with --multi is not supported on both vocode and eclipse, and if there is a solution, please tell me how to solve this problem.

liu_wei67_0-1655209566093.png

 

 

 

vscode and eclipse configuration gdb are normal configuration,

vscode remote debugging configuration in intel official website has related documents,

https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html 

eclipse debugging configuration in another post I posted

https://community.intel.com/t5/Intel-C-Compiler/eclipse-ide-use-intel-gdb-oneapi-debugger-error/m-p/1392247#M40066 

Thanks

Labels (4)
0 Kudos
7 Replies
SantoshY_Intel
Moderator
1,737 Views

Hi,

 

Thank you for posting in Intel Communities.

 

Could you please provide us with the below details to investigate more on your issue?

  1. Operating System details.
  2. Eclipse IDE & VS Code version.
  3. Steps to reproduce ur issue using VScode & Eclipse.
  4. Are you working on a C++ or DPC++ application? if possible could you provide us with a sample reproducer code?
  5. the version of C++/DPC++ compilers you are using.

 

Thanks & Regards,

Santosh

 

 

0 Kudos
liu_wei67
Beginner
1,723 Views

hi:

1. OS: Centos OS 8.3

2. Eclipse IDE: 4.20

2.1. VS:1.65.1

3.1 Re-step with vscode

First you need to prepare 2 servers,like c1 and c2, and all install oneapi toolkit, installation directory /opt/intel/oneapi

you need to install the plugin Remote-SSH in VScode,

then to settings Remote-SSH,  and connect to c2
Configure the remote linux target to run the oneAPI development environment script (setvars.sh) when VS Code starts the remote connection,
Add the following code to /etc/profile
>>> vi /etc/profile
if [ -z "$SSH_TTY" ] && [ -n "$SSH_CLIENT" ]; then
. /opt/intel/oneapi/setvars.sh &> /dev/null
fi

After connecting to the remote, there should be a new window at this point that
Then search for Extension Pack for Intel(R) oneAPI Toolkits and C/C++ extension plugins in the New Window Plugin Marketplace and install
After installation, follow the prompts to configure the oneapi environment
ctrl+Shift+p, type oneapi, select Intel oneAPI: Initalize default environment variables, click Continue

 

The above vscode configuration for remote debugging is pretty much the same as the documentation given on the official Intel website

https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top/ssh-development-top/ssh-development.html 

 

3.2 Re-step with eclipse

you can follow this to settings eclipse

 https://community.intel.com/t5/Intel-C-Compiler/eclipse-ide-use-intel-gdb-oneapi-debugger-error/m-p/1392247#M40066 

liu_wei67_7-1655348509498.pngliu_wei67_8-1655348518163.pngliu_wei67_9-1655348533286.png

 

 

When configured, for vscode, use the following launch.json file, and you should change the key miDebuggerServerAddress value ,like you start gdbserver's remote server. and key program value if you use my program, you do not to modify it

liu_wei67_0-1655345725236.png

 

Now I should go start the gdbserver on c1

>>>gdbserver --multi  :23456

liu_wei67_1-1655346265306.png

 

Then click Debug to run,

liu_wei67_2-1655346608493.png

Then you will be prompted with the following error message

liu_wei67_3-1655346868122.png

 

eclipse is also the same problem,Because the problem of my OS may not support the use of gdb-oneapi in eclipse, so I temporarily use the native gdb to debug, but also agreed to report the following problems, i think gdb-oneapi also has this problem.

liu_wei67_5-1655348139883.png

 

 

VScode for my project directory is roughly as follows 

liu_wei67_4-1655347061959.png

 

eclise for my project directory is roughly as follows

liu_wei67_6-1655348474202.png

 compiler version

liu_wei67_0-1655348829474.png

 

I think this problem should be unlikely to be related to the version, I think maybe at present vscode and eclipse do not support the way to remote debugging with --multi start, so please help to look at this problem, thank you very much.

Thanks

0 Kudos
SantoshY_Intel
Moderator
1,692 Views

Hi,


Thanks for providing the details.


We can see that you are using an unsupported version of the Operating System. We recommend you to try on any one of the supported Operating Systems and if you still face any issues please get back to us.


To check the supported OS, please refer to the below link:

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-dpcpp-system-requirements.html


Thanks & Regards,

Santosh


0 Kudos
liu_wei67
Beginner
1,655 Views

hi:

I changed the OS operating system, but still have this problem

oneapi debugger: 2021.6.0

liu_wei67_0-1655692872228.png

liu_wei67_1-1655692920924.png

 

0 Kudos
SantoshY_Intel
Moderator
1,627 Views

Hi,

 

>>"When configured, for vscode, use the following launch.json file, and you should change the key miDebuggerServerAddress value"

In the remote machine(C2), what is the value of miDebuggerServerAddress? Is it the IP address of the local or remote machine(C1 or C2)?

 

>>"Now I should go start the gdbserver on c1"

Could you please share with us the URL referring to the remote debugging using gdbserver (with --multi option)?

 

Are you trying to launch the gdbserver on the host machine(C1)?

Are you using a mounted working directory that is common to both local & remote machines?

 

Could you please try launching the gdbserver on the remote machine(C2) & start debugging using the local machine(C1).

 

Thanks & Regards,

Santosh

 

0 Kudos
liu_wei67
Beginner
1,615 Views

Hi:

>> In the remote machine (C2), what is the value of miDebuggerServerAddress? Is it the IP address of the local machine or the remote machine (C1 or C2)?

c2 is the server I connect to remotely using vscode, c1 is the server where I start gdbserver --multi

So the value of miDebuggerServerAddress is the ip of c1 and the port you specify to start the gdbserver

Assuming c1's ip is 10.0.0.200

liu_wei67_0-1655803127142.png

So the vscode launch.json miDebuggerServerAddress should look like this 

liu_wei67_1-1655803439207.png

 

>> Can you talk to us about the URL for remote debugging with gdbserver (share the --multi option)? 

Here's an example, you can find the --multi in the photo

https://www.thegeekstuff.com/2014/04/gdbserver-example/ 

liu_wei67_3-1655805468951.png

Because the most appropriate way to start debugging for my project is to use gdb -- multi, using non-multi to start debugging will not cause the above problem.

 

>>> Did you try to start gdbserver on the host (C1)?

Yes.

>>> Do you have to use a common mount working directory for local and remote machines?

Yes, I am using a cluster, c1 and c2 /opt/intel/oneapi are shared directories

 

>> You can start gdbserver on the remote machine (C2) and use the local machine (C1) to start debugging.

The problem is that if you use tools, and vscode, for your debugging and gdbserver to start with -multi, you will now run into this problem. If you don't use eclipse and vscode, and just use xshell or something in the background to connect to the server to start gdbserver and connect to debug, there is no problem.

So even if I use the tool vscode to connect remotely to c1 and then start the gdbserver --multi, launch.json file on the c2 server to configure this ip and port for c2 and run it, I still have the problem.

 

Here is some information I found, you can refer to

https://github.com/Microsoft/vscode-cpptools/issues/78

 

Thanks

 

0 Kudos
Klaus-Dieter_O_Intel
1,397 Views

Please try the following in your launch.json file


Remove (or comment out) the miDebuggerServerAddress entry.

Insert a line for debugger arguments:

"miDebuggerArgs": "-ex 'target extended-remote c2:23456' -ex 'set remote exec-file ${workspaceFolder}/matmul'",


0 Kudos
Reply