Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Add boards/aslr.exp
@ 2026-02-13 21:39 Tom de Vries
  2026-02-13 23:11 ` Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2026-02-13 21:39 UTC (permalink / raw)
  To: gdb-patches

Commit deb47060b58 ("gdb/testsuite: make gdb.dwarf2/dw2-empty-inline-ranges.exp
work when ASLR can't be disabled") notes that test-case
gdb.dwarf2/dw2-empty-inline-ranges.exp fails in case the test-case:
- produces a PIE executable, and
- is run in a setup that ignores disable-randomization == on (such as in a
  container where that capability is removed).

The commit fixes the test-case using nopie, but I wondered if there were more
test-cases that fail in the same way, so I ran the testsuite using:
- target board unix/-fPIE/-pie, and
- a patch that added -iex "set disable-randomization off" to INTERNAL_GDBFLAGS,
and indeed there are.

Add a boards file aslr.exp with this setup.

Tested on x86_64-linux.
---
 gdb/testsuite/boards/aslr.exp   | 26 ++++++++++++++++++++++++++
 gdb/testsuite/make-check-all.sh |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 gdb/testsuite/boards/aslr.exp

diff --git a/gdb/testsuite/boards/aslr.exp b/gdb/testsuite/boards/aslr.exp
new file mode 100644
index 00000000000..5e00230b301
--- /dev/null
+++ b/gdb/testsuite/boards/aslr.exp
@@ -0,0 +1,26 @@
+# Copyright 2026 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_board_description "local-board"
+
+# Simulate a setup that ignores the default disable-randomization == on (such
+# as a container where that capability is removed).
+append GDBFLAGS { -iex "set disable-randomization off"}
+
+# Try to generate PIE executables to catch the cases that having address
+# randomization in executables matters.
+# It would be nice to use "pie" (as handled by gdb_compile) here, but that
+# doesn't seem to work.
+process_multilib_options "-fPIE -pie"
diff --git a/gdb/testsuite/make-check-all.sh b/gdb/testsuite/make-check-all.sh
index c46cd8de4ed..a5190bd64ff 100755
--- a/gdb/testsuite/make-check-all.sh
+++ b/gdb/testsuite/make-check-all.sh
@@ -66,6 +66,7 @@ host_target_boards=(
 
 # Boards that run everything on local target and local host.
 target_boards=(
+    aslr
     cc-with-gdb-index
     cc-with-index-cache
     cc-with-debug-names

base-commit: 51b7445c65ff06a6d9740fc635be73287527a0a5
-- 
2.51.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-13 23:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-13 21:39 [PATCH] [gdb/testsuite] Add boards/aslr.exp Tom de Vries
2026-02-13 23:11 ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox