[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] Debugging seems not to work
From: |
Keisuke Nishida |
Subject: |
Re: [open-cobol-list] Debugging seems not to work |
Date: |
Wed Apr 3 04:28:13 2002 |
User-agent: |
Wanderlust/2.6.0 (Twist And Shout) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (UnebigoryĆmae) APEL/10.3 Emacs/21.2 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
Hi Groovy,
At Tue, 2 Apr 2002 17:20:16 +0200,
address@hidden wrote:
>
> Now for some completly different. I do have some problems in
> using a debugger, showing the steps in COBOL. Since OpenCOBOL
> compiles the statements into C, i actually only see the
> intermediate C code.
> Is there a chance to view the COBOL code, while debugging ?
There are some preliminarily code for this purpose, though
it is not completed yet.
With the patch below, line directives are activated in the
intermediate C code, and gdb will find your COBOL files if
you compile them with option `-g':
--- cobc/codegen.c.~1.244.~ Fri Mar 15 02:52:54 2002
+++ cobc/codegen.c Wed Apr 3 11:24:35 2002
@@ -109,7 +109,7 @@
{
if (x->loc.text)
{
- //output ("#line %d \"%s\"\n", x->loc.first_line, x->loc.text);
+ output ("#line %d \"%s\"\n", x->loc.first_line, x->loc.text);
output_line ("cob_source_line = %d;", x->loc.first_line);
}
}
Note that this patch does not cover all COBOL lines, and thus
not very useful yet. For now, it is better to generate C code
with option -C, compile it by using gcc with option -g, and
trace the C code.
I am going to implement better debugging support after writing
some documentation in English.
Regards,
Keisuke Nishida