shep@ALLSPICE.LCS.MIT.EDU (Tim Shepard) (07/12/89)
I'm on a 4.3BSD Vax. I've been using gdb-2.8, I just got a copy of gdb-3.2. I discovered that I am unable to set the variable _Xdebug in the X11 library when using gdb-3.2. I was able to do this under gdb-2.8. This script below demonstrates the problem on some small source files. -Tim ---------------------script below----------------------- allspice<21>% cd /tmp allspice<22>% cat y.c #include <stdio.h> int _Ydebug; void y(a,b) int *a; int *b; { if (_Ydebug) printf("*a = %d, *b = %d\n", *a, *b); } allspice<23>% cat foo.c int main(argc,argv) int argc; char *argv[]; { int i,j; i = 0; j = 1; y(&i,&j); return 0; } allspice<24>% cc -c y.c allspice<25>% cc -g -o foo foo.c y.o allspice<26>% gdb foo GDB 2.8, Copyright (C) 1988 Free Software Foundation, Inc. There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details. GDB is free software and you are welcome to distribute copies of it under certain conditions; type "info copying" to see the conditions. Reading symbol data from /tmp/foo...done. Type "help" for a list of commands. (gdb) break main Breakpoint 1 at 0x58: file foo.c, line 7. (gdb) run Starting program: /tmp/foo Bpt 1, main (argc=1, argv=(char **) 0x7fffe800, 2147477512) (foo.c line 7) 7 i = 0; (gdb) print _Ydebug $1 = 0 '\000' (gdb) set _Ydebug=1 (gdb) cont Continuing. *a = 0, *b = 1 Program exited normally. (gdb) quit allspice<27>% gdb-3.2 foo GDB 3.2, Copyright (C) 1988 Free Software Foundation, Inc. There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details. GDB is free software and you are welcome to distribute copies of it under certain conditions; type "info copying" to see the conditions. Reading symbol data from /tmp/foo...done. Type "help" for a list of commands. (gdb) break main Reading in symbols for foo.c...done. Breakpoint 1 at 0x58: file foo.c, line 7. (gdb) run Starting program: /tmp/foo Bpt 1, main (argc=1, argv=(char **) 0x7fffe800, 2147477512) (foo.c line 7) 7 i = 0; (gdb) print _Ydebug $1 = {int ()} 0x15c4 (gdb) set _Ydebug=1 Invalid cast. (gdb) cont Continuing. Program exited normally. (gdb) quit allspice<28>% ------------------------end-of-script----------------------