Skip to main content

Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

Can you please let us know what product it is that you are using, i.e. Net Express, Server Express, ACU, RM, and on what operating system you are running, i.e. Windows, Unix/Linux etc.

Thanks.


Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

I am using SERVER EXPRESS 5 on RHEL 5.5


Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

Hi, I have the same issue with NetExpress 3.0 on Windows XP.

Thanks in advance.


Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

For Net Express, there are a couple of articles in our knowledgebase on the subject.

Please look here and here.

Thanks


Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

Thank you very much, Sir Glazier.


Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

For UNIX/Linux, the Server Express documentation describes a method of using the Animator and a C debugger simultaneously.  Start here:

supportline.microfocus.com/.../sx51indx.htm

Then under "Using Server Express", click Debugging Guide.  Then under Chapter 2 "Debugging Methods", expand the subject "Mixed-Language Debugging".

The COBOL modules must be compiled to .int form.  If you regularly compile to .gnt or callable shared object or executable, remove any existing .gnt or callable shared object or executable files, and re-compile just to .int.

If the main module (the first module to be executed in the overall application) is a COBOL module, follow the instructions in the documentation, that is, start the application with

anim <program-name> mixedlangdebug

then start the C debugger in another window, specifying the PID (process id) of the running application.

If the main module is a C module, use cross-session debugging.  See the explanation of cross-session debugging in the same "Debugging Methods" chapter.  In one window, run the command:

cobanimsrv mixedlangdebug

Then in another window, start the application under the control of the C debugger.  When the flow of control enters COBOL, the animator window should appear in the first window.  The documentation explains that the user IDs of the two sessions must be the same, and the TMPDIR environment variable must be set to the same value for both the Animator process and the running program.  It explains various methods for associating the Animator process with the running program, such as using the COBANIMSRV environment variable.

If you have difficulty, don't hesitate to contact SupportLine and open a new Support Incident on this subject.


Hi everyone

In our project  there are call to c code from the cobol programs. When i do debugging of cobol programs the execution of c prorgrams is done immediately but I want to do debug the c code also.What can i do.

Thanks In advance


#debugging

In addition to the suggestions provided by Chris and Dan: in some cases, it's easier to debug COBOL and C separately. If debugging the COBOL code has led you to suspect a problem in the C code, you may want to debug just the C code. That's simpler than debugging both COBOL and C simultaneously.

On Unix/Linux platforms, you can load either your executable (if your application is compiled as an executable) or the cobrun command (if your application is int or gnt code, or compiled as a CSO) under the debugger, set a breakpoint in your C code, then run your program and let the debugger interrupt it when the C function is called.

Make sure your C sources are compiled with the -g flag (this will work whether you compile with gcc or cob), and also specify -g when you link your program.

Run "gdb program" or "gdb cobrun", depending on how you normally start your program. When gdb starts, use the "b" command to set a breakpoint in your C function. Then use the "run" command, specifying the command-line parameters you'd normally supply to your program or to the cobrun command.