Deploying and Debugging Your Application on a Remote Linux Machine
NOTE:The following can be skipped if you plan to use your Linux build system to also run and debug your Linux IoT application.
Run your application on a remote Linux system using the CLI
NOTE:Thescpcommand is generally distributed as part of thesshcollection of tools on Linux systems, and is usually pre-installed. Likewise, thesshandscpcommands are pre-installed on macOS systems. The OpenSSH version of these tools is pre-installed on Windows 10 version 1809 and later, as well as being present in most WSL (Windows Subsystem for Linux) Linux command-line environments on the latest versions of Windows 10.
- Enablesshdon the remote Linux IoT target system.
- Install any shared libraries needed by your application onto the remote target.
- Copy the application binaries to the remote using thescpcommand.
- Use ansshsession to the remote to start your application on the target.
- Remember tochmod 755your application after thescpto your target.
Debug your application on a remote Linux system at the CLI
- sshinto your remote Linux target (establish a remote shell)
- gdb <app-name>in your remote shell to start debugging your remote application
- interact withgdbin your remote shell
- $ sshinto your remote Linux target (establish a remote shell)
- $ gdbserver --once :2345 <app-name>in your remote shell to start a remote debug session
- $ gdb <app-name>in your local shell to start a localgdbsession
- (gdb) target remote <target-ip-addr>:2345in your local shell to connect to your remote session
- interact with thegdbdebugger in your local shell
IMPORTANT:Ensure that your remotegdbserverand localgdbare the same version.
NOTE:The instructions above assume you are using the standardgdbthat is part of your Linux distribution. The oneAPI Base Toolkit includes an enhancedgdbdebugger calledgdb-oneapi. This enhanced version of the debugger adds support for registers and instructions that are unique to Intel processors, as well as support for debugging DPC++ GPU applications. For details see Getting Started with the Intel Distribution for GDB.