From 4fc5b2085878cffdc16f6ca7cbcb27cbdb12f11a Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Fri, 3 Oct 2008 22:02:20 +0000 Subject: 2008-10-03 Paul Pluzhnikov PR gdb/2384: * gdb.cp/gdb2384.exp: Extended to test more cases. * gdb.cp/gdb2384.cc: Likewise. * gdb.cp/gdb2384-base.h: Likewise. * gdb.cp/gdb2384-base.cc: Likewise. --- gdb/testsuite/gdb.cp/gdb2384.exp | 65 +++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 35 deletions(-) (limited to 'gdb/testsuite/gdb.cp/gdb2384.exp') diff --git a/gdb/testsuite/gdb.cp/gdb2384.exp b/gdb/testsuite/gdb.cp/gdb2384.exp index 370c65b8ee8..3ae79574495 100644 --- a/gdb/testsuite/gdb.cp/gdb2384.exp +++ b/gdb/testsuite/gdb.cp/gdb2384.exp @@ -55,46 +55,41 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} gdb_load_shlibs ${sofile} -set bp_location [gdb_get_line_number "set breakpoint here"] - -# Set a breakpoint with multiple locations. - -gdb_test "break $srcfile:$bp_location" \ - "Breakpoint.*at.* file .*$srcfile, line.*" \ - "set breakpoint" - -gdb_run_cmd -gdb_expect { - -re "Breakpoint \[0-9\]+,.*main \\(.*\\).*$gdb_prompt $" { - pass "run to breakpoint" - } - -re "$gdb_prompt $" { - fail "run to breakpoint" - } - timeout { - fail "run to breakpoint (timeout)" - } + +if ![runto_main] then { + perror "couldn't run to breakpoint" + return -1 } -gdb_test "print d.meth ()" \ +gdb_breakpoint [gdb_get_line_number "set breakpoint here"] +gdb_continue_to_breakpoint "set breakpoint here" + +gdb_test "print d1.meth ()" \ ".*42.*" \ - "print d.meth ()" + "print d1.meth ()" # Now try again. gdb's without the fix will hopefully segv here -gdb_run_cmd -gdb_expect { - -re "Breakpoint \[0-9\]+,.*main \\(.*\\).*$gdb_prompt $" { - pass "run to breakpoint #2" - } - -re "$gdb_prompt $" { - fail "run to breakpoint #2" - } - timeout { - fail "run to breakpoint #2 (timeout)" - } -} - -gdb_test "print d.meth ()" \ +runto_main +gdb_breakpoint [gdb_get_line_number "set breakpoint here"] +gdb_continue_to_breakpoint "set breakpoint here" +gdb_test "print d1.meth ()" \ ".*42.*" \ "gdb2384" + +# second case + +runto_main +gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"] +gdb_continue_to_breakpoint "set breakpoint here (second)" +gdb_test "print d2.meth ()" \ + ".*24.*" \ + "print d2.meth()" + +runto_main +gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"] +gdb_continue_to_breakpoint "set breakpoint here (second)" +gdb_test "print d2.meth ()" \ + ".*24.*" \ + "gdb2384 (second)" + -- cgit v1.2.1