How do I print or change a GNAT Ada string value in my
An unconstrained string is represented as
a record with two components.
The first is a pointer to the string (which is not null-terminated) and
the second is a pointer to another record which contains the bounds
of the string.
Version 3.1.8 of the "apc" tool
recognizes this special type and displays
it appropriately, if debug information is available. Since its length is
known, ap_StringValue is not used.
// log the input parameter then stub the routine itself
log("qualify_name called with: ", $1);
In the absence of debug information
(e.g., for Ada.Text_IO.Put_Line), or
when you want to assign to an unconstrained string, you can use macros
defined in gnatstrings.h, first included in Aprobe 3.1.7. For example:
// return what we want to: