I just want to send you a note that I started to integrate pascal language support inside GDB. ( I now have "Write after approval" rights in the cygwin main GDB cvs tree and I just committed 4 new files specific to pascal language).
I already mentionned several time that I have patches to add pascal support for GDB, but I never got any feedback from the GNU pascal team. (I am one of the developpers of Free Pascal Compiler, another GPL pascal compiler).
Does any of you use GDB to debug pascal code? Where annoyed by getting some "unknown type 10" error?
Currently my patches only support Free Pascal strings and I have no idea of the current support of pascal string in GNU pascal, could someone please enlight me?
Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
On 14 Jun 2000, at 16:20, Pierre Muller wrote:
I just want to send you a note that I started to integrate pascal language support inside GDB. ( I now have "Write after approval" rights in the cygwin main GDB cvs tree and I just committed 4 new files specific to pascal language).
I already mentionned several time that I have patches to add pascal support for GDB, but I never got any feedback from the GNU pascal team. (I am one of the developpers of Free Pascal Compiler, another GPL pascal compiler).
Does any of you use GDB to debug pascal code? Where annoyed by getting some "unknown type 10" error?
Currently my patches only support Free Pascal strings and I have no idea of the current support of pascal string in GNU pascal, could someone please enlight me?
I use gdb sometimes (but not to a great extent). What would you like to know about GPC strings?
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.22 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm
Currently my patches only support Free Pascal strings and I have no idea of the current support of pascal string in GNU pascal, could someone please enlight me?
I use gdb sometimes (but not to a great extent). What would you like to know about GPC strings?
Do you have a Turbo Pascal like one ? Ii.e. a 256 byte long array with the length at index zero ? (is the length stored in a single byte or not ?)
Do you use pchar and normal strings or Turbo Pascal like ? (if you use pchar, do you support #0 chars inside your pchars?)
Do you also have AnsiString support a la Delphi ?
Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
On 14 Jun 2000, at 17:51, Pierre Muller wrote:
Currently my patches only support Free Pascal strings and I have no idea of the current support of pascal string in GNU pascal, could someone please enlight me?
I use gdb sometimes (but not to a great extent). What would you like to know about GPC strings?
Do you have a Turbo Pascal like one ?
Not quite.
Ii.e. a 256 byte long array with the length at index zero ?
No. Strings can be of any length, although the declaration 'String' without specifying any length will default to a string of 255 characters.
(is the length stored in a single byte or not ?)
No. AFAIK GPC strings are implemented as (or similarly to) extended pascal schema. So there is a 'capacity' field, etc., and you have to get the length of the string by calling a function - e.g., 'Length (s)'. Index zero, as far as I can understand, does not exist. Trying to access it should generate a compile-time error.
Because strings are (like?) schema, and for other reasons, you can declare all these:
Type foo = string (512000); bar = string [1024*1024]; foobar = string; { will generate a warning and default to 255 }
In any of these cases, 'Sizeof (foo)', etc., will not be what you might normally expect. For example, with: 'var s : string [3];', 'Sizeof (s)' will be a lot bigger than 3, because 's' is internally a schema that has a number of fields.
Do you use pchar and normal strings or Turbo Pascal like ?
I am not sure that I fully understand this question. pChars exist under GPC, just as under BP/Delphi, and there are functions to manipulate them in the strings unit.
(if you use pchar, do you support #0 chars inside your pchars?)
I can't remember.
Do you also have AnsiString support a la Delphi ?
Not (yet).
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.22 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm
Pierre Muller a écrit :
I just want to send you a note that I started to integrate pascal language support inside GDB. ( I now have "Write after approval" rights in the cygwin main GDB cvs tree and I just committed 4 new files specific to pascal language).
I already mentionned several time that I have patches to add pascal support for GDB, but I never got any feedback from the GNU pascal team. (I am one of the developpers of Free Pascal Compiler, another GPL pascal compiler).
Does any of you use GDB to debug pascal code? Where annoyed by getting some "unknown type 10" error?
Currently my patches only support Free Pascal strings and I have no idea of the current support of pascal string in GNU pascal, could someone please enlight me?
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;
where Capacity is the maximum length (can vary from 1 to maxint at declaration time) length is the current length string is the actual string, starting from 1.
integer is the default integer size in gpc, i.e. 32 bits for most platforms, but not guaranteed (may be 64 bits in the future): in any case it can be safely declared as equivalent to "int" in C (gcc) for the same platform.
In fact I suppose that it is actually cardinal (identical to word), i.e. "unsigned int" in C (this doc is somewhat outdated).
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.
I wellcome you for that effort. The need to use silly C language constructs to debug pascal programs is a headache for most users of gpc: for example to have the content of a string St I usually type (in rhide) (char[])St.string nothing simpler works, and the result does not take into account the length parameter, so it stops at the first #0 character.
Maurice
On Wed, 14 Jun 2000, Pierre Muller wrote:
Hi,
I just want to send you a note that I started to integrate pascal language support inside GDB. ( I now have "Write after approval" rights in the cygwin main GDB cvs tree and I just committed 4 new files specific to pascal language).
I already mentionned several time that I have patches to add pascal support for GDB, but I never got any feedback from the GNU pascal team. (I am one of the developpers of Free Pascal Compiler, another GPL pascal compiler).
Does any of you use GDB to debug pascal code? Where annoyed by getting some "unknown type 10" error?
I am using gpc with gdb. The versions are a bit outdated: 2.0 and 4.17. However, they are working together perfectly. Strings are also accessible from the debugger. Isn't it the case with the more recent versions?
miklos
Miklos Cserzo University of Birmingham c/o School of Biosciences MRC - Bioinformatics Project Tel: +44-121-414-3037 Schools of Biosciences and Medicine Fax: +44-121-414-3982 Edgbaston, Birmingham B15 2TT E-mail: miklos@bip.bham.ac.uk United Kingdom
Does any of you use GDB to debug pascal code? Where annoyed by getting some "unknown type 10" error?
I am using gpc with gdb. The versions are a bit outdated: 2.0 and 4.17. However, they are working together perfectly. Strings are also accessible from the debugger. Isn't it the case with the more recent versions?
It is possible to view them using typecasts as Maurice Lombardi said. No the unknown type 10 refers to sets that have no correspondance in C! But as I don't know how degub info is generated for sets, this problem might not appear with GNU pascal.
Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99