Moxa Technologies 331 User Manual Page 61

  • Download
  • Add to my manuals
  • Print
  • Page
    / 69
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 60
Moxa C Programmable RTU Controllers Tool Chains for Application Development
5-3
Moxa provides cross compiler tools for the following native compilers. Simply add the arm-linux-” prefix.
ar Manages 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)
On-Line Debugging with GDB
The tool chain also provides an on-line debugging mechanism to help you develop your program. Before
starting a debugging session, add the option -ggdb when you compile the program. A debugging session runs
on a client-server architecture on which the server gdbserver is installed on the target system and the client
ddd is installed on the host computer. In the following instructions, we assume that you have uploaded a
program named hello-debug to the target system and wish to debug this program.
1. Log on to the target system and run the debugging server program.
#gdbserver 192.168.4.142:2000 hello-debug
Process hello-debug created; pid=38
This tells the debugging server to listen for connections on network port 2000 of the network interface
192.168.4.142 of the target system. The name of the program to be debugged is indicated after the
network port. Additional arguments can be added after the program name as needed.
2. In the host computer, switch to the directory that contains the program source.
cd /my_work_directory/myfilesystem/testprograms
3. Execute the client program.
#ddd --debugger arm-linux-gdb hello-debug &
4. Enter the following command at the GDB, ddd command prompt.
>> target remote 192.168.4.142:2000
The command produces a line of output on the target system console, similar to the following.
Remote debugging using 192.168.4.99:2000
192.168.4.99 is the host PC’s IP address, and 2000 is the port number. You can now begin debugging in the
host environment using the interface provided by ddd.
5. Set a break point in the main function by double clicking or entering b main on the command line.
6. Click the cont button.
Page view 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 67 68 69

Comments to this Manuals

No comments