| OLD | NEW |
| 1 # Copyright 2012 Free Software Foundation, Inc. | 1 # Copyright 2012-2013 Free Software Foundation, Inc. |
| 2 # This program is free software; you can redistribute it and/or modify | 2 # This program is free software; you can redistribute it and/or modify |
| 3 # it under the terms of the GNU General Public License as published by | 3 # it under the terms of the GNU General Public License as published by |
| 4 # the Free Software Foundation; either version 3 of the License, or | 4 # the Free Software Foundation; either version 3 of the License, or |
| 5 # (at your option) any later version. | 5 # (at your option) any later version. |
| 6 # | 6 # |
| 7 # This program is distributed in the hope that it will be useful, | 7 # This program is distributed in the hope that it will be useful, |
| 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 # GNU General Public License for more details. | 10 # GNU General Public License for more details. |
| 11 # | 11 # |
| 12 # You should have received a copy of the GNU General Public License | 12 # You should have received a copy of the GNU General Public License |
| 13 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 13 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 14 | 14 |
| 15 if { [skip_shlib_tests] || [is_remote target] } { | 15 if { [skip_shlib_tests] || [is_remote target] } { |
| 16 return 0 | 16 return 0 |
| 17 } | 17 } |
| 18 | 18 |
| 19 # Library file. | 19 # Library file. |
| 20 set libname "info-fun-solib" | 20 set libname "info-fun-solib" |
| 21 set srcfile_lib ${srcdir}/${subdir}/${libname}.c | 21 set srcfile_lib ${srcdir}/${subdir}/${libname}.c |
| 22 set binfile_lib ${objdir}/${subdir}/${libname}.so | 22 set binfile_lib [standard_output_file ${libname}.so] |
| 23 set lib_flags {} | 23 set lib_flags {} |
| 24 # Binary file. | 24 # Binary file. |
| 25 set testfile "info-fun" | 25 standard_testfile .c |
| 26 set srcfile ${srcdir}/${subdir}/${testfile}.c | |
| 27 set executable ${testfile} | 26 set executable ${testfile} |
| 28 set binfile ${objdir}/${subdir}/${executable} | |
| 29 set bin_flags [list debug shlib=${binfile_lib}] | 27 set bin_flags [list debug shlib=${binfile_lib}] |
| 30 | 28 |
| 31 if [get_compiler_info] { | 29 if [get_compiler_info] { |
| 32 return -1 | 30 return -1 |
| 33 } | 31 } |
| 34 | 32 |
| 35 # SEP must be last for the possible `unsupported' error path. | 33 # SEP must be last for the possible `unsupported' error path. |
| 36 foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" { | 34 foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" { |
| 37 | 35 |
| 38 set sep_lib_flags $lib_flags | 36 set sep_lib_flags $lib_flags |
| 39 if {$libsepdebug != "NO"} { | 37 if {$libsepdebug != "NO"} { |
| 40 lappend sep_lib_flags {debug} | 38 lappend sep_lib_flags {debug} |
| 41 } | 39 } |
| 42 if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $sep_lib_flags] != "" | 40 if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $sep_lib_flags] != "" |
| 43 » || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } { | 41 » || [gdb_compile $srcdir/$subdir/${srcfile} ${binfile} \ |
| 42 » » executable $bin_flags] != "" } { |
| 44 untested "Could not compile $binfile_lib or $binfile." | 43 untested "Could not compile $binfile_lib or $binfile." |
| 45 return -1 | 44 return -1 |
| 46 } | 45 } |
| 47 | 46 |
| 48 if {$libsepdebug == "SEP"} { | 47 if {$libsepdebug == "SEP"} { |
| 49 if {[gdb_gnu_strip_debug $binfile_lib] != 0} { | 48 if {[gdb_gnu_strip_debug $binfile_lib] != 0} { |
| 50 unsupported "Could not split debug of $binfile_lib." | 49 unsupported "Could not split debug of $binfile_lib." |
| 51 return | 50 return |
| 52 } else { | 51 } else { |
| 53 pass "split solib" | 52 pass "split solib" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 75 append match_str "$hex *foo(@plt)?\[\r\n\]*" | 74 append match_str "$hex *foo(@plt)?\[\r\n\]*" |
| 76 # Watch for again to not have to worry about the order of appearance. | 75 # Watch for again to not have to worry about the order of appearance. |
| 77 append match_str $plt_foo_match | 76 append match_str $plt_foo_match |
| 78 if { "$libsepdebug" == "NO" } { | 77 if { "$libsepdebug" == "NO" } { |
| 79 # Note: The ".?" is for targets like m68k-linux that have ".foo" here. | 78 # Note: The ".?" is for targets like m68k-linux that have ".foo" here. |
| 80 append match_str "$hex *.?foo\[\r\n\]*" | 79 append match_str "$hex *.?foo\[\r\n\]*" |
| 81 } | 80 } |
| 82 | 81 |
| 83 gdb_test "info fun foo" "$match_str" | 82 gdb_test "info fun foo" "$match_str" |
| 84 }} | 83 }} |
| OLD | NEW |