6

I want to run GDB on my ARM embedded board... I have referred online that we can set up GDB server and can do remote debugging but still i am missing proper steps to set up whole environment for GDB Debugging..

Can anyone please provide me a proper guidance from cross compiling GDB to running my gdb for debugging on embedded board ??

I appreciate any inputs

2
  • What OS (if any) are you running on your board? Commented Sep 24, 2014 at 6:14
  • 1
    I am running linux on my board... Commented Sep 24, 2014 at 7:04

3 Answers 3

4

Have you already looked at Buildroot? It will take care of cross-compiler and root file system. You can choose to compile host and target gdb/gdbserver, so that you'll have everything from one hand. See BR's documentation.

Sign up to request clarification or add additional context in comments.

Comments

3

I assume you have a toolchain that lets you build applications for your embedded linux platform. This should include gdb (named something like arm-linux-gdb).

Next check if linux for your board already includes gdb/gdbserver. If it does, you don't have to build anything. If it does not, configure gdb like this:

./path/to/gdb/source/configure --host=arm-linux --target=arm-linux --prefix=/path/to/installation/directory

Then make and make install. Note that --host and --target will probably match your toolchains prefix.

As part of this installation you will get gdbserver. Install it on your board.

Then use it, as explained here. It depends on your connection type (TCP, serial), but you need to run program under gdbserver on board (gdbserver binary), then run you toolchain's gdb on PC and connect to board using "target remote" command.

4 Comments

I am able to generate gdbserver and gdb for My Host PC.. Now i have installed gdbserver on my embedded and using gdb from host PC.. So now GDB has started and i am able to debug it.. I have one more query if any one can help with this.. While debugging i am getting failure on my board's tera term like Processor_create> ERROR: cannot access file XXXXX.YYY File.. What does this mean ?? Here XXXXX.YYY is one Codec library.. is this because of i have not build my codec library with -g option enabled...
No idea. But open separate question for this. No-one will see it here.
hi, how do you install gdbserver in your embedded linux? add it in the file system and run it?
Yes, of course. (you also need a working connection to your pc running gdb)
3

Remote debugging of embedded systems: GDB, as a server, must be compiled into the debugging target build in order to support connected GDB clients. When running on the client side, there must exist a copy of the target source as well as an unstripped (of symbols) version of the executable.

GCC compilation should be done with the -g flag.

On the target/server side, run with

gdbserver <port> --attach <pid> 

or

gdbserver host:<port> <program>

On the client side, run gdb and then

(gdb) target remote IP:PORT

What gdb client to run? Must be built with the right target processor in mind, for example

.../toolchain/bin/powerpc-linux-gdb core/mydaemon/src/mydaemon -x gdb-command-script

-x is a filename option

Hope this helps!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.