standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here"]
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug nowarnings c++ additional_flags=-std=c++11}]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
[list debug c++ $additional_flags]]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug c++ nowarnings}]} {
- return -1
+ return
}
# This testcase cannot use runto_main because of the different prompt
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug c++ nowarnings}]} {
- return -1
+ return
}
# This testcase cannot use runto_main because of the different prompt
standard_testfile .cc anon-ns2.cc
if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {c++ debug}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
gdb_test "ptype foo" "type = int \\\(Obj\\\)" "no false reference"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "breakpoint 1" $srcfile]
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
runto_main
if { [prepare_for_testing "failed to prepare" $testfile "$srcfile"\
{debug c++}] } {
- return -1
+ return
}
gdb_test "break foo" \
if { [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2"\
{debug c++}] } {
- return -1
+ return
}
gdb_test "break N1::C1::baz" "\\(2 locations\\)"
set libobj [standard_output_file libfoo.so]
if {[build_executable "build shared library" $libobj $srcfile2 \
{debug c++ shlib}] != 0} {
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
[list debug c++ shlib=$libobj]]} {
- return -1
+ return
}
gdb_load_shlib $libobj
# Runto main, but don't delete all the breakpoints.
if {![runto_main no-delete-breakpoints]} {
- return -1
+ return
}
# The breakpoint should now be showing in `foo` for real.
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
proc test_breakpoint {name} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
|| [gdb_compile "$srcdir/$subdir/${srcfile}" "${objfilecpp}" object {c++ debug}] != ""
|| [gdb_compile "${objfilecpp} ${objfilec}" "${binfile}" executable {c++ debug}] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${::testfile}
lappend flags_nodebug c++
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags_debug]} {
- return -1
+ return
}
set asm_file [standard_output_file $srcfile2]
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $asm_file] $::flags_nodebug] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "print global_var.yyy ()" \
lappend opts additional_flags=-std=c++11
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" ${testfile}03 $srcfile2 \
{debug c++ additional_flags=-std=c++03}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
# Start with "set print object off" and "set print symbol off".
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
# Test ptype of class objects.
# Do NOT compile with debug flag.
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++}]} {
- return -1
+ return
}
# Before setting the language, try to set a few simple breakpoints
lappend_include_file flags $srcdir/lib/attributes.h
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
gdb_test_multiple "break foo" "" {
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{c++ debug additional_flags=-std=c++17}]} {
- return -1
+ return
}
if {![runto_main]} {
if { $func1_sec == $func2_sec } {
untested "cp-relocate.exp - template functions in same sections"
- return -1
+ return
}
# Now start a clean GDB, for add-symbol-file tests.
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# Tests below are about tab-completion, which doesn't work if readline
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
# Test that completion is restricted by class name (all methods)
set flags "$flags debug c++"
if {[prepare_for_testing "failed to prepare" $testfile $srcfile "$flags"]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set methods {"bar" "baz"}
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
#
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2 $srcfile3 $srcfile4] {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug c++}]} {
- return -1
+ return
}
# Check inheritance of typedefs.
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
if {[prepare_for_testing "failed to prepare" $testfile \
$srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
lappend opts additional_flags=-std=c++11
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "breakpt"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto 'marker']} {
- return -1
+ return
}
# Returns a buffer corresponding to what GDB replies when asking for
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug c++ additional_flags=-std=c++11}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "ptype E1" \
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# Set a catch catchpoint
require allow_cplus_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {[skip_libstdcxx_probe_tests]} {
untested "could not find libstdc++ stap probe"
- return -1
+ return
}
proc do_continue_to_catchpoint {name} {
delete_breakpoints
if {![runto_main]} {
- return -1
+ return
}
with_test_prefix "2nd run" {
set srcfile expand-sals.cc
if { [prepare_for_testing "failed to prepare" expand-sals $srcfile {debug c++}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "func-line"]
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
runto_main
include_file includefile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
proc get_address { var } {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${::testfile}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "First breakpoint"]
require {!target_info exists gdb,cannot_call_functions}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2 $srcfile3] {debug c++}]} {
- return -1
+ return
}
# As of May 1, 2002, GDB hangs trying to read the debug info for the
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
set gcc_used [test_compiler_info gcc-*-*]
# Use completely arbitrary file for $libfile source.
if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile2} ${libfile} {debug c++}] != ""
|| [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++ shlib_load}] } {
- return -1
+ return
}
gdb_load_shlib $libfile
if { ![runto_main] } {
- return -1
+ return
}
for {set i 0} {$i < 10} {incr i} {
standard_testfile misc.cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# Single inheritance, print type definitions.
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
#
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] $flags]} {
- return -1
+ return
}
if {![runto_main]} {
lappend opts c++
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
- return -1
+ return
}
require {string eq [have_index $binfile] ""}
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {[test_compiler_info {clang-*-*} c++]} {
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug c++}]} {
- return -1
+ return
}
set bp_location [gdb_get_line_number "set breakpoint here" $hdrfile]
set bp_location [gdb_get_line_number "set multi-line breakpoint here" $hdrfile]
if { ![runto_main] } {
- return 0
+ return
}
gdb_test "break $hdrfile:$bp_location" \
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
set bp_location [gdb_get_line_number "set breakpoint here"]
set bp_location [gdb_get_line_number "set multi-line breakpoint here"]
if { ![runto_main] } {
- return 0
+ return
}
gdb_test "break $srcfile:$bp_location" \
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{c++ debug additional_flags=-std=c++11}]} {
- return -1
+ return
}
if {![runto_main]} {
lappend opts additional_flags=-std=c++11
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Set a breakpoint after the bar object is created and the reference is obtained.
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
#
|| [gdb_compile $srcdir/$subdir/$srcfile2 $objmainfile object $debug_flags] != ""
|| [gdb_compile "$objfile $objmainfile" $binfile executable $debug_flags] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${executable}
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
#
set csrcfile "${testfile}.cc"
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Set a breakpoint in the lambda in A::doit (). */
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug c++}]} {
- return -1
+ return
}
gdb_test "print foo::B::B_B" "`foo::B' is not defined as an aggregate type."
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
############################################
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug c++}]} {
- return -1
+ return
}
gdb_test "show lang" "auto; currently c\\+\\+.*"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "BP 1"]
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug c++}]} {
- return -1
+ return
}
# Build the node given by ID (a number representing the struct S[ID] in
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if {![skip_unwinder_tests]} {
unsupported "nextoverthrow.exp could not find _Unwind_DebugHook"
- return -1
+ return
}
# Set a temporary breakpoint and then continue to it.
require allow_cplus_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# This tests that $_exception gives an error when the systemtap probes
gdb_test "maint ignore-probes libstdcxx .*" ".*OBJNAME: ''"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "catch throw" "Catchpoint $decimal \\(throw\\)" \
if {[prepare_for_testing "failed to prepare" $testfile $srcfile [list debug c++ $additional_flags]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if { [prepare_for_testing "failed to prepare" "noparam" "noparam.cc" {debug c++}] } {
- return -1
+ return
}
# Check if GDB does not crash.
if {[gdb_compile $srcdir/$subdir/$srcfile ${binfile}1.o \
object {c++ debug}] != ""} {
- return -1
+ return
}
if {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
- return -1
+ return
}
if {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
$binfile executable {c++}] != ""} {
- return -1
+ return
}
clean_restart $testfile
Dwarf::assemble $asm_file $the_dwarf
if {[gdb_compile $asm_file ${binfile}3.o object {nodebug}] != ""} {
- return -1
+ return
}
if {[gdb_compile [list ${binfile}1.o ${binfile}3.o] \
${binfile}-r executable {c++}] != ""} {
- return -1
+ return
}
clean_restart
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
############################################
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
############################################
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug c++ additional_flags=-Wno-unused-comparison}] } {
- return -1
+ return
}
############################################
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $testfile.cc {c++ debug}]} {
- return -1
+ return
}
gdb_test_no_output "set language c++"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# Set it up at a breakpoint so we can play with the variable values.
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# set it up at a breakpoint so we can play with the variable values
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2 $srcfile3 $srcfile4] {c++ debug}]} {
- return -1
+ return
}
if {![runto_main]} {
lappend opts additional_flags=-std=c++11
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
foreach ordinary {"outer<int>::fn" "outer<char>::fn<short>" "toplev<char>"} {
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${testfile}.cc {c++ debug}] } {
- return -1
+ return
}
gdb_test_no_output "set breakpoint pending off"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# Place the breakpoint before inferior gets started. Then the breakpoint
set options {debug c++ additional_flags=-std=c++11}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# GCC version <= 6 and Clang do not emit DW_AT_defaulted and DW_AT_deleted.
set options {debug c++ additional_flags=-std=c++11}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set bp_location [gdb_get_line_number "stop here"]
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
gdb_test "print ptm" " = &A::i"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile bool.cc
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
runto_main
if { [gdb_compile $srcdir/$subdir/$srcfile $binfile object \
{c++ debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
set re \
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug c++}]} {
- return -1
+ return
}
gdb_test "break s::method1" "Breakpoint .* at .*: file .*psmang1.cc.*"
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.x" object {debug c++}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile.x
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
gdb_test "whatis v_my_int" "type = my_int"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
standard_testfile .cc
if {[build_executable ${testfile}.exp $testfile ${testfile}.cc {c++ debug}] == -1} {
- return -1
+ return
}
save_vars { GDBFLAGS } {
standard_testfile .cc
if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == -1} {
- return -1
+ return
}
proc gdb_start_again { text } {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
#
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing $testfile.exp $testfile $srcfile \
{debug c++ additional_flags="-std=gnu++11"}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Prevent symbol on address 0x0 being printed.
if {[prepare_for_testing $testfile.exp $testfile $srcfile \
{debug c++ additional_flags="-std=gnu++11"}]} {
- return -1
+ return
}
# Set it up at a breakpoint so we can play with the variable values.
if {![runto 'marker1']} {
untested "couldn't run to marker1"
- return -1
+ return
}
# Prevent symbol on address 0x0 being printed.
if {[build_executable $testfile.exp $testfile $srcfile \
{debug c++ additional_flags="-std=gnu++11"}] == -1} {
- return -1
+ return
}
proc gdb_start_again {text prefix} {
if {[prepare_for_testing $testfile.exp $testfile $srcfile \
{debug c++ additional_flags="-std=gnu++11"}]} {
- return -1
+ return
}
#
# Set it up at a breakpoint so we can play with the variable values.
#
if {![runto_main]} {
- return -1
+ return
}
if {![runto 'marker1']} {
- return -1
+ return
}
gdb_test "up" ".*main.*" "up from marker1 1"
standard_testfile .cc
if { [build_executable "failed to prepare" ${testfile} $srcfile {debug c++}] } {
- return -1
+ return
}
proc restart {} {
set exefile $testfile
if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
# Run to a location in the file.
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}]} {
- return -1
+ return
}
# The GDB workaround for GCC PR debug/45682 does not apply as it requires
if { [gdb_compile $srcdir/$subdir/$srcfile $binfile.o object {debug c++}] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile.o
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "print a" \
standard_testfile .cc
if {[test_compiler_info gcc*] && ![supports_statement_frontiers] } {
- return -1
+ return
}
# Compile the test source with USE_NEXT_INLINE_H defined (when
if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
{c++ debug}]} {
- return -1
+ return
}
gdb_test "print sizeof(a)/sizeof(a\[0\])" "10"
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] \
{debug c++ additional_flags=-std=c++11}]} {
- return -1
+ return
}
# Xfail for superfluous DW_TAG_lexical_block, gcc PR debug/55541.
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug c++ additional_flags=-std=c++11}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# gcc 4.4 and earlier don't emit enough info for some of our template tests.
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
#
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
lappend opts additional_flags=-std=c++11
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
gdb_test "print (int)byte_val" "= 128"
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "ptype C::x" \
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}]} {
- return -1
+ return
}
gdb_test_no_output "set language c++"
gdb_test "p *u" {You can't do that without a process to debug.} "test crash"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "p *v" " = 42" "test typedef"
require allow_cplus_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
proc do_typeid_tests {started} {
}
if {![runto_main]} {
- return -1
+ return
}
with_test_prefix "after starting" {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
runto "foo"
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2 $srcfile3 $srcfile4] {debug c++}]} {
- return -1
+ return
}
proc do_global_tests {lang} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
proc test_ptype_of_classes {} {
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
lappend flags c++
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {