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

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