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

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