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

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