c++/24367: Infinite recursion of typedef substitution
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / cp-relocate.exp
index c34f5b81186af36ddf8e7a8901a8844840aae3a5..3fa219a42f6d5a5b7e618f33922ab2a014481ee2 100644 (file)
@@ -1,29 +1,27 @@
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007-2019 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 2 of the License, or
+# 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 # Test loading symbols from unrelocated C++ object files.
 
-set testfile cp-relocate
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}.o
+standard_testfile .cc
+append binfile .o
 
 if { [skip_cplus_tests] } { continue }
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {c++ debug}] != "" } {
-     untested cp-relocate.exp
+     untested "failed to compile"
      return -1
 }
 
@@ -31,12 +29,12 @@ proc get_func_address { func } {
     global gdb_prompt hex
 
     set rfunc [string_to_regexp $func]
-    gdb_test_multiple "print '${func}'" "get address of ${func}" {
-       -re "\\\$\[0-9\]+ = \\{.*\\} (0|($hex) <${rfunc}>)\[\r\n\]+${gdb_prompt} $" {
+    gdb_test_multiple "print ${func}" "get address of ${func}" {
+       -re "\\\$\[0-9\]+ = \\{.*\\} (($hex) <${rfunc}.*>)\[\r\n\]+${gdb_prompt} $" {
            # $1 = {int ()} 0x24 <function_bar>
            # But if the function is at zero, the name may be omitted.
            pass "get address of ${func}"
-           if { $expect_out(1,string) == "0" } {
+           if { $expect_out(1,string) == "0x0" } {
                return "0x0"
            } else {
                return $expect_out(2,string)
@@ -58,11 +56,11 @@ gdb_file_cmd ${binfile}
 set func1_name ""
 set func2_name ""
 gdb_test_multiple "info functions func<.>" "info functions" {
-    -re "\r\nint (\[^\r\]*func<1>\[^\r]*);" {
+    -re "\tint (\[^\r\]*func<1>\[^\r]*);" {
        set func1_name $expect_out(1,string)
        exp_continue
     }
-    -re "\r\nint (\[^\r\]*func<2>\[^\r]*);" {
+    -re "\tint (\[^\r\]*func<2>\[^\r]*);" {
        set func2_name $expect_out(1,string)
        exp_continue
     }
@@ -124,14 +122,14 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-gdb_test "add-symbol-file ${binfile} 0 -s ${func1_sec} 0x40000 -s ${func2_sec} 0x80000" \
-       "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
+gdb_test "add-symbol-file ${binfile} 0 -s ${func1_sec} 0x10000 -s ${func2_sec} 0x20000" \
+       "Reading symbols from .*${testfile}\\.o\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
        "add-symbol-file ${testfile}.o" \
        "add symbol table from file \".*${testfile}\\.o\" at.*\\(y or n\\) " \
        "y"
 
 # Make sure the function addresses were updated.
-gdb_test "break *'$func1_name'" \
-    "Breakpoint $decimal at 0x4....: file .*"
-gdb_test "break *'$func2_name'" \
-    "Breakpoint $decimal at 0x8....: file .*"
+gdb_test "break *$func1_name" \
+    "Breakpoint $decimal at 0x1....: file .*"
+gdb_test "break *$func2_name" \
+    "Breakpoint $decimal at 0x2....: file .*"
This page took 0.026113 seconds and 4 git commands to generate.