Home
Packages: LIBDB CVS
Use: Debug
How could I debug my COBOL programs with TinyCOBOL?
To debug a COBOL program generated by TinyCOBOL, you will need of use the
switch "-g" during the compilation and after, use gdb to debug the program.
htcobol -g programname.cob
gdb programname
How could I use GDB?
In first hand, you should learn GDB. Does exist a lot of tutorials and books in
the internet.
BTW, It's not so hard to learn:
- Run GDB with the command "gdb".
- Type "file" to open the binary file generated by TinyCOBOL.
- Type "list" to gdb provide for you a list of your COBOL program.
- Type "next" or "n" to go for the next lines of the program.
- To create breakpoints, type "b (n)", where (n) is the line number. To run
into the cursor, type "run" or "r"
- To see the program variables, type "print variable-name", where
variable-name is the name of variable.