Dear Community User! We are updating our platform to a new system.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

C++ Remote Debug

C++ Remote Debug

HanwenFan
Member

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.

HanwenFan_0-1682499028860.png

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

HanwenFan_1-1682499062729.png

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

HanwenFan_2-1682499135798.png

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

 

 

4 REPLIES 4

nickH
Community Moderator
Community Moderator

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 Environmentcopy 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.vscode/tasks.json

2023-04-28_10h54_29.png

Best regards, 

Nick

Hi, nickH

As you mentioned, the problem is that the snap name in the task.json should be changed to 'sdk-cpp-registernode'. After changing it, it works. Thanks!

By the way, can we remotely debug the rt snaps in this way? 

nickH
Community Moderator
Community Moderator

Yes, this should be also possible for RT-Bundles. But we have currently no manual for this. 

The R&D is currently looking at this and will provide something in the next release. 

OK, I got it .😀

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist