Make gdb_load_shlibs return the destination path of the library
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / langs.exp
index 52eb5978065237029ccc89d03e54f4f5aad466d6..d2f4f2c594581b56320df6b60f95ccec2f77f139 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#   Copyright (C) 1997-2016 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
@@ -14,8 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set testfile langs
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile langs0.c langs1.c langs2.c
 
 if [is_remote host] {
     remote_download host ${srcdir}/${subdir}/langs1.f
@@ -23,24 +22,9 @@ if [is_remote host] {
 }
 
 
-if  { [gdb_compile "${srcdir}/${subdir}/langs0.c" "${binfile}0.o" object {debug}] != "" } {
-     untested langs.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/langs1.c" "${binfile}1.o" object {debug}] != "" } {
-     untested langs.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/langs2.c" "${binfile}2.o" object {debug}] != "" } {
-     untested langs.exp
-     return -1
-}
-
-if  { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} executable {debug}] != "" } {
-     untested langs.exp
-     return -1
+if {[prepare_for_testing ${testfile}.exp ${testfile} \
+        [list $srcfile $srcfile2 $srcfile3] {debug}]} {
+    return -1
 }
 
 set oldtimeout $timeout
@@ -51,14 +35,9 @@ set timeout 10
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
 if [get_compiler_info] {
-    return -1;
+    return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
 gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
        -re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
 
@@ -69,37 +48,18 @@ gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
        }
 }
 
-if {$hp_aCC_compiler} {
-    set isfixed 1
-    set lang c\\+\\+
-    set ext cxx
-    set foo_func foo__Fi__Fi
-    set do_func do::langs0
-} else {
-    if {$hp_cc_compiler} {
-        set isfixed 1
-        set lang c
-        set ext c
-    } else {
-        set isfixed 0
-    }
-    set foo_func foo__Fi
-    set do_func langs0__2do
-}
+# TODO: Since there variables are now constants, we can cleanup the test,
+# remove some dead code.
+set isfixed 0
+set foo_func foo__Fi
+set do_func langs0__2do
 
 if [runto csub] then {
 
     if { !$isfixed } { set lang c }
     gdb_test "show language" "currently $lang\".*" \
        "show language at csub in langs.exp"
-    # On some machines, foo doesn't get demangled because the N_SOL for
-    # langs2.cxx is seen only after the function stab for foo.  So
-    # the following regexps are kludged to accept foo__Fi as well as foo,
-    # even though only the latter is correct.  I haven't tried to xfail it
-    # because it depends on details of the compiler.
-    
-    # Take out xfail. This test has been passing for some time now.
-    #if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+
     gdb_test "bt" "#0.*csub.*#1.*(foo|$foo_func) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*$do_func \\(.*#5  \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
 
     if { !$isfixed } { set lang c\\+\\+; set ext cxx }
@@ -122,8 +82,6 @@ if [runto csub] then {
     gdb_test "show language" "currently $lang.*" \
        "show language at fsub in langs.exp"
 
-    # Take out xfail. This test has been passing for sometime now.
-    #if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
     if { !$isfixed } { set lang c }
     gdb_test "up" ".* in $do_func .* at .*langs0\\.c.*return fsub.*" \
        "up to langs0__2do in langs.exp"
This page took 0.02666 seconds and 4 git commands to generate.