TOC PREV NEXT INDEX

Put your logo here!


4.14 DEBUGGING TOOLS

4.14.1 LCU debugging, VxGDB, VxWorks source code debugger

To debug a module

· compile it without the keywords OPTIMIZE and NOOPTIMIZE (debug option) defined in your makefile and install it in INTROOT, see also man pages of vltMake
· load the binary files on your lcu
· start vxgdb and in the vxgdb command window set current working point to the module root.
· type
dir src
and
dir bin or $INTROOT/vw/bin
· type
target vxworks <lcunode> or ta vxw <lcunode>
vxgdb shall display in the command window for each module it finds debug symbols:
<mod>: OK
· now you can put breakpoints in your code, list source files, step through your code etc.

To debug routines running as functions under a command interpreter, do the following:

· compile the function with debug option set. There is no need to compile the command interpreter with debug option set.
· load the function and start the command interpreter
· attach VxGDB to the command interpreter (type
attach 0xyyyyyy
where yyyyyy is the task id, i.e. what you get when you type the command i from the VxWorks shell, of the command interpreter)
· put a breakpoint in the function to debug
· type
continue
(to let the command interpreter continue executing)
· send the command to run the function. The command interpreter now stops at the breakpoint. You can continue debugging.

To debug tasks not yet started, e.g. tasks running under the command interpreter, do the following:

· compile the task with debug option set. There is no need to compile the command
interpreter with debug option set.
· load the task and start the command interpreter
· set a breakpoint in your task with the low-level debugger from the VxWorks shell, e.g. type
b entryPoint
where entryPoint is the entry point of your task
· send the command to execute the task. When the task has started and has been trapped by the low-level debugger, attach VxGDB to the task, see above. From now on you can continue debugging with VxGDB.

4.14.2 WS debugging, gdb

gdb can be used together with emacs to provide somewhat more comfort than the pure gdb one window line mode debugger does.

To start it start emacs in the bin directory of the module you want to debug. Press F11 and enter the name of the program to debug. This will start gdb. Set a breakpoint and run your program. Two windows will be opened, one with the source listing and one gdb command window.

Due to the use of shared libraries, it is not possible, and usually not necessary, to debug the CCS code. However, if really desired, an archive version of the CCS library is available. The executable should be generated again, setting the appropriate flag for the Makefile:

- either defining MAKE_NOSHARED for the whole module,

or for each executable in the makefile, define progxx_NOSHARED = on



Quadralay Corporation
http://www.webworks.com
Voice: (512) 719-3399
Fax: (512) 719-3606
sales@webworks.com
TOC PREV NEXT INDEX