From: "Daniel Miller \(IMI\)" <dan@imi-test.com>
To: "Daniel Jacobowitz" <drow@false.org>
Cc: <gdb@sources.redhat.com>
Subject: Re: cannot subscript something of type <data variable, no debug info>
Date: Mon, 23 Aug 2004 20:49:00 -0000 [thread overview]
Message-ID: <008d01c48952$b7e0e7b0$0401a8c0@dan> (raw)
In-Reply-To: <20040821021144.GA3321@nevyn.them.org>
My system is:
- linux 2.6.7 (running on i386, specifically P4 2.4GHz)
- g++ (GCC) 3.3.3 (SuSE Linux)
- GNU gdb 6.1
I compile the following code via
g++ -Wall -g tester.cpp -o tester
// source file
#include <stdio.h>
#include "tester.h"
S_Module Mod[1] ;
int main(void)
{
Mod[0].powered_up = 1 ;
printf("powered_up=%u\n", Mod[0].powered_up) ;
return 0;
}
// header file tester.h
typedef struct S_Module_s
{
unsigned Stat; // module status
unsigned sys_status ; // system errno
unsigned powered_up;
unsigned compat ;
} S_Module;
// } __attribute__ ((__packed__)) S_Module;
extern S_Module Mod[1];
//*****************************************************
After compiling as previously described and loading tester into gdb, I see:
(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.
//*****************************************************
Note that if I pull the header-file data into the source file, then print
can successfully access the struct. When it's in a separate header, though,
it doesn't work. Of course, my real project has 10 headers and 30-some
source files, so eliminating headers isn't practical. Is there something
else I can do to make this work?? Or should I call this a bug report??
Dan Miller
//*****************************************************
----- Original Message -----
From: "Daniel Jacobowitz" <drow@false.org>
To: "Daniel Miller (IMI)" <dan@imi-test.com>
Cc: <gdb@sources.redhat.com>
Sent: Friday, August 20, 2004 19:11
Subject: Re: cannot subscript something of type <data variable, no debug
info>
> On Fri, Aug 20, 2004 at 06:23:03PM -0700, Daniel Miller (IMI) wrote:
> > I'm trying to debug an application with gdb... I have a struct that is
> > declared thus:
> >
> > typedef struct S_Module_s
> > {
> > unsigned powered_up;
> > ... other data elements ...
> > } __attribute__ ((__packed__)) S_Module;
> >
> > extern S_Module Mod[1];
> >
> > I tried compiling both with -g and -ggdb, with no change in the
symptoms.
>
> What platform? What version of GDB?
>
> > I don't seem to be able to display any of the contents of Mod[0], at
all....
> > I get effects such as:
> >
> > (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) p (struct S_Module_s) Mod[0]
> > No struct type named S_Module_s.
> >
> > What do I have to do to get gdb to recognize my variables?? Virtually
every
> > GUI-based debugger out there is a wrapper around gdb, to if it's not
happy,
> > nobody's happy!!! Please help!!
>
> We'll need a standalone test case, or at least a dump of the debugging
> information in the application, to answer this question.
>
> --
> Daniel Jacobowitz
>
>
next prev parent reply other threads:[~2004-08-23 20:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-21 1:23 Daniel Miller (IMI)
2004-08-21 2:11 ` Daniel Jacobowitz
2004-08-23 20:49 ` Daniel Miller (IMI) [this message]
2004-08-23 21:15 ` Michael Chastain
2004-08-23 21:28 ` Michael Chastain
2004-08-23 22:30 ` Daniel Miller (IMI)
2004-08-24 2:20 ` Michael Chastain
2004-08-24 12:12 ` Michael Chastain
2004-08-24 16:25 ` Daniel Miller (IMI)
2004-08-24 16:34 ` Daniel Jacobowitz
2004-08-24 16:40 ` Daniel Miller (IMI)
2004-08-24 16:54 ` Michael Chastain
2004-08-24 16:32 ` Daniel Miller (IMI)
2004-08-24 16:54 ` Daniel Miller (IMI)
2004-08-24 16:55 ` Daniel Jacobowitz
2004-08-24 17:20 ` Michael Chastain
2004-08-24 17:48 ` Daniel Miller (IMI)
2004-08-24 17:52 ` Daniel Jacobowitz
[not found] ` <00e001c48a01$014b02b0$0401a8c0@dan>
2004-08-24 17:54 ` Michael Chastain
2004-08-23 20:56 Daniel Miller (IMI)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='008d01c48952$b7e0e7b0$0401a8c0@dan' \
--to=dan@imi-test.com \
--cc=drow@false.org \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox