gnucobol-users
[Top][All Lists]
Advanced

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

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


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

Jeff Chimene wrote:
> ...
The problem statement: "How can I use gdb to examine a COBOL identifier's value and attributes?" ... I'd like to propose the same thing for OC. gdb supports syntax like:

* call cob_literal_describe('processing-flag')
* call cob_identifier_describe('months(1)')
* call cob_identifier_print('months(2)')

There are at least two ways (and possibly more) to implement such routines:

* Extend the compiler to produce symbol cross-reference and
  descriptor information in a private format. Write C routines to
  read this table at run-time.
* Extend the compiler to produce symbol cross-reference and
  descriptor information in Dwarf format. Use libdwarf to produce
  this file at compile-time and consume this file at run-time. I
  call this a "shadow" file because it would augment debugging
  information written by the C compiler. Using libdwarf has the
  advantage of not reinventing the wheel.

If I understand this method correctly, you are suggesting adding debugging information (function calls) to the C code, and syncing it to the COBOL code.

More or less the way GCC adds debugging information (stabs) to the assembler code.

Yes, I think this method could work, in theory.
However, I think further research would be required to ensure that all of COBOL's features (ex: PERFORM statement) would work with this method.

Certainly no small task, me thinks.

Cheers.


reply via email to

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