HOME  NEWS  FORUM  DOWNLOAD  LINK
OpenCOBOL - an open-source COBOL compiler
Main Menu
Download
Documentation
Development
Who's Online
14 user(s) are online (5 user(s) are browsing Forum)

Members: 1
Guests: 13

tillywor, more...
Powered by
SourceForge

Xoops

Creative Commons

OpenCOBOL Forum Index
   OpenCOBOL
     debug with gdb
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
zhyuyang
Posted on: 2008/4/10 3:40
Just popping in
Joined: 2008/4/9
From:
Posts: 8
debug with gdb
Hi:

Can open-cobol debug with gdb?
I test it, but I found it uses generated C source file rather than Cobol source file for debugging.

Is it possible to trace through the cobol source code?

open-cobol version 1.1


Thank you very much :)
zhyuyang
Posted on: 2008/4/12 10:23
Just popping in
Joined: 2008/4/9
From:
Posts: 8
Re: debug with gdb
Can anyone tell me some information about this?
Can the gdb debugger trace through the cobol source code?

Thank you so much!
simrw
Posted on: 2008/4/13 18:08
Webmaster
Joined: 2005/5/31
From: Bad Soden, Germany
Posts: 776
Re: debug with gdb
No, only the C code.
Until recently, we did have #line directives
(optionally) generated. BUT, this did not work.
gdb (and other variants eg. ddd) got confused with
the #line directives referring to eg.
#line 10 "abc.cob"
after returning, gdb would complain that current line
number was out of range.
(Clearly the case with the C code, as the C line number
is way bigger)

Roger
zhyuyang
Posted on: 2008/4/14 11:41
Just popping in
Joined: 2008/4/9
From:
Posts: 8
Re: debug with gdb
That's OK.
Thanks for your reply
zhyuyang
Posted on: 2008/4/14 13:03
Just popping in
Joined: 2008/4/9
From:
Posts: 8
Re: debug with gdb


Just curious..
What are the plans to make it work? It seems that it technically possible because it works with the Fortran compiler, Isn't it?

Thanks!
simrw
Posted on: 2008/4/16 7:55
Webmaster
Joined: 2005/5/31
From: Bad Soden, Germany
Posts: 776
Re: debug with gdb
Fortran is a front-end for gcc :-)

Actually, if you use the -ftraceall compile
option in latest OC 1.1, you will get a statement
trace on stderr. And the generated C code reflects
this, so you can see it with gdb; eg.
/* roger.cob:19: SET */
cob_set_location ("roger", "roger.cob", 19, "MAIN SECTION", "MAIN PARAGRAPH", "SET");

Roger
zhyuyang
Posted on: 2008/4/19 13:00
Just popping in
Joined: 2008/4/9
From:
Posts: 8
Re: debug with gdb
OK, thank you very much :)

Jason
simrw
Posted on: 2008/4/20 4:58
Webmaster
Joined: 2005/5/31
From: Bad Soden, Germany
Posts: 776
Re: debug with gdb
Also with current OC 1.1, if you specify
"-g" and/or "-debug", the "cob_set_location" calls
will be generated. There will be no print to stderr
unless you specify "-ftraceall".

Roger
Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 
Copyright (C) 2005 The OpenCOBOL Project. All rights reserved.
Powered by Xoops2 | PHP | MySQL | Apache
ocean-net