Programmer’s Guide |
Obtaining help
Use the Linux man utility to obtain help on many of the utilities provided by the tool chain. For example to get help on the
#man
Cross Compiling Applications and Libraries
To compile a simple C application, just use the cross compiler instead of the regular compiler:
Tools Available in the Host Environment
Most of the cross compiler tools are the same as their native compiler counterparts, but with an additional prefix that specifies the target system. In the case of x86 environments, the prefix is
For example the native C compiler is gcc and the cross C compiler for Xscale in
mxscaleb-gcc.
The following cross compiler tools are provided:
ar | Manage archives (static libraries) |
as | Assembler |
|
|
c++, g++ | C++ compiler |
|
|
cpp | C preprocessor |
gcc | C compiler |
gdb | Debugger |
ld | Linker |
|
|
nm | Lists symbols from object files |
objcopy | Copies and translates object files |
|
|
objdump | Displays information about object files |
ranlib | Generates indexes to archives (static libraries) |
readelf | Displays information about ELF files |
|
|
size | Lists object file section sizes |
|
|
strings | Prints strings of printable characters from files (usually object files) |
strip | Removes symbols and sections from object files (usually debugging information) |
Debugging with GDB
First compile the program must with option
1.To debug a program called
#gdbserver 192.168.4.142:2000
This is where 2000 is the network port number on which the server waits for a connection from the client. This can be any available port number on the target. Following this are the name of the program to be debugged
Process