Raspberry Pi: gdb debugging in Eclipse

If you want to do gdb debugging on command line – see Raspberry Pi: gdb debugging, command line.

In case you are interested how to debug Dart command line applications in IntelliJ – see Raspberry Pi: How to remote debug Dart command line applications in IntelliJ.

Environment
  • Ubuntu 16.04 LTS
  • Eclipse Neon.3 Release 4.6.3
  • arm-linux-gnueabihf (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  • Raspberry Pi 3 Model B

Based on this and this GuruCoding pages.

ARM toolchain

See Raspberry Pi: cross-compiling blog.

Install Eclipse IDE for C/C++ developers

Download and install from here.

Create and compile an example project

See Raspberry Pi: cross-compiling in Eclipse blog.

Set up remote access in Eclipse
  • Window > Perspective > Open perspective > Other > Remote System Explorer
  • File > New > Other > Remote System Explorer > Connection
  • Select Remote System Type:
    • Linux
    • Next
  • Remote System Connection:
    • Host name: raspberry-pi
    • Connection name: raspberry-pi
    • Next
  • Files:
    • Configuration: ssh.files
    • Next
  • Processes
    • Configuration: processes-shell-linux
    • Next
  • Shells:
    • Configuration: ssh-shells
    • Next
  • Ssh Terminals:
    • Configuration: ssh.terminals
    • Finish
  • Right click created connection > Properties
    • Host > Default User Id: pi
Create project

In Eclipse:

  • File > New > C++ Project
  • C++ Project
    • Project name: helloworld
    • Project type: Hello World C++ Project
    • Toolchains: Cross GCC
    • Next
  • Basic Settings
    • Hello world greeting: Hello world!
    • Next
  • Select Configurations
    • Next
  • Cross GCC Command
    • Cross compiler prefix: arm-linux-gnueabihf-
    • Cross compiler path: /usr/sbin
    • Finish
  • Right-click project name > Properties > C/C++ Settings
    • Tool Settings > Cross Settings
      • Prefix: arm-linux-gnueabihf-
      • Path: /usr/sbin
  • Project > Build All

Leave a Reply

Your email address will not be published. Required fields are marked *