OC Systems

Home | Contact | Advanced Search 


I have an Ada procedure that I'm stubbing out, but want to return a string value. The procedure has a declaration similar to the one below. What's the APC?

procedure Read_Foo (File : in  File_Type;
                    Item : out String;
                    Size : out Integer);

For routines like this, although the Item is an OUT parameter, GNAT implements it as if it were an IN parameter (but modifiable) since the bounds of the string must already be set. The following probe shows an example of setting these parameters:

static const char *NewString = "Aprobe string";

probe thread
  probe "read_package.read_foo"
      // Change Item:
      sprintf ((char *) $item.P_ARRAY,
      // Change Size:
      $return.size = strlen (NewString);

Aprobe Technology Overview

Schedule a web demo

Contact us