|
From: David E. <de...@us...> - 2005-06-08 22:42:05
|
ravi wrote: > > I am unable to make good use of debugging feature. > As documented, I compile program with -g option > "htcobol -g xx.cob". > The steps are as follows: > > htcobol -g testprg.cob > gdb > file testprg > run You can also use, $gdb testprg (gdb) r First, the TC run-time library must be compiled with the '-g' option, otherwise GDB will get lost. Unfortunatly, due to the complexity (about 10 times more code) of generating GCC debug symbols (stabs) in the generated assembler code, the TC stabs generation code has not been maintained. Consequently GDB does not work very well with TC compiled programs or libraries. > One of the variable defined is ws-eof. But if I say print > ws-eof within gdb I get an error undefined symbol. > Could someone help me on this? The problem is the '-' symbol, which is allowed in COBOL, but not allowed in many other languages, such as GNU assembler. Try using a single or double quotes, that should work. print 'ws-eof' > Also how do I debug in case of call and called program. > Assume x.cob is calling y.cob how do I compile and make the > resultant binary executable? Create a make file which will do the following. htcobol -g -c x.cob htcobol -g -c y.cob gcc -g -o exe x.o y.o ... -lhtcobol ... $gdb exe You can find several examples, on how to compile main and sub-programs to create an executable, in the 'test.code' directories (try t17). |