In gdb 5.0, the C expression a->f does not behave well when a is an array.
For instance, in the following example it does have a value but not type:

zeus: ~/test> cat >array1.c
struct { int f,g;} a[1] = {{1,2}};
int main() { return a->f; }
zeus: ~/test> gcc -g array1.c
zeus: ~/test> gdb a.out
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) print a->f
$1 = 1
(gdb) ptype a->f
Type struct {...} [1] is not a structure or union type.

Best regards,
--
[EMAIL PROTECTED] Stockholm Sweden +46-8-6176818 www.prover.com



_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb

Reply via email to