Digi 9P 9360/9750 manual Debugging applications

Page 34

D e b u g g i n g a p p l i c a t i o n s

Debugging applications

The purpose of a debugger is to allow you to see what is going on his own programs while they execute. For that purpose the GDB debugger is used by means of the gdbserver application that runs on the target side and communicates with the host computer. This communication can happen on the serial port or through Ethernet (the latter is preferred for being much faster).

The use of the GDB debugger is out of the scope of this manual. You can get more information about it in the standard GDB man pages.

In order to debug an application it has to be rebuilt with debug information. To do that, enter the target binary build directory (e.g. "apps/mem") and rebuild the application with the following command:

~/LxNETES3.2$ rm apps/mem/*.o apps/mem/mem

~/LxNETES3.2$ make apps DEBUG=1 install

A binary mem will be created and copied to the rootfs. Restart the target with the new rootfs.

Run the debug server on the target with the following commands:

#gdbserver localhost:2001 /usr/bin/mem Process /mem created; pid = 39 Listening on port 2001

Remote debugging from host 192.168.42.1 ->

Port number 2001 was selected randomly.

Now start the debug client on the host and connect to the target with

~/LxNETES3.2$ ../bin/arm-linux-gdb mem GNU gdb 6.3

Copyright 2004 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions.

There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-pc-linux-gnu --target=arm-linux- uclibc"

...

(gdb)

3 4

L x N E T E S U s e r ’ s G u i d e

Image 34
Contents LxNETES User’s Guide ConnectCore 9P 9360/9750 Page Page Page Contents Building the First Project Interfaces & Devices Appendix B Overview IntroductionCross-development environment Template project Linux kernel sourcesExample applications General features FeaturesWhat’s new in LxNETES 3.2? RTC Gpio Conventions used in this manual This is a tip. It contains useful information about a topicAcronyms and abbreviations System Requirements/Prerequisites RequirementsSystem requirements Disk space Optional but recommended componentsApplications & Services Tftp daemonNFS server JTAG-Booster N E T E S U s e r ’ s G u i d e Getting Started Connecting host PC with development boardIntroduction Minicom SeyonConnect power Seyon SettingsTest Ethernet configuration Installing LxNETES # ifconfig eth0Guided Installation Manual Installation N u a l Installation Run configure Building the Default ProjectBuilding the First Project Run make install Run makeWriting applications Application DevelopmentAdding your own applications Included example applications Using C++Display Proc/cpuinfo contents Debugging applications Choose the right architecture for your target Telnet daemon utelnetd Included pre-built applicationsShell applications busybox Web server BoaNano-X/microwindows Embedded QtUseful applications MemWriting kernel modules What is a kernel module?Kernel Development Writing your own kernel modulesBuilding and loading of kernel modules Add the module to the build environmentIncluded Kernel modules Minimal Modifying the default project Advanced TopicsD i f y i n g t h e d e Fault p r o j e c t Building a custom project Boot Boot processIntroduction ConnectCore 9P 9360/9750 Bank # 0 00000000 32 MBLinux boot methods NAND-FlashNOR Flash USBLinux boot process MMUV a n c e d T o p i c s Automating the image download Passing arguments to the kernelUpdating the Flash memory Updating a running system the easy way Updating a running system manuallyErase the Flash partition Download the new image file to RAMWrite the image to Flash Kernel BootRoot File System Updating a corrupted system using a debugger Root File System Types Download the kernel to RAM via Tftp Set bootargs to be passed to the kernelLaunch the kernel from RAM JFFS2 Copy the kernel to RAM O t F i l e S y s t e m T y p e s N E T E S U s e r ’ s G u i d e Interfaces & Devices Serial interfaceSPI interface USB host interfaceI2C interface LCD interfaceSD card interface How to set the initial system date and timeCompact flash interface Real time clock RTCPCI interface Appendix a CD contentsRelated documentation RelNotes.txt Install.shReadme.txt Docs ImagesConnectCore 9P 9750 CC9P9750 SetupConnectCore 9P 9360 CC9P9360 HardwareConnectCore 9P 9360 / ConnectCore 9P Memory layoutsFlash memory layout Sdram memory layoutTextbase N E T E S U s e r ’ s G u i d e Boot command reference Appendix BO o t c o m m a n d r e f e r e n c e Skipped CC9C CCXP270 UNC90 User keys Example A9M24x0