From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: carlton@kealia.com, drow@mvista.com, vinschen@redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
Date: Fri, 19 Mar 2004 00:09:00 -0000 [thread overview]
Message-ID: <20040309151111.DE3094B104@berman.michael-chastain.com> (raw)
Hi Corinna,
cv> Basically, the testsuite tries to print the value of a local variable
cv> on a closing brace. This fails due to the debug info given in this
cv> case:
I have been seeing this also on native i686-pc-linux-gnu.
cv> When the testsuite steps to the closing brace of the function, $pc is
cv> set to the first instruction of the epilogue. This is exactly the
cv> first instruction which doesn't belong to the lexical block anymore.
cv> Logically, the local variable doesn't exist anymore at this point.
Right.
I want to raise the question: is this really a bug in the gdb test suite,
or is it a bug in gcc?
That is: is a local variable required to exist at the closing brace of a
function?
I think your answer is "no, it's not required to exist, therefore the
gdb test suite should change". My answer is "reluctantly, no,
it's not required to exist"; I don't think the famous gcc -O0
debug info clause covers this case. I'm curious what drow and
carlton and other people have to say.
void foo ()
{
int i;
i = 1;
bar (i);
}
(gdb) break bar
(gdb) run
(gdb) finish
(gdb) print i
Is it okay for gcc to emit debug info that "i" is out of scope here?
cv> I'd suggest to change the testsuite case to add another line to the
cv> function enums1(), so that it's sure to be still in the scope of the
cv> local variable obj_with_enum.
misc.cc is used by three *.exp files so I do not want to touch it
at all, so I am dis-approving your patch. I will write a patch to
remove the "gdb_test next" in test_enums instead.
Michael C
WARNING: multiple messages have this Message-ID
From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: carlton@kealia.com, drow@mvista.com, vinschen@redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
Date: Tue, 09 Mar 2004 15:11:00 -0000 [thread overview]
Message-ID: <20040309151111.DE3094B104@berman.michael-chastain.com> (raw)
Message-ID: <20040309151100.HMCY1ycsK6LgFzMkP8efC6sxOkL5AU0I7VUO59SCrkI@z> (raw)
Hi Corinna,
cv> Basically, the testsuite tries to print the value of a local variable
cv> on a closing brace. This fails due to the debug info given in this
cv> case:
I have been seeing this also on native i686-pc-linux-gnu.
cv> When the testsuite steps to the closing brace of the function, $pc is
cv> set to the first instruction of the epilogue. This is exactly the
cv> first instruction which doesn't belong to the lexical block anymore.
cv> Logically, the local variable doesn't exist anymore at this point.
Right.
I want to raise the question: is this really a bug in the gdb test suite,
or is it a bug in gcc?
That is: is a local variable required to exist at the closing brace of a
function?
I think your answer is "no, it's not required to exist, therefore the
gdb test suite should change". My answer is "reluctantly, no,
it's not required to exist"; I don't think the famous gcc -O0
debug info clause covers this case. I'm curious what drow and
carlton and other people have to say.
void foo ()
{
int i;
i = 1;
bar (i);
}
(gdb) break bar
(gdb) run
(gdb) finish
(gdb) print i
Is it okay for gcc to emit debug info that "i" is out of scope here?
cv> I'd suggest to change the testsuite case to add another line to the
cv> function enums1(), so that it's sure to be still in the scope of the
cv> local variable obj_with_enum.
misc.cc is used by three *.exp files so I do not want to touch it
at all, so I am dis-approving your patch. I will write a patch to
remove the "gdb_test next" in test_enums instead.
Michael C
next reply other threads:[~2004-03-09 15:11 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-19 0:09 Michael Elizabeth Chastain [this message]
2004-03-09 15:11 ` Michael Elizabeth Chastain
2004-03-09 15:40 ` Corinna Vinschen
2004-03-19 0:09 ` Corinna Vinschen
2004-03-19 0:09 ` Daniel Jacobowitz
2004-03-09 15:20 ` Daniel Jacobowitz
2004-03-19 0:09 Michael Elizabeth Chastain
2004-03-09 15:27 ` Michael Elizabeth Chastain
2004-03-19 0:09 Michael Elizabeth Chastain
2004-03-10 23:58 ` Michael Elizabeth Chastain
2004-03-19 0:09 Corinna Vinschen
2004-03-09 13:00 ` Corinna Vinschen
2004-03-19 0:09 ` Daniel Jacobowitz
2004-03-09 14:17 ` Daniel Jacobowitz
2004-03-19 0:09 Michael Elizabeth Chastain
2004-03-10 2:06 ` Michael Elizabeth Chastain
2004-03-19 0:09 Michael Elizabeth Chastain
2004-03-09 16:15 ` Michael Elizabeth Chastain
2004-03-19 0:09 ` Andrew Cagney
2004-03-09 20:38 ` Andrew Cagney
2004-03-09 21:27 ` Daniel Jacobowitz
2004-03-09 22:32 ` Andrew Cagney
2004-03-19 0:09 ` Andrew Cagney
2004-03-19 0:09 ` Daniel Jacobowitz
2004-03-10 0:56 ` Daniel Jacobowitz
2004-03-19 0:09 ` Andrew Cagney
2004-03-10 1:51 ` Andrew Cagney
2004-03-10 3:05 ` Daniel Jacobowitz
2004-03-19 0:09 ` Daniel Jacobowitz
2004-03-10 3:23 ` Daniel Jacobowitz
2004-03-10 22:21 ` Andrew Cagney
2004-03-10 22:29 ` Daniel Jacobowitz
2004-03-15 18:47 ` Andrew Cagney
2004-03-19 0:09 ` Andrew Cagney
2004-03-19 0:09 ` Daniel Jacobowitz
2004-03-19 0:09 ` Andrew Cagney
2004-03-19 0:09 ` Daniel Jacobowitz
2004-03-19 0:09 ` Daniel Jacobowitz
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=20040309151111.DE3094B104@berman.michael-chastain.com \
--to=mec.gnu@mindspring.com \
--cc=carlton@kealia.com \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=vinschen@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