-
Notifications
You must be signed in to change notification settings - Fork 17
Tutorial : How to debug a remote application ?
This tutorial describes how to debug a remote application using a Buildroot toolchain in Eclipse.
The first step will be to create a launch configuration, if you already run the execution you can use the same launcher for debugging. Else have a look to the How to execute a remote application tutorial ? to see the way to create a new launch configuration.
As a preliminary step, you also need to ensure that gdbserver
is present on your target and that your toolchain provides a cross-debugger.
- If you use the
Buildroot toolchain
toolchain type, enable the following options:-
Toolchain
->Build gdb server for the Target
-
Toolchain
->Build gdb for the Host
-
- If you use the
External toolchain
toolchain type, enable the following option:-
Toolchain
->Copy gdb server to the Target
. - Note that this assumes your external toolchain already comes with a pre-built
cross-gdb
andgdbserver
, which is usually the case.
-
- If you use the
Crosstool-NG toolchain
toolchain type, enable the following options:-
Toolchain
->Build gdb server for the Target
-
Toolchain
->Build gdb for the Host
-
Also, in order to get a nice debugging experience, you may want Buildroot to build the libraries with debugging symbols. To do so, enable the Build options
-> build packages with debugging symbols
option.
From the editor you can double click on the left side to add a breakpoint :
or still on the left side of the editor by right clicking, a Add breakpoint
context menu appears :
Click on the debug button in the toolbar and select the launcher you defined :
Eclipse switched automatically to the Debug
perspective :
Click on the Resume
toolbar button :
The debugger stops on the breakpoint you defined :
You can see directly from the code the actual value associated to a variable just by hovering it with the mouse.
If you run again, you will see the variable values changing from the Variables
view :