aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-10-04 08:35:31 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-10-04 08:35:31 +0000
commit5713b9b5c1cb873d65caba98616e3f9d92db11f6 (patch)
treed799d2878722ee6901a9fa3e86f181542ebc54d9 /gdb/testsuite/gdb.mi
parentf48ff2a7d3f69653dbf164e03d3397de8f6ba7c0 (diff)
downloadgdb-5713b9b5c1cb873d65caba98616e3f9d92db11f6.zip
gdb-5713b9b5c1cb873d65caba98616e3f9d92db11f6.tar.gz
gdb-5713b9b5c1cb873d65caba98616e3f9d92db11f6.tar.bz2
Add support for --start option in -exec-run GDB/MI command.
gdb/ChangeLog: * mi/mi-main.c (run_one_inferior): Add function description. Make ARG a pointer to an integer whose value determines whether we should "run" or "start" the program. (mi_cmd_exec_run): Add handling of the "--start" option. Reject all other command-line options. * NEWS: Add entry for "-exec-run"'s new "--start" option. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Program Execution): Document "-exec-run"'s new "--start" option. gdb/testsuite/ChangeLog: * gdb.mi/mi-start.c, gdb.mi/mi-start.exp: New files.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-start.c22
-rw-r--r--gdb/testsuite/gdb.mi/mi-start.exp47
2 files changed, 69 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-start.c b/gdb/testsuite/gdb.mi/mi-start.c
new file mode 100644
index 0000000..13d1ac2
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-start.c
@@ -0,0 +1,22 @@
+/* Copyright 2013 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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/>. */
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.mi/mi-start.exp b/gdb/testsuite/gdb.mi/mi-start.exp
new file mode 100644
index 0000000..98dfef4
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-start.exp
@@ -0,0 +1,47 @@
+# Copyright 2013 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=mi"
+
+# The purpose of this testcase is to test the --start option of
+# the -exec-run command. If we cannot use the -exec-run command,
+# then there is no point in running this testcase...
+if [target_info exists use_gdb_stub] {
+ untested "cannot use -exec-run command"
+ return -1
+}
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+standard_testfile mi-start.c
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "could not build mi-start"
+ return -1
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_run_cmd "--start"
+mi_expect_stop "breakpoint-hit" "main" "" ".*mi-start.c" "$decimal" \
+{ "" "disp=\"del\"" } "run to main"
+