[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] gdb support from gcc-cobol
From: |
Bernard Giroud |
Subject: |
Re: [open-cobol-list] gdb support from gcc-cobol |
Date: |
Mon Jun 2 23:13:05 2003 |
David Essex a écrit :
> On 02/06/03, Keisuke Nishida wrote:
>
> > ...
> > IDENTIFICATION DIVISION.
> > PROGRAM-ID. prog.
> > DATA DIVISION.
> > WORKING-STORAGE SECTION.
> > 01 G.
> > 02 X PIC X(2).
> > 02 Y PIC X(2).
> > PROCEDURE DIVISION.
> > DISPLAY Y.
> >
> > will be converted into something like this:
> >
> >int prog ()
> >{
> > ...
> > static unsigned char b_G[4];
> > static cob_field f_Y = {2, b_G + 2, &cob_alnum_attr};
> >
> > cob_display (&f_Y);
> > ...
> >}
>
> Perhaps this may be naive, but shouldn't the above be converted into a
> structure ?
>
> struct elem_G
> {
> unsigned char X[2];
> unsigned char Y[2];
> };
>
> static struct elem_G f_G;
>
> Also, Pascal has types called records and strings (not null terminated C
> type strings).
>
> Since these types are similar to COBOL types, maybe it could be used as a
> model.
>
I totally agree with David; it was easier and not dommageable
to consider these structures as besing a string of bytes, but it
is no longer true with a compiler like gcc.
We have to make it appear at least as seperate
fields like Pascal records, i.e. stabs "T" (Enumeration,
structure, or union tag), and occurs depending on as type
"C" stabs (Conformant array).
>
> PS:
> Structures may have boundary aliment problems on certain architectures,
> such as i386.
>
--
Bernard Giroud
TinyCOBOL and Gobol Developer
- Re: [open-cobol-list] gdb support from gcc-cobol, Bernard Giroud, 2003/06/01
- Re: [open-cobol-list] gdb support from gcc-cobol, Keisuke Nishida, 2003/06/02
- Re: [open-cobol-list] gdb support from gcc-cobol, David Essex, 2003/06/02
- Re: [open-cobol-list] gdb support from gcc-cobol,
Bernard Giroud <=
- Re: [open-cobol-list] gdb support from gcc-cobol, Keisuke Nishida, 2003/06/03
- Re: [open-cobol-list] gdb support from gcc-cobol, Bernard Giroud, 2003/06/03
- Re: [open-cobol-list] gdb support from gcc-cobol, Keisuke Nishida, 2003/06/04
- Re: [open-cobol-list] gdb support from gcc-cobol, Bernard Giroud, 2003/06/05
- Re: [open-cobol-list] gdb support from gcc-cobol, Keisuke Nishida, 2003/06/05