Getting Started with gdbserver: Difference between revisions
No edit summary |
No edit summary |
||
Line 52: | Line 52: | ||
This will load the binary and will display debug information. | This will load the binary and will display debug information. | ||
= Set breakpoints: = | = Set breakpoints: = | ||
Use the following command: | |||
<pre>break <LINE_NUMBER></pre> | |||
<br> This will specify an integer number at the breakpoint. | |||
= Delete break point<br> = | = Delete break point<br> = |
Revision as of 21:18, 28 June 2013
Introduction
This documentation shows how to get started with gdbserver with a basic application. When using gdb binaries need to be compiled with debug symbos.
Application and target should be working with an NFS file system. For more information about SDK and NFS file system please check:
developer.ridgerun.com/wiki/index.php/RidgeRun_Turrialba_SDK_User_Guide
Compilation process
In order to add debug symbols Autotools parameters need to specify cflags as CFLAGS="-g -O0"
AUTOTOOLS_PARAMS = LDFLAGS="-Wl,--rpath-link -Wl,$(FSDEVROOT)/usr/lib:$(FSDEVROOT)/lib" --sysconfdir=$(FSDEVROOT)/etc CFLAGS="-g -O0"
Selecting gdb server on target file system
Select gdb server on File System Configuration:
[*] Install GDB server on target file system
Compile and install on target.
Running application with gdbserver on target
Execute application with gdbserver:
gdbserver <HOST_IP>:<PORT> <APPLICATION_BINARY>
Running gdb on Host
gdb can be executed with the gdb command:
gdb
Also ddd can be used, which is basically a GUI for gdb
ddd
At debugger console (gdb or ddd) some commands need to be executed:
Specify path to system root:
set solib-absolute-prefix $(DEVDIR)/fs/fs
Specify binary to work with (binary is inside of root file system
file <PATH_TO_BIARY>
This will load the binary and will display debug information.
Set breakpoints:
Use the following command:
break <LINE_NUMBER>
This will specify an integer number at the breakpoint.
Delete break point
Use the delete command and breakpoint number
delete 2