C++ Remote Debug

Hello,

A SDK document “remote-debug-cpp” says, C++ applications running in the CtrlX CORE can be remotely debugged. I use this debug function with ctrlX CORE virtual according to the instructional steps of the document.After successfully setting up SSH key, the host system (Ubuntu - Application dev environment) can access the remote system (Ubuntu – ctrlX CORE virtual) with the SSH connection.

But,  in VS Code when I click Termial -->  Run Task… -->Launch Remote GDB Server, the terminal shows the message below: (password is required)

And when clicking run and debug button in the VS Code with option “x64 ctrlX virt. Network Adapter (remote)”, a error windows shows:

Does anyone know how to fix it?

 

some test info:

  1. ctrlX CORE virtual uses the network adapter:192.168.1.1
  2. ctrlX WORKS version 1.20.0, sdk package version 1.20.0
  3. Snap is built in debug mode
  4. Enable the C++ codes of “#ifdef MY_DEBUG” and SIGSTOP signal

 

 

Best reply by nickH

Hi HanwenFan, 

I just tried it out myself and I was able to get it run. I followed the Remote Debugging C++ document you mentioned. 

Maybe you should try to setup the ssh public key authentification first. I did it by performing the following steps:

  1. generating a id-rsa key pair in the App Build Environment (in folder home/boschrexroth/.ssh): 
    ssh-keygen -t rsa
  2. copying the public key by hand 
    copy the public key from the App Build Environment
  3. connecting to the ctrlX CORE and creating a folder ~/.ssh and in this folder the file authorized_keys
  4. paste the public key you copied out form the App Build Environment in there

 

Then I followed the documentation to set get this running. Note: you got start the debugging several times to get it running. The only changes I had to make were in the task.json (l.110): here I had to change the name of the snap to sdk-cpp-registernode (see screenshot).

 

.vscode/tasks.json

Best regards, 

Nick

View original
4 replies