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