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

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