1 1.3 christos # Copyright 2011-2015 Free Software Foundation, Inc. 2 1.1 christos 3 1.1 christos # This program is free software; you can redistribute it and/or modify 4 1.1 christos # it under the terms of the GNU General Public License as published by 5 1.1 christos # the Free Software Foundation; either version 3 of the License, or 6 1.1 christos # (at your option) any later version. 7 1.1 christos # 8 1.1 christos # This program is distributed in the hope that it will be useful, 9 1.1 christos # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 1.1 christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 1.1 christos # GNU General Public License for more details. 12 1.1 christos # 13 1.1 christos # You should have received a copy of the GNU General Public License 14 1.1 christos # along with this program. If not, see <http://www.gnu.org/licenses/>. 15 1.1 christos 16 1.1 christos load_lib mi-support.exp 17 1.1 christos set MIFLAGS "-i=mi2" 18 1.1 christos 19 1.1 christos if {[skip_shlib_tests]} { 20 1.1 christos untested mi-solib.exp 21 1.1 christos return -1 22 1.1 christos } 23 1.1 christos 24 1.1 christos gdb_exit 25 1.1 christos if [mi_gdb_start] { 26 1.1 christos continue 27 1.1 christos } 28 1.1 christos 29 1.1 christos standard_testfile solib-main.c solib-lib.c 30 1.1 christos 31 1.1 christos set libname "solib-lib" 32 1.1 christos set srcfile_lib ${srcdir}/${subdir}/$srcfile2 33 1.1 christos set binfile_lib [standard_output_file ${libname}.so] 34 1.1 christos set lib_flags [list debug] 35 1.1 christos 36 1.1 christos set srcfile_main ${srcdir}/${subdir}/$srcfile 37 1.1 christos set bin_flags [list debug shlib=${binfile_lib}] 38 1.1 christos 39 1.1 christos if [get_compiler_info] { 40 1.1 christos return -1 41 1.1 christos } 42 1.1 christos 43 1.1 christos if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" 44 1.1 christos || [gdb_compile ${srcfile_main} ${binfile} executable $bin_flags] != "" } { 45 1.1 christos untested "Could not compile $binfile_lib or $binfile." 46 1.1 christos return -1 47 1.1 christos } 48 1.1 christos 49 1.1 christos mi_delete_breakpoints 50 1.1 christos mi_gdb_reinitialize_dir $srcdir/$subdir 51 1.1 christos mi_gdb_reinitialize_dir $srcdir/$subdir 52 1.1 christos mi_gdb_load ${binfile} 53 1.1 christos 54 1.1 christos mi_load_shlibs $binfile_lib 55 1.1 christos 56 1.1 christos mi_gdb_test "777-gdb-set stop-on-solib-events 1" "777\\^done" \ 57 1.1 christos "set stop-on-solib-events" 58 1.1 christos 59 1.1 christos # We use "run" rather than "-exec-run" here in order to test that CLI 60 1.1 christos # commands still cause the correct MI output to be generated. 61 1.1 christos mi_run_with_cli 62 1.1 christos 63 1.3 christos # Also test that the CLI solib event note is output. 64 1.3 christos set test "CLI prints solib event" 65 1.3 christos gdb_expect { 66 1.3 christos -re "~\"Stopped due to shared library event \\(no libraries added or removed\\)\\\\n" { 67 1.3 christos pass "$test" 68 1.3 christos } 69 1.3 christos timeout { 70 1.3 christos fail "$test (timeout)" 71 1.3 christos } 72 1.1 christos } 73 1.3 christos 74 1.1 christos mi_expect_stop solib-event .* .* .* .* .* "check for solib event" 75