[Prev][Next][Index]

Re: problem with insertStatementAfter(SgStatement &s);



You wrote:

It looks the insertStatementAfter() is confused with end of a loop  
right before
the end of a program. I applied the simple instrumentation program on  
the 

following test fortran program:
          program test
          integer a(20)
          do 10 i = 1, 20
            a(i) = i
10        continue
          end

and got output:
         program test
         call exit_event(3)           //This shouold not be here !
         integer  a(20)
         call entry_event(0)
         call loop_entry_event(1)
         do  i = 1,20
            a(i) = i
         enddo
         call loop_exit_event(2)
         end

I traced the instrumenter, found that it knows the correct line  
number for
statement "10    continue" right before it performs an  
s->insertStmtAfter(*c).
Then I modified the test program by adding "i=i+1" before the "end",  
the 

instrumenter worked OK.

Any idea about it ?
_____________________

Without seeing the source code for the "instrumenter", I can't really  
help you. Clearly the undesirable statement:
call exit_event(3)
gets inserted somehow. I have not had any problems with the  
insertStatementAfter(SgStatement &s) method -- I doubt if that is the  
real problem. Any chance you could come up with a short program that  
illustrates the problem you have. If I could look at the source code,  
I might be able to help.   --Beata