
14 Debugging
There are two main methods for debugging on the TS-7200: Debugging from a running
Linux OS with gdb, or from RedBoot (before the Linux kernel is executed)
14.1 Debugging with gdb
The GNU debugger is a sophisticated open source debugger. It can be used with java,
c, c++, or even Fortran. Please see the
GNU Debugger Documentation homepage
for
more information. The following quickly walks through debugging a sample helloworld
application. The source code in this example is:
int squareit(int n)
{
int x;
x = n * n;
return x;
}
main ( )
{
int i;
for (i = 0; i < 4; i++)
{
printf("number %d\t", i);
printf("number squared: %d\n", squareit(i));
}
return 0;
};
Boot to the CF card, login as root
apt-get install vim
(for a text editor)
apt-get install gdb
(ensure that the debugger is installed)
Write the above source code into helloworld.c
gcc -g -o hello helloworld.c
(compile the source with debugging symbols)
gdb ./hello
(gdb) list 1
(shows the source code)
(gdb) break 6
(sets a breakpoint at line number 6... this line would be return x; from
the squareit function)
TS-7200 User's Manual
Technologic Systems
http://www.embeddedARM.com/
31
12/2004
Summary of Contents for TS-7200
Page 1: ...TS 7200 User s Manual...