From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29848 invoked by alias); 10 Oct 2013 08:03:18 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 29830 invoked by uid 89); 10 Oct 2013 08:03:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: co9outboundpool.messaging.microsoft.com Received: from co9ehsobe003.messaging.microsoft.com (HELO co9outboundpool.messaging.microsoft.com) (207.46.163.26) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 10 Oct 2013 08:03:16 +0000 Received: from mail3-co9-R.bigfish.com (10.236.132.227) by CO9EHSOBE031.bigfish.com (10.236.130.94) with Microsoft SMTP Server id 14.1.225.22; Thu, 10 Oct 2013 08:03:14 +0000 Received: from mail3-co9 (localhost [127.0.0.1]) by mail3-co9-R.bigfish.com (Postfix) with ESMTP id 5E8F44022B; Thu, 10 Oct 2013 08:03:14 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190;KIP:(null);UIP:(null);IPV:NLI;H:mail.freescale.net;RD:none;EFVD:NLI X-SpamScore: 5 X-BigFish: VS5(zz542Izz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h17326ah1de097h186068h8275dhz2dh2a8h839h8e2h8e3h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1b2fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1fe8h1ff5hbe9i2184m1155h) Received: from mail3-co9 (localhost.localdomain [127.0.0.1]) by mail3-co9 (MessageSwitch) id 1381392124646636_29632; Thu, 10 Oct 2013 08:02:04 +0000 (UTC) Received: from CO9EHSMHS021.bigfish.com (unknown [10.236.132.248]) by mail3-co9.bigfish.com (Postfix) with ESMTP id 44CCBC8007B; Thu, 10 Oct 2013 08:01:53 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS021.bigfish.com (10.236.130.31) with Microsoft SMTP Server (TLS) id 14.16.227.3; Thu, 10 Oct 2013 08:01:50 +0000 Received: from 039-SN2MPN1-011.039d.mgd.msft.net ([169.254.1.251]) by 039-SN1MMR1-004.039d.mgd.msft.net ([::1]) with mapi id 14.03.0158.002; Thu, 10 Oct 2013 08:01:50 +0000 From: Madan Teodor-TEMADAN1 To: Simon Sobisch , "gdb@sourceware.org" Subject: RE: Question about getting GNU Cobol work with GDB Date: Thu, 10 Oct 2013 08:03:00 -0000 Message-ID: References: <525328B4.3020405@web.de> <5255D935.30609@web.de> In-Reply-To: <5255D935.30609@web.de> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-SW-Source: 2013-10/txt/msg00040.txt.bz2 To see COBOL sources instead of generated C, you could emit #line pragma in= the generated source. That should cover setting breakpoints as well. See http://gcc.gnu.org/onlinedocs/cpp/Line-Control.html=20 Teodor Madan -----Original Message----- From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On Behalf = Of Simon Sobisch Sent: Thursday, October 10, 2013 01:31 To: gdb@sourceware.org Subject: Question about getting GNU Cobol work with GDB [posted before to gdb@gnu.org] Hi co-hackers, GNU Cobol (formerly OpenCOBOL) translates COBOL to C (compiling it with GCC= later on). 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. 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 =3D {80, b_6, &a_1}; /* output-msg */ static cob_field f_7 =3D {50, NULL, &a_1}; /* user-input */ static int HELLO_ (const int entry) // [...] unsigned char *b_7 =3D 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 =3D 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 =3D 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 ste= pping - let the programmer view/change/... COBOL variables (there is a mapping li= ke you can see above) - set breakpoints within the COBOL source We're free to add directives and other necessary stuff into the generated C= files, even performing "stuff" at runtime, if this helps. Thank you for your answers, Simon Sobisch