Blame SOURCES/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch

ab2726
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
ab2726
From: Fedora GDB patches <invalid@email.com>
ab2726
Date: Fri, 27 Oct 2017 21:07:50 +0200
ab2726
Subject: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
ab2726
ab2726
;; Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
ab2726
;;=fedoratest
ab2726
ab2726
diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c
ab2726
new file mode 100644
ab2726
--- /dev/null
ab2726
+++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c
ab2726
@@ -0,0 +1,26 @@
ab2726
+/* Copyright (C) 2012 Free Software Foundation, Inc.
ab2726
+
ab2726
+   This file is part of GDB.
ab2726
+
ab2726
+   This program is free software; you can redistribute it and/or modify
ab2726
+   it under the terms of the GNU General Public License as published by
ab2726
+   the Free Software Foundation; either version 3 of the License, or
ab2726
+   (at your option) any later version.
ab2726
+
ab2726
+   This program is distributed in the hope that it will be useful,
ab2726
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ab2726
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ab2726
+   GNU General Public License for more details.
ab2726
+
ab2726
+   You should have received a copy of the GNU General Public License
ab2726
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
ab2726
+
ab2726
+#include <stdio.h>
ab2726
+#include <stdlib.h>
ab2726
+
ab2726
+int
ab2726
+main (int argc, char *argv[])
ab2726
+{
ab2726
+  printf ("Hello, World.\n");
ab2726
+  abort ();
ab2726
+}
ab2726
diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp
ab2726
new file mode 100644
ab2726
--- /dev/null
ab2726
+++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp
ab2726
@@ -0,0 +1,39 @@
ab2726
+# Copyright 2012 Free Software Foundation, Inc.
ab2726
+
ab2726
+# This program is free software; you can redistribute it and/or modify
ab2726
+# it under the terms of the GNU General Public License as published by
ab2726
+# the Free Software Foundation; either version 3 of the License, or
ab2726
+# (at your option) any later version.
ab2726
+#
ab2726
+# This program is distributed in the hope that it will be useful,
ab2726
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ab2726
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ab2726
+# GNU General Public License for more details.
ab2726
+#
ab2726
+# You should have received a copy of the GNU General Public License
ab2726
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
ab2726
+
ab2726
+set testfile "set-solib-absolute-prefix"
ab2726
+set srcfile ${testfile}.c
ab2726
+
ab2726
+# It is necessary to verify if the binary is 32-bit, so that the system
ab2726
+# call `__kernel_vsyscall' originates from vDSO.
ab2726
+
ab2726
+if { ![is_ilp32_target] } {
ab2726
+    return -1
ab2726
+}
ab2726
+
ab2726
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
ab2726
+    return -1
ab2726
+}
ab2726
+
ab2726
+if { ![runto_main] } {
ab2726
+    return -1
ab2726
+}
ab2726
+
ab2726
+gdb_test "continue" "Program received signal SIGABRT, Aborted.*" \
ab2726
+    "continue until abort"
ab2726
+gdb_test "set solib-absolute-prefix /BOGUS_DIRECT" \
ab2726
+    ".*warning: Unable to find dynamic linker breakpoint function.*" \
ab2726
+    "set solib-absolute-prefix"
ab2726
+gdb_test "bt" "__kernel_vsyscall.*" "backtrace with __kernel_vsyscall"