From: Joel Brobecker <brobecker@adacore.com>
To: gdb@sourceware.org
Subject: about PR gdb/10002 (extern optimized out symbols print: Address of symbol is unknown)
Date: Wed, 25 Mar 2009 22:26:00 -0000 [thread overview]
Message-ID: <20090325222600.GI1583@adacore.com> (raw)
Here is the testcase that Jan provided:
extern int missing;
int
main (void)
{
return 0 && missing;
}
This file is to be built using the following command:
% gcc -o kfail kfail.c -Wall -g
The debugger currently says that variable "missing" is unknown:
% gdb kfail
GNU gdb (GDB) 6.8.50.20090324-cvs
(gdb) p missing
Address of symbol "missing" is unknown.
The debugging information inside kfail.c says:
<1><55>: Abbrev Number: 4 (DW_TAG_variable)
<56> DW_AT_name : (indirect string, offset: 0x66): missing
<5c> DW_AT_type : <0x4e>
<60> DW_AT_external : 1
<61> DW_AT_declaration : 1
This seems correct to me. However, the testcase itself is a little
borderline in my opinion. The variable was not "optimized out", but
was never linked in. It's as if it really does not exist.
So I don't know if GDB is really all that incorrect, here. Thoughts?
Maybe there is a testcase a little more involved that shows the same
sort of issue?
--
Joel
next reply other threads:[~2009-03-25 22:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-25 22:26 Joel Brobecker [this message]
2009-03-25 23:00 ` Paul Pluzhnikov
2009-03-26 14:15 ` Jan Kratochvil
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=20090325222600.GI1583@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb@sourceware.org \
/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