Let's say that you downloaded arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

Let's say that you downloaded arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

−

You will need to unpack it,and to run the following command instead of gdb:

+

You will need to unpack it,and to run the following command on your host computer (instead of just running gdb):

cd arm-2009q3/bin

cd arm-2009q3/bin

./arm-none-linux-gnueabi-gdb

./arm-none-linux-gnueabi-gdb

Line 30:

Line 30:

The binary name changes according to your distro settings,for me it was:

The binary name changes according to your distro settings,for me it was:

arm-angstrom-linux-gnueabi-gdb

arm-angstrom-linux-gnueabi-gdb

+

So in order to run it do:

+

./arm-angstrom-linux-gnueabi-gdb

+

==== Startup ====

==== Startup ====

To start a new application for debug, use:

To start a new application for debug, use:

Revision as of 15:21, 5 May 2010

The GNU Debugger GDB is the most common debug tool for Linux. It features most used features one can think of, including server-client debug architecture (so you run the heavy debug part on your host/pc machine), but lack some bits as checkpoint-restart during execution.

Documentation

Basic Usage

Documentation is so large that sometimes its hard to get started, so most simple tasks can be done with the following commands, but please read GDB docs as soon as possible!

Cross or not crosss

A common error while using gdb,is using the wrong gdb. In order to debug a program that runs on a target from your host you need a cross gdb,that is to say a GDB that runs on your computer but can debug the target architecture.
Such version is normally included in your toolchain/SDK or buildable if you use a build system

If you want to debug use GDB on target you can too,it's easier but has a huge drawback(amongs other) : ram usage (you can easily use too much memory and have an OOM(out of memory) )

Cross GDB

Code sourcey Linux

Let's say that you downloaded arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

You will need to unpack it,and to run the following command on your host computer (instead of just running gdb):

cd arm-2009q3/bin
./arm-none-linux-gnueabi-gdb

Openembedded

If your build system is also your debug workstation do:

bitbake gdb-cross gdbserver

And it will build a cross gdb for your host and gdbserver for your target
The resulting binaries will be found in your TMPDIR here:

/home/embedded/tmpdir/cross/armv6/bin/

replace "/home/embedded/tmpdir" by your tmpdir and armv6 by your target architecture
The binary name changes according to your distro settings,for me it was:

Shared Object Paths

Often your cross compile root is not /, so you might have to add new paths to the search list.

Unset absolute prefix:

(gdb) set solib-absolute-prefix null

Add paths to search paths:

(gdb) set solib-search-path /path1:/path2

Alternatively you can choose to set the prefix to the root of your target file system. Specially if you are doing
embedded development and already exporting your root file system from you host machine to your target machine it can
be very rewarding so simply use that as root: