aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-11-22 21:25:19 +0000
committerTom Tromey <tromey@redhat.com>2011-11-22 21:25:19 +0000
commit36dfb11c8b13be20baf34ea4ba772255c605e0ed (patch)
tree3ceaaac3e36cd7c63643651e043b533227305d3d /gdb/testsuite/gdb.mi
parent5bd6aa835706da4799d994bfee65f205ce2d5304 (diff)
downloadgdb-36dfb11c8b13be20baf34ea4ba772255c605e0ed.zip
gdb-36dfb11c8b13be20baf34ea4ba772255c605e0ed.tar.gz
gdb-36dfb11c8b13be20baf34ea4ba772255c605e0ed.tar.bz2
gdb
PR mi/8444: * mi/mi-common.h (EXEC_ASYNC_SOLIB_EVENT, EXEC_ASYNC_FORK) (EXEC_ASYNC_VFORK, EXEC_ASYNC_SYSCALL_ENTRY) (EXEC_ASYNC_SYSCALL_RETURN, EXEC_ASYNC_EXEC): New constants. * mi/mi-common.c (async_reason_string_lookup): Add new reasons. * breakpoint.c (print_it_catch_fork, print_it_catch_vfork) (print_it_catch_syscall, print_it_catch_exec) (internal_bkpt_print_it): Use ui_out. Emit stop reason. (bpstat_print): Add 'kind' argument. Handle TARGET_WAITKIND_LOADED. * infrun.c (normal_stop): Update for bpstat_print change. Don't handle TARGET_WAITKIND_LOADED here. * breakpoint.h (bpstat_print): Update. gdb/testsuite * lib/mi-support.exp (mi_run_cmd_full): Rename from mi_run_cmd. Add "use_mi_command" argument. (mi_run_cmd, mi_run_with_cli): New procs. * gdb.mi/solib-lib.c: New file. * gdb.mi/solib-main.c: New file. * gdb.mi/mi-solib.exp: New file. gdb/doc * gdb.texinfo (GDB/MI Async Records): Document new *stopped reasons.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-solib.exp62
-rw-r--r--gdb/testsuite/gdb.mi/solib-lib.c19
-rw-r--r--gdb/testsuite/gdb.mi/solib-main.c23
3 files changed, 104 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-solib.exp b/gdb/testsuite/gdb.mi/mi-solib.exp
new file mode 100644
index 0000000..4344f96
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-solib.exp
@@ -0,0 +1,62 @@
+# Copyright 2011 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 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, see <http://www.gnu.org/licenses/>.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+if {[skip_shlib_tests]} {
+ untested mi-solib.exp
+ return -1
+}
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set libname "solib-lib"
+set srcfile_lib ${srcdir}/${subdir}/${libname}.c
+set binfile_lib ${objdir}/${subdir}/${libname}.so
+set lib_flags [list debug]
+
+set testfile "solib-main"
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set bin_flags [list debug shlib=${binfile_lib}]
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
+ || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
+ untested "Could not compile $binfile_lib or $binfile."
+ return -1
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+gdb_load_shlibs $binfile_lib
+
+mi_gdb_test "777-gdb-set stop-on-solib-events 1" "777\\^done" \
+ "set stop-on-solib-events"
+
+# We use "run" rather than "-exec-run" here in order to test that CLI
+# commands still cause the correct MI output to be generated.
+mi_run_with_cli
+mi_expect_stop solib-event .* .* .* .* .* "check for solib event"
diff --git a/gdb/testsuite/gdb.mi/solib-lib.c b/gdb/testsuite/gdb.mi/solib-lib.c
new file mode 100644
index 0000000..e30ce83
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/solib-lib.c
@@ -0,0 +1,19 @@
+/* Copyright 2011 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 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, see <http://www.gnu.org/licenses/>.
+*/
+
+void solibfunction(void)
+{
+}
diff --git a/gdb/testsuite/gdb.mi/solib-main.c b/gdb/testsuite/gdb.mi/solib-main.c
new file mode 100644
index 0000000..eff210f
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/solib-main.c
@@ -0,0 +1,23 @@
+/* Copyright 2011 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 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, see <http://www.gnu.org/licenses/>.
+*/
+
+extern void solibfunction(void);
+
+int main ()
+{
+ solibfunction ();
+ return 0;
+}