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

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