comp.lang.ada
 help / color / mirror / Atom feed
From: David Marceau <davidmarceau@sympatico.ca>
Subject: Re: strange problem.Help pleeeeeeeeeese
Date: Fri, 21 Jun 2002 03:27:45 -0400
Date: 2002-06-21T03:27:45-04:00	[thread overview]
Message-ID: <3D12D571.D6BABA29@sympatico.ca> (raw)
In-Reply-To: 14763faf.0206202132.14bb4f04@posting.google.com

Ashwath wrote:
> 
> Hello,
> I am facing a peculiar problem while testing Ada procedure.
> The procedure has a variable which is local to it and it is of type
ok a first level proc here.

> called T_REPORT.T_REPORT is a enumeration type and it contains 3
> values CORRECT,DEFINED and UNDEFINED and is defined in another generic
> package called BLACK_BOARD.Now That local variable is passed to some
> procedure which will set it to the value CORRECT.After invoking that
ok a second level proc here.
My guess is maybe your procedure parameter declaration for this second
level proc
is not "in out" for the one that you pass LOCAL_VARIABLE to.  
If it's just in, you could probably guess that it would not change.  
Fix it to "in out".

> procedure the local variable is compared as follows
ok back to the first proc you do an if. Fine.

> if LOCAL_VARIABLE /= REPORT_BDS.CORRECT then
> .....
> .....
> else
> ....
> ....
> end if;
> Note that REPROT_BDS is instantiation of the package BLACK_BOARD.
> While debugging, the execution is going to the else part.Please let me
> know what might be the problem?
So you're in gdb.
info locals on the line before entering the second level proc.
info locals after next'ing over this second level proc.
-If LOCAL_VARIABLE changed as expected then your second level proc has
an "in out" spec for your parameter that you passed LOCAL_VARIABLE
into.  
	That means the problem really is your if statement. 
-If LOCAL_VARIABLE did not change as expected then your second level
proc is the source of your problem.  
	Change the spec for the parameter to "in out".  If that's not the issue
then it's in the body of the second level procedure or even lower.

Sant� bonheur,
David Marceau



  reply	other threads:[~2002-06-21  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-21  5:32 strange problem.Help pleeeeeeeeeese Ashwath
2002-06-21  7:27 ` David Marceau [this message]
2002-06-21 11:44 ` Antonio Duran
2002-06-24 14:03 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox