Implement pahole-like 'ptype /o' option
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / shlib-call.exp
index 326112d19f1105311edb1e62202c76b0b36c81db..2c9b4957aa920c98e56069f3680542bcde2156c5 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright 1997-2013 Free Software Foundation, Inc.
+#   Copyright 1997-2017 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
@@ -50,14 +50,15 @@ if [get_compiler_info] {
 if { [gdb_compile_shlib ${lib1src} ${lib1} $lib_opts] != ""
      || [gdb_compile_shlib ${lib2src} ${lib2} $lib_opts] != ""
      || [gdb_compile ${srcfile} ${binfile} executable $exec_opts] != ""} {
-    untested "Could not compile $lib1, $lib2, or $srcfile."
+    untested "failed to compile"
     return -1
 }
 
 # Start with a fresh gdb.
 
 clean_restart ${binfile}
-gdb_load_shlibs $lib1 $lib2
+gdb_load_shlib $lib1
+gdb_load_shlib $lib2
 
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
@@ -71,7 +72,7 @@ if ![runto_main] then {
 
 #step -over
 
-gdb_test "next" "g = shr1\\(g\\);" "next to shr1"
+gdb_test "next 2" "g = shr1\\(g\\);" "next to shr1"
 
 #print g
 
@@ -79,8 +80,9 @@ gdb_test "print g" "\[0-9\]* = 1" "print g"
 
 #step -over
 if ![gdb_skip_stdio_test "next over shr1"] {
-    gdb_test "next" \
-       "address of sgs is $hex.*g = shr2\\(g\\);" \
+    gdb_test_stdio "next" \
+       "address of sgs is $hex" \
+       "g = shr2\\(g\\);" \
        "next over shr1"
 } else {
     gdb_test "next" ".*" ""
@@ -92,15 +94,17 @@ gdb_test "print g" "\[0-9\]* = 2" "print g"
 
 #print shr1(1)
 if ![gdb_skip_stdio_test "print shr1(1)"] {
-    gdb_test "print shr1(1)" \
-       "address of sgs is $hex.*\[0-9\]* = 2" \
+    gdb_test_stdio "print shr1(1)" \
+       "address of sgs is $hex" \
+       "\[0-9\]* = 2" \
        "print shr1(1)"
 }
 
 #print shr1(g)
 if ![gdb_skip_stdio_test "print shr1(g)"] {
-    gdb_test "print shr1(g)" \
-       "address of sgs is $hex.*\[0-9\]* = 4" \
+    gdb_test_stdio "print shr1(g)" \
+       "address of sgs is $hex" \
+       "\[0-9\]* = 4" \
        "print shr1(g)"
 }
 
@@ -111,14 +115,15 @@ gdb_test "break shr2" \
     "breakpoint function shr2"
 
 gdb_test "continue" \
-       "Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:7.*7.*return 2.x;" \
+       "Continuing\\..*Breakpoint ${decimal}, shr2 \\(.*\\) at.*shr2\\.c:${decimal}.*shr2-return \\*\\/" \
        "run until breakpoint set at a function"
 
 
 #print shr1(1)
 if ![gdb_skip_stdio_test "print shr1(1) 2nd time"] {
-    gdb_test "print shr1(1)" \
-       "address of sgs is $hex.*\[0-9\]* = 2" \
+    gdb_test_stdio "print shr1(1)" \
+       "address of sgs is $hex" \
+       "\[0-9\]* = 2" \
        "print shr1(1) 2nd time"
 }
 
@@ -165,18 +170,22 @@ gdb_test_no_output "set width 0"
 # test that we can re-set breakpoints in shared libraries
 gdb_breakpoint "shr1" "allow-pending"
 
-# FIXME: should not send "run" explicitly.  Non-portable.
-
-if ![is_remote target] {
-  gdb_test "run" "Starting program:.*Breakpoint .,.*" \
-       "run to bp in shared library"
-
-  gdb_continue_to_end "" continue 1
+set test "run to bp in shared library"
+gdb_run_cmd
+gdb_test_multiple "" $test {
+    -re "Breakpoint .,.*${gdb_prompt} " {
+       pass $test
+    }
+}
 
-  gdb_test "run" "Starting program:.*Breakpoint .,.*" \
-       "re-run to bp in shared library (PR's 16495, 18213)"
+gdb_continue_to_end "" continue 1
 
-  gdb_continue_to_end "" continue 1
+set test "re-run to bp in shared library (PR's 16495, 18213)"
+gdb_run_cmd
+gdb_test_multiple "" $test {
+    -re "Breakpoint .,.*${gdb_prompt} " {
+       pass $test
+    }
 }
 
-return 0
+gdb_continue_to_end "" continue 1
This page took 0.026238 seconds and 4 git commands to generate.