This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc-2.95.1 & gdb-4.18: can't look at array elements?


posting to both groups because don't know if problem is gcc generating wrong
debug info or gdb wrongly interpreting the info. system is sparc-solaris-2.7.

~/tmp $ cat tmp.c
int
main()
{
        int A[2];

        A[0] = 1;
        A[1] = 2;
}
~/tmp $ gcc -gstabs tmp.c
~/tmp $ gdb a.out
GNU gdb 4.18
Copyright 1998 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 "sparc-sun-solaris2.7"...
(gdb) tb 8
Breakpoint 1 at 0x10550: file tmp.c, line 8.
(gdb) run
Starting program: /users7/philipj/tmp/a.out 
main () at tmp.c:8
8       }
(gdb) p A
$1 = {1, 2}				<<<< can see whole array ok
(gdb) p A[0]
Cannot access memory at address 0x0.	<<<< but not individual elements
(gdb) p A[1]
Cannot access memory at address 0x1.	<<<< but not individual elements
(gdb) quit
The program is running.  Exit anyway? (y or n) y

get same behaviour with -gstabs+, -gdwarf & -gdwarf-2
-- 
tubbiemafia - toddlers round a tv


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]