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

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