aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/reverse-init-functions.exp29
2 files changed, 33 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 22a99c0..e2a95d48 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * gdb.base/reverse-init-functions.exp: New.
+
2021-05-27 Tom de Vries <tdevries@suse.de>
PR symtab/27919
diff --git a/gdb/testsuite/gdb.base/reverse-init-functions.exp b/gdb/testsuite/gdb.base/reverse-init-functions.exp
new file mode 100644
index 0000000..76fa793
--- /dev/null
+++ b/gdb/testsuite/gdb.base/reverse-init-functions.exp
@@ -0,0 +1,29 @@
+# Copyright 2020-2021 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/>.
+
+# Test reversing the order of initialize functions calls, during GDB startup.
+#
+# The intent is to catch possible unintended dependencies between two
+# initialize functions, where one depends on the other running before it.
+
+standard_testfile
+
+save_vars { env(GDB_REVERSE_INIT_FUNCTIONS) } {
+ setenv GDB_REVERSE_INIT_FUNCTIONS 1
+ clean_restart
+}
+
+# Verify that GDB has started and is ready to accept commands.
+gdb_test "print 12321" " = 12321"