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: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
|
|
|
Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
|
|
|
|
|
2017-12-08 04:31:26 +00:00
|
|
|
;; Find symbols properly at their original (included) file (BZ 109921).
|
|
|
|
;;=fedoratest
|
2017-12-04 19:24:00 +00:00
|
|
|
|
2007-01-09 11:35:44 +00:00
|
|
|
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
|
|
|
|
|
2008-01-07 15:10:23 +00:00
|
|
|
It is duplicite to its upstream variant:
|
|
|
|
http://sourceware.org/ml/gdb-cvs/2007-01/msg00157.html
|
|
|
|
http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
|
|
|
|
2007-01-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
Daniel Jacobowitz <dan@codesourcery.com>
|
|
|
|
|
|
|
|
* gdb.base/included.c, gdb.base/included.exp,
|
|
|
|
gdb.base/included.h: New files.
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
2007-01-09 11:35:44 +00:00
|
|
|
|
|
|
|
2007-01-09 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c,
|
|
|
|
gdb.dwarf2/dw2-included.h: New files.
|
|
|
|
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.c b/gdb/testsuite/gdb.dwarf2/dw2-included.c
|
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.c
|
2007-01-09 11:35:44 +00:00
|
|
|
@@ -0,0 +1,26 @@
|
|
|
|
+/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
+
|
|
|
|
+ Copyright 2006 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 2 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, write to the Free Software
|
|
|
|
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
|
|
+ USA. */
|
|
|
|
+
|
|
|
|
+#include "dw2-included.h"
|
|
|
|
+
|
|
|
|
+int
|
|
|
|
+main()
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+}
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.exp b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
|
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
|
2007-01-09 11:35:44 +00:00
|
|
|
@@ -0,0 +1,47 @@
|
|
|
|
+# Copyright 2006 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 2 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, write to the Free Software
|
|
|
|
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
+
|
|
|
|
+# Minimal DWARF-2 unit test
|
|
|
|
+
|
|
|
|
+# This test can only be run on targets which support DWARF-2.
|
|
|
|
+# For now pick a sampling of likely targets.
|
|
|
|
+if {![istarget *-*-linux*]
|
|
|
|
+ && ![istarget *-*-gnu*]
|
|
|
|
+ && ![istarget *-*-elf*]
|
|
|
|
+ && ![istarget *-*-openbsd*]
|
|
|
|
+ && ![istarget arm-*-eabi*]
|
|
|
|
+ && ![istarget powerpc-*-eabi*]} {
|
|
|
|
+ return 0
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+set testfile "dw2-included"
|
|
|
|
+set srcfile ${testfile}.c
|
2016-02-16 09:54:56 +00:00
|
|
|
+set binfile [standard_output_file ${testfile}]
|
2007-01-09 11:35:44 +00:00
|
|
|
+
|
|
|
|
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
|
|
|
+ return -1
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+gdb_exit
|
|
|
|
+gdb_start
|
|
|
|
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
+gdb_load ${binfile}
|
|
|
|
+
|
|
|
|
+gdb_test "set listsize 1" ""
|
|
|
|
+gdb_test "list integer" "int integer;\r"
|
|
|
|
+gdb_test "ptype integer" "type = int\r"
|
|
|
|
+# Path varies depending on the build location.
|
2018-05-31 18:47:56 +00:00
|
|
|
+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\n${decimal}:.*int integer;\r"
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.h b/gdb/testsuite/gdb.dwarf2/dw2-included.h
|
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.h
|
2007-01-09 11:35:44 +00:00
|
|
|
@@ -0,0 +1,20 @@
|
|
|
|
+/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
+
|
|
|
|
+ Copyright 2006 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 2 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, write to the Free Software
|
|
|
|
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
|
|
+ USA. */
|
|
|
|
+
|
|
|
|
+int integer;
|