Remote debug a SimpleSwitch™ package#
Using GDB#
Binaries can be remotely debugged using gdbserver. This can be setup by
modifying the SimpleSwitch™ package startup command from
/usr/bin/app_to_debug
to gdbserver :2159 /usr/bin/app_to_debug
.
You will first need to install GDB with support for multiple architectures on your system. On Debian based systems, this can be done with
$ apt install gdb-multiarch
The application can then easily be debugged from host
$ gdb-multiarch
target remote <target_ip>:2159
break main
layout asm
continue
Alternatively, the source code can be shown instead of assembly
$ dir <app_source_dir>
$ layout src
Live update in QEMU#
You may want to update an application without any deployment step. This can be
done with the debug
property of the manifest. With this functionality, an
NFS server will allow to access the apps rootfs remotely.
This NFS share can be mounted using following commands
$ mount <target_ip>:/var/lib/simpleswitch-apps/fs/apps/<app_package_name> <nfs mount point>