gdb
[Top][All Lists]
Advanced

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

Re: Question for getting GNU Cobol work with GDB


From: Sergio Durigan Junior
Subject: Re: Question for getting GNU Cobol work with GDB
Date: Wed, 09 Oct 2013 18:59:31 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

On Monday, October 07 2013, Simon Sobisch wrote:

> Hi co-hackers,

Hi, there!

> GNU Cobol (formerly OpenCOBOL) translates COBOL to C (compiling it with GCC).
> We try to use GDB as debugging frontend but are unsure how some points can be 
> reached without actually patching the GDB (if it's possible at all).
> As one of the maintainers of GNU Cobol I write to you with the hope that we 
> can get as far as possible.

Thank you for your contact.  This list, however, is not the main list of
the GDB project.  I strongly suggest that you post your message to
<address@hidden>, because there is the official list for GDB users
and developers :-).

While we're at it...

> A sample is attached, snippets:
>
> HELLO.cob:
>
>               INSPECT user-input REPLACING TRAILING SPACES BY LOW-VALUE
>               MOVE SPACES TO output-msg
>               STRING 'Hello "'  DELIMITED BY SIZE
>                      user-input DELIMITED BY LOW-VALUE
>                      '"!'       DELIMITED BY SIZE
>                      INTO output-msg
>               END-STRING
>
> HELLO.c[h,l.h]
>
> static cob_field f_6  = {80, b_6, &a_1};      /* output-msg */
> static cob_field f_7  = {50, NULL, &a_1};     /* user-input */
>
> static int
> HELLO_ (const int entry)
>
>
>       // [...]
>
>         unsigned char *b_7 = NULL;    /* user-input */
>
>       // [...]
>
>         /* HELLO.cob:23: INSPECT */
>
>         cob_set_location ("HELLO", "HELLO.cob", 23, "MAIN SECTION", "MAIN 
> PARAGRAPH", "INSPECT");
>         {
>           cob_inspect_init ((f_7.data = b_7, &f_7), 1);
>           cob_inspect_start ();
>           cob_inspect_trailing (&cob_low, &cob_space);
>           cob_inspect_finish ();
>         }
>         /* HELLO.cob:24: MOVE */
>         cob_set_location ("HELLO", "HELLO.cob", 24, "MAIN SECTION", "MAIN 
> PARAGRAPH", "MOVE");
>         {
>           memset (b_6, 32, 80);
>         }
>         /* HELLO.cob:25: STRING */
>         cob_set_location ("HELLO", "HELLO.cob", 25, "MAIN SECTION", "MAIN 
> PARAGRAPH", "STRING");
>         {
>           cob_string_init (&f_6, 0);
>           cob_string_delimited (0);
>           cob_string_append (&c_3);
>           cob_string_delimited (&cob_low);
>           cob_string_append ((f_7.data = b_7, &f_7));
>           cob_string_delimited (0);
>           cob_string_append (&c_4);
>           cob_string_finish ();
>         }
>
>       // [...]
> }
>
> Not clear is how to
> - let the programmer see only the COBOL source, not the C source, while 
> stepping
> - let the programmer view/change/... COBOL variables (there is a mapping like 
> you can see above)
> - set breakpoints within the COBOL source

There's been some discussion about a related topic (IIRC it was about
ultimately making GDB able to debug Python programs, for example), but I
am not really sure.  Does GNU Cobol generate a binary directly, or only
the C translation?  If it can generate binaries, then perhaps it's
possible to make GDB debug the binaries directly, instead of trying to
do this C <-> Cobol translation inside it.  But that's just an idea, really.

Please, send your message again to the Sourceware list, and we'll
continue discussing it there :-).

Thanks!

-- 
Sergio



reply via email to

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