summaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-10-04 08:35:29 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-10-04 08:35:29 +0000
commit6957386a80c6432cf6fd3dec2b394a0dd836bac2 (patch)
tree058a541f9b4853e4cfa312bb92cc08f21da03458 /gdb/testsuite
parentd8de0472d930925e8a8bb8d8bfcd489f07c8a203 (diff)
downloadgdb-6957386a80c6432cf6fd3dec2b394a0dd836bac2.tar.gz
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')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.mi/mi-start.c22
-rw-r--r--gdb/testsuite/gdb.mi/mi-start.exp47
3 files changed, 73 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 991e677f710..4f077770653 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-04 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.mi/mi-start.c, gdb.mi/mi-start.exp: New files.
+
2013-10-02 Vidya Praveen <vidyapraveen@arm.com>
* gdb.trace/entry-values.exp: Modify regular expression to scan for
diff --git a/gdb/testsuite/gdb.mi/mi-start.c b/gdb/testsuite/gdb.mi/mi-start.c
new file mode 100644
index 00000000000..13d1ac22483
--- /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 00000000000..98dfef4f047
--- /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"
+