From: Jim Blandy <jimb@redhat.com>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: gdb-patches@sources.redhat.com, drow@mvista.com
Subject: Re: RFA: Check for corruption of cv_type chain
Date: Fri, 03 May 2002 17:28:00 -0000 [thread overview]
Message-ID: <npznzgzrgi.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <200205032219.g43MJxL15375@duracef.shout.net>
Second try.
2002-05-03 Jim Blandy <jimb@redhat.com>
* gdb.c++/hang.exp: Check for corruption of the cv_type chain.
* gdb.c++/hang3.C: New file.
Index: gdb/testsuite/gdb.c++/hang.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/hang.exp,v
retrieving revision 1.1
diff -c -r1.1 hang.exp
*** gdb/testsuite/gdb.c++/hang.exp 2 May 2002 07:03:53 -0000 1.1
--- gdb/testsuite/gdb.c++/hang.exp 4 May 2002 00:27:05 -0000
***************
*** 29,41 ****
set testfile hang
set binfile ${objdir}/${subdir}/${testfile}
! foreach file {hang1 hang2} {
! if { [gdb_compile "${srcdir}/${subdir}/${file}.C" "${file}.o" object {debug c++}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
}
! if {[gdb_compile "hang1.o hang2.o" ${binfile} executable {debug c++}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
--- 29,41 ----
set testfile hang
set binfile ${objdir}/${subdir}/${testfile}
! foreach file {hang1 hang2 hang3} {
! if {[gdb_compile "${srcdir}/${subdir}/${file}.C" "${file}.o" object {c++ debug}] != ""} {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
}
! if {[gdb_compile "hang1.o hang2.o hang3.o" ${binfile} executable {c++ debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
***************
*** 110,113 ****
# in `cleanup_undefined_types' corrupted the target type's `cv_type'
# ring, `finish_cv_type' enters an infinite loop.
! gdb_test "print var_in_b" " = 1729" "can read debug info"
--- 110,128 ----
# in `cleanup_undefined_types' corrupted the target type's `cv_type'
# ring, `finish_cv_type' enters an infinite loop.
! # This checks that GDB recognizes when a structure is about to be
! # overwritten, and refuses, with a complaint.
! gdb_test "print var_in_b" " = 1729" "doesn't overwrite struct type"
!
! # This checks that cleanup_undefined_types doesn't create corrupt
! # cv_type chains. Note that var_in_hang3 does need to be declared in
! # a separate compilation unit, whose psymtab depends on hang1.o's
! # psymtab. Otherwise, GDB won't call cleanup_undefined_types (as it
! # finishes hang1.o's symbols) before it calls make_cv_type (while
! # reading hang3.o's symbols).
! #
! # The bug only happens when you compile with -gstabs+; Otherwise, GCC
! # won't include the `const' qualifier on `const_B_ptr' in `hang3.o''s
! # STABS, so GDB won't try to create a const variant of the smashed
! # struct type, and get caught by the corrupted cv_type chain.
! gdb_test "print var_in_hang3" " = 42" "doesn't corrupt cv_type chain"
Index: gdb/testsuite/gdb.c++/hang3.C
===================================================================
RCS file: gdb/testsuite/gdb.c++/hang3.C
diff -N gdb/testsuite/gdb.c++/hang3.C
*** gdb/testsuite/gdb.c++/hang3.C 1 Jan 1970 00:00:00 -0000
--- gdb/testsuite/gdb.c++/hang3.C 4 May 2002 00:27:05 -0000
***************
*** 0 ****
--- 1,4 ----
+ #include "hang.H"
+
+ const struct B *const_B_ptr;
+ int var_in_hang3 = 42;
next prev parent reply other threads:[~2002-05-04 0:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-03 15:20 Michael Elizabeth Chastain
2002-05-03 17:28 ` Jim Blandy [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-05-03 21:10 Michael Elizabeth Chastain
2002-05-03 19:37 Michael Elizabeth Chastain
2002-05-03 19:20 Michael Elizabeth Chastain
2002-05-03 17:54 Michael Elizabeth Chastain
2002-05-03 18:49 ` Daniel Jacobowitz
2002-05-03 17:33 Michael Elizabeth Chastain
2002-05-03 14:54 Jim Blandy
2002-05-03 15:14 ` Daniel Jacobowitz
2002-05-03 17:10 ` Jim Blandy
2002-05-03 17:25 ` Daniel Jacobowitz
2002-05-03 20:13 ` Jim Blandy
2002-05-03 18:44 ` Michael Snyder
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=npznzgzrgi.fsf@zwingli.cygnus.com \
--to=jimb@redhat.com \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=mec@shout.net \
/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