Maurice Lombardi wrote:
from the (old) gpc info file:
The string type in gpc is something equivalent to
TYPE STRING = RECORD Capacity : integer; length : integer; string : packed array [ 1..Capacity ] of char; END;
In fact I suppose that it is actually cardinal (identical to word), i.e. "unsigned int" in C (this doc is somewhat outdated).
Indeed. The current declaration is:
type String (Capacity : Cardinal) = record Length : 0 .. Capacity; Chars : packed array [1 .. Capacity + 1] of Char end;
(We added one extra char for easy conversion to CStrings.)
Of course gpc strings can contain any number of #0 inside the actual length.
On the other hand Pchar exists, with an equivalent (but more understandable) Cstring, to enable interface with C system functions, and there are lots of conversion functions between the two, but you don't need to know for GDB interface, they are just like other functions.
Yes. There can be no #0's inside CStrings. Of course, they can be stored there -- but then they signify the end of the string, like in C...
Frank