Hi everyone.
My recenty build of GPC 2.1 from source produces programs that don't permit pascal variables to be examined within gdb! Since this is such an egregious problem I assume that it's peculiar to my build, but could someone please tell me?
For example: {************************************} program smalltest;
var n: integer;
begin n := 3; while n > 0 do begin writeln( 'hello'); n := n - 1; end;
end. {************************************}
I have tried compiling this with either the -g and -gstabs flag. (With --ggdb, my gpc 2.1 crashes).
-g or -gstabs both produce runnable but non-identical binaries. However, in either case, if I give `print n' within gdb, the response is `$1 = void'. I've tried this on larger programs as well, and variables of various types exhibit the same. And I get the same behavior whether using an old "stock binary" version of gdb or the newer "insight variant" version 5.2.
On the other hand, when I compile using gpc-19990118, the variables CAN be examined using both versions of gdb. (BTW, I need to move to gpc 2.1 in order to get "crt" unit functionality, which AFAICS was not available under the redhat-distributed gpc-19990118.)
With the command `objdump --stabs smalltest' I'm able to see that the type definitions produced by gpc 2.1 are quite different in form from those produced by gpc-19990118. (The order in which the C and Pascal type stabs occur is different, but I suspect that's unimportant.) For "integer", here's the comparison:
Integer:t(0,1)=r(0,1); -2147483648; 2147483647 from gpc-19990118 and Integer:t(0,65)=(0,65) from my gpc 2.1
The previous type def. is of "range" type, and defines the integer range of the type. I suspect that the completely uninformative type def's. produced by my gpc 2.1 - and all of them are like the "integer" definition shown" - is the reason that gdb can't display values.
Only other thing I could say is that I built gpc from gcc-core-2.95.2 and gpc-2.1 from http://www.gnu-pascal.de/current/. I ran configure using arguments `--enable-languages=pascal --prefix=/usr/gcc2.95.2'
I did NOT use a separate build directory, but ran configure from the directory where I had unpacked it, /usr/src/gcc-2.95.2.
Thanks for any suggestions or comments.
Bob Scher