[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Proposed addition to OpenCOBOL: an object module g

From: David Essex
Subject: Re: [open-cobol-list] Proposed addition to OpenCOBOL: an object module generator
Date: Mon, 25 May 2009 23:30:10 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040618

Jeff Chimene wrote:

Since gdb does not understand COBOL, this may be a moot suggestion. It's certainly possible to teach gdb about COBOL, but would the FSF be interested in that?

GDB is part of the GCC (GNU Compiler Collection) tool chain and requires
debugging information, known as stabs, to functions properly.

Normally a GCC compiler will generate GNU assembler, as an intermidiate
code, before creating binary objects.
The debugging information (stabs) are generated in the GNU assembler
code (about 10X the ASM code) when the '-g' command line option is used
(ex: gcc -S -g somecode.c).

OC converts COBOL to C, which any C compiler (in theory) should be able
to compile. So even if you use GCC-C you can only debug the C code.

Some attempts have been made to backtrack (ASM->C->COBOL) with limited
success. Not an approach I would recommend.

Frankly, in the long run, it would be easier to write the C code to
convert the OC syntax tree to the GCC-4 syntax tree, and let the GCC
back-end do all the real work.
In essence creating a full GCC-COBOL compiler [1][2]. And a good place
to start would be here [3].


1) COBOL for GCC - 14. Writing a Compiler Front End
2) Writing a GCC Front End
3) OpenCOBOL - B-Wiki - GCC-COBOL

reply via email to

[Prev in Thread] Current Thread [Next in Thread]