https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119214

--- Comment #7 from Robert Dubner <rdubner at symas dot com> ---
Well, I did ask for suggestions.  I suppose it's not surprising I don't really
understand them.  Yet.

I should explain, a little further, the underlying problems.

This, for example, is a modified sample from one of my GDB-COBOL test cases:

0009        display "before"
0010        perform hello test before varying a from 1 by 1 until a > 3
0011                                  after   b from 1 by 1 until b > 3
0012                                  after   c from 1 by 1 until c > 3
0013        display "after"

What I want to have happen in GDB -- with a -O0 build of the cobol program --
is for the user to be able to step through the program.  So, at 0009, the
"next" command produces "before" and it stops at 0010.

At that point the user commands "next", and we see the output of the hello
paragraph twenty-seven times.  Yes, indeed, that construct iterates (a,b,c) as
(1,1,1) (1,1,2) (1,1,3) (1,2,1) (1,2,2) (1,2,3) (1,2,2)..., and executes the
"hello" paragraph for each.  And, yes, it does all that with a single COBOL
statement

And then the debugger stops at line 0013.

I managed to do this by putting a .proccall label into the assembly language at
line 10, and by putting a matching .procret label into the assembly language
near at the target location for where execution passes when all of the
conditions for completion are satisfied.

In GDB, I notice at "next_command" time that the source line number matches the
location of the .proccall, meaning that I need to set a temporary breakpoint at
the place where .proccret is.  And then I issue a "continue" instead of a
"next".  

When a breakpoint is encountered, I check to see if it is at a .procret
location, and, if so, I issue a "next", which brings execution back to the
"return" location.

I am interested in the concept of setting it up as an inlined call.

I think I will give that a shot to see what gets generated.

Failing that, I will attempt to use LABEL_DECL instead of ASM_EXPR to create
the labels.

And in any case, I am about to try eliminating the ASM_EXPR stuff in order to
eliminate this bug.

The labels are in support of GDB, and I can get to that later.

Reply via email to