a8d52276ee
* gdb.cp/class2.exp: Use gdb_test_no_output. * gdb.cp/classes.exp: Ditto. * gdb.cp/extern-c.exp: Ditto. * gdb.cp/inherit.exp: Ditto. * gdb.cp/maint.exp: Ditto. * gdb.cp/mb-inline.exp: Ditto. * gdb.cp/mb-templates.exp: Ditto. * gdb.cp/method2.exp: Ditto. * gdb.cp/misc.exp: Ditto. * gdb.cp/ovldbreak.exp: Ditto. * gdb.cp/punctuator.exp: Ditto. * gdb.cp/templates.exp: Ditto. * gdb.cp/virtbase.exp: Ditto.
62 lines
2 KiB
Text
62 lines
2 KiB
Text
# Copyright 2010 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
# This file is part of the gdb testsuite.
|
|
|
|
if { [skip_cplus_tests] } { continue }
|
|
|
|
set testfile "virtbase"
|
|
set srcfile ${testfile}.cc
|
|
set binfile ${objdir}/${subdir}/${testfile}
|
|
|
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
|
|
untested virtbase.exp
|
|
return -1
|
|
}
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
|
gdb_load ${binfile}
|
|
|
|
if {![runto_main]} then {
|
|
perror "couldn't run to breakpoint"
|
|
continue
|
|
}
|
|
|
|
gdb_breakpoint [gdb_get_line_number "breakpoint 1"]
|
|
gdb_continue_to_breakpoint "first breakpoint"
|
|
|
|
# In PR 11226, we failed to print x correctly in the "print *this"
|
|
# case.
|
|
gdb_test "print *this" " = {<mc::Base> = {x = 2}, _vptr.Middle = $hex, y = 3}"
|
|
gdb_test "print x" " = 2" "print x in get_y"
|
|
|
|
gdb_breakpoint [gdb_get_line_number "breakpoint 2"]
|
|
gdb_continue_to_breakpoint "second breakpoint"
|
|
|
|
# In PR 11226, we could not find x here.
|
|
gdb_test "print x" " = 2" "print x in get_z"
|
|
|
|
gdb_breakpoint [gdb_get_line_number "breakpoint 3"]
|
|
gdb_continue_to_breakpoint "third breakpoint"
|
|
|
|
# In PR 9629, we failed to print v correctly here.
|
|
gdb_test "print *(D *) e" " = {<C> = {v = 11}, _vptr.D = $hex}"
|
|
|
|
# A regression test reported to Red Hat bugzilla, see:
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=560741
|
|
gdb_test_no_output "set print object on"
|
|
gdb_test "print/x b->mA" " = 0xaaaaaaaa"
|