Oct 6

During my search on how to debug the applications on the FB, I found a very interesting feature of ssh in order to execute gdbserber on a remote target. Normally executing such an application would require:

  • open a secure shell using ssh root@FOXBoard
  • navigate to the folder
  • start gdbserver using gdbserver :1234 MyProgram
  • when it finishes, closing the terminal would require the exit command

All this can also be done using a “non-documented” feature of ssh to enter the command to execute directly after the target between colons.

  • ssh root@FOXBoard ‘gdbserver :1234 /mnt/flash/bin/HelloWorld/MyProgram’

This opens the shell, logs on, start gdbserver in the right location with the right program and logs off when the application finishes. It does not only work for starting gdbserver, any remote command can be placed between the colons, e.g ssh root@FOXBoard ‘rm /mnt/flash/bin/HelloWorld/MyProgram’ will remove the application.

This is perfect in order to be used in a makefile for remote maintenance in combination with preventing the password to be given after every secure command.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.