This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cannot subscript something of type <data variable, no debug info>


hmmm... Okay, if you tried SuSE 9 (which is what I'm using, though I've
upgraded the kernel to 2.6.7), and you don't see the same problem, there's
probably no point in me trying to upgrade to 3.3.4, huh?

I tried your 'break main' suggestion, and here's what I get:

$ gdb tester
GNU gdb 6.1
Copyright 2004 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 "i586-suse-linux"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) break main
Breakpoint 1 at 0x8048478: file tester.cpp, line 9.
(gdb) run
Starting program: /home/m7000/m7600/files/tester

Breakpoint 1, main () at tester.cpp:9
9          Mod[0].powered_up = 1 ;
(gdb) p Mod[0]
cannot subscript something of type `<data variable, no debug info>'
(gdb) p (S_Module) Mod[0]
No symbol "S_Module" in current context.
(gdb)

What's interesting is that I can trace past the assignment statement at line
9, and then past the printf statement, and it properly prints out the value
of the variable, but I *still* can't display it!!

Is it possible that upgrading the kernel affected anything??  That seems
unlikely, since building the kernel shouldn't change any of the compiler
libraries, I don't think??

I'm going to go ahead and send you my binary for tester; it's small enough
that there's no reason not to, I don't think.  I'll put it in bz2 format...

    Dan



----- Original Message ----- 
From: "Michael Chastain" <mec.gnu@mindspring.com>
To: <drow@false.org>; <dan@imi-test.com>
Cc: <gdb@sources.redhat.com>
Sent: Monday, August 23, 2004 14:28
Subject: Re: cannot subscript something of type <data variable, no debug
info>


> Also, I tried a SuSE 9 system with the vendor-supplied gcc and gdb:
>
>   Linux spe186 2.6.5-7.97-bigsmp #1 SMP Fri Jul 2 14:21:59 UTC 2004 i686
i686 i386 GNU/Linux
>   gcc version 3.3.3 (SuSE Linux)
>   GNU gdb 6.1
>   This GDB was configured as "i586-suse-linux"
>
> Your test program worked fine for me:
>
>   [chastain@spe186 dm]$ gdb tester
>   GNU gdb 6.1
>   Copyright 2004 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 "i586-suse-linux"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".
>
>   (gdb) print Mod[0]
>   $1 = {Stat = 0, sys_status = 0, powered_up = 0, compat = 0}
>   (gdb) print (S_Module) Mod[0]
>   $2 = {Stat = 0, sys_status = 0, powered_up = 0, compat = 0}
>
> Also try this: right after you start gdb, do "break main"
> and "run", to get to the main program.  Then print Mod[0] et cetera.
> Does that help any?
>
>

Attachment: tester.bz2
Description: Binary data


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