Re: [taste-users] TASTE Wrapper Code Leading to Constraint Error

[ Thread Index | Date Index | More lists.tuxfamily.org/taste-users Archives ]


Hi Gert,

This one is very tricky, because the problem is actually due to a strange behaviour of the Ada runtime.

The code TASTE generates is correct:
procedure getParameter (id : access asn1sccParameter_ID; currentvalue : access asn1sccParameter_Value) is
begin
...

The second parameter is an output parameter, passed by reference (called from a C function which gives a pointer to a valid variable).

Because it is an output parameter, we do not initialize it with a valid value BEFORE calling this function - it would make no sense: setting a value that in any case will be overwritten would be a waste of CPU.

However, for some reasons, when in your user code you assign a value to this output parameter:

currentvalue.all := thePool(id.all);

Ada FIRST checks if currentvalue had a valid value, before trying to assign the new one. (!)

I have to say that I do not understand this. We have tried different options, like using an explicit OUT parameter instead of "access" in the function parameter but it does not help.

So because the value is not initialized with a CHOICE discriminent that is valid, the check fails and Ada raises an exception.

The only way we found around this is to explicitly disable the Ada checks at the begining of the function:

procedure getParameter (....)
 is
  pragma suppress(all_checks);   <<--- Add this to your .adb code
  begin
....

We will automate this in the code skeleton generator, unless we find a better solution. Maybe you have an idea?

In the meantime, let me know if this solves the issue... 

Best regards,
MAxime


On Wed, 30 May 2012 16:07:16 +0200, Gert Caspersen <gec@xxxxxxxxx> wrote:

                Hi Thanassis & Maxime,

 

I have now encountered a new problem with the generated TASTE code. Please see the enclosed extract from our problem database.

 

Any suggestions are highly appreciated.

 

                Regards,

 

                                Gert


Gert Caspersen
Senior Engineer, Project Manager
Space Projects (DK)
Space

Terma A/S
Vasekær 12
2730 Herlev
Denmark

T +45 8743 6000
T +45 4594 9653 (direct)
F +45 8743 6001
E gec@xxxxxxxxx
W www.terma.com


Attention:
This e-mail (and attachment(s), if any) - intended for the addressee(s) only - may contain confidential, copyright, or legally privileged information or material, and no one else is authorized to read, print, store, copy, forward, or otherwise use or disclose any part of its contents or attachment(s) in any form. If you have received this e-mail in error, please notify me by telephone or return e-mail, and delete this e-mail and attachment(s). Thank you.




--
ESA - European Space Agency

Maxime Perrotin
TASTE Project manager
PROBA V - PROBA 3 Software engineer

System, Software and Technology Department

ESTEC
Keplerlaan 1, PO Box 299
NL-2200 AG Noordiwjk, The Netherlands
maxime.perrotin@xxxxxxx | www.esa.int
+31 (0)71 565 4923 | Fax +31 (0)71 565 5420

This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its content is not permitted. If you received this message in error, please notify the sender and delete it from your system. Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/