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