Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Chastain <mec.gnu@mindspring.com>
To: dan@imi-test.com
Cc: gdb@sources.redhat.com
Subject: Re: cannot subscript something of type <data variable, no debug info>
Date: Tue, 24 Aug 2004 12:12:00 -0000	[thread overview]
Message-ID: <412B30D2.nailETK1H2VST@mindspring.com> (raw)
In-Reply-To: <009e01c48959$a5192640$0401a8c0@dan>

[Taking drow off the "To:" list because this probably isn't a gdb bug].

Okay, your "z1" executable manifests the same symptoms on my system,
native i686-pc-linux-gnu with red-hat-8.0.

  (gdb) break main
  Breakpoint 1 at 0x8048478: file tester.cpp, line 9.
  (gdb) run
  Starting program: /berman/home/mec.gnu/tmp/dm/z1

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

In the file z1, there are no symbols for Mod in tester.cpp!
There are some residual type definitions for 'char', 'short', 'int',
et cetera.

Looking at the assembly code for "main", it did not come from:

  g++ -Wall -g tester.cpp -o tester

"main" has optimized code in it, not default code.

The variable 'Mod' is still present with the optimized code.  (It would
be very hard for the compiler to optimize away a global variable).  So
normally, the linker should have kept the type information for it too,
if that type information was ever produced.

I tried some compiler switches on a suse-9 machine but could not quite
get the exact code that your compiler generated.

Can you rebuild the 'tester' executable and check the exact options that
you are using, for both compiling and linking?  The best thing would be:

  script
  g++ -v -Wall -g tester.cpp -o tester
  exit

... and mail in the script, along with the new 'tester' executable.
Also, you don't have to tar+compress the executable if it's only 10k again.


  parent reply	other threads:[~2004-08-24 12:12 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)
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 [this message]
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=412B30D2.nailETK1H2VST@mindspring.com \
    --to=mec.gnu@mindspring.com \
    --cc=dan@imi-test.com \
    --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