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

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