Blame SOURCES/gdb-6.5-bz109921-DW_AT_decl_file-test.patch

a8223e
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
a8223e
From: Jan Kratochvil <jan.kratochvil@redhat.com>
a8223e
Date: Fri, 27 Oct 2017 21:07:50 +0200
a8223e
Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
a8223e
a8223e
;; Find symbols properly at their original (included) file (BZ 109921).
a8223e
;;=fedoratest
a8223e
a8223e
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
a8223e
a8223e
It is duplicite to its upstream variant:
a8223e
http://sourceware.org/ml/gdb-cvs/2007-01/msg00157.html
a8223e
http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
a8223e
2007-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
a8223e
	    Daniel Jacobowitz  <dan@codesourcery.com>
a8223e
a8223e
	* gdb.base/included.c, gdb.base/included.exp,
a8223e
	gdb.base/included.h: New files.
a8223e
a8223e
------------------------------------------------------------------------------
a8223e
a8223e
2007-01-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
a8223e
a8223e
	* gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c,
a8223e
	gdb.dwarf2/dw2-included.h: New files.
a8223e
a8223e
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.c b/gdb/testsuite/gdb.dwarf2/dw2-included.c
a8223e
new file mode 100644
a8223e
--- /dev/null
a8223e
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.c
a8223e
@@ -0,0 +1,26 @@
a8223e
+/* This testcase is part of GDB, the GNU debugger.
a8223e
+
a8223e
+   Copyright 2006 Free Software Foundation, Inc.
a8223e
+
a8223e
+   This program is free software; you can redistribute it and/or modify
a8223e
+   it under the terms of the GNU General Public License as published by
a8223e
+   the Free Software Foundation; either version 2 of the License, or
a8223e
+   (at your option) any later version.
a8223e
+
a8223e
+   This program is distributed in the hope that it will be useful,
a8223e
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
a8223e
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a8223e
+   GNU General Public License for more details.
a8223e
+
a8223e
+   You should have received a copy of the GNU General Public License
a8223e
+   along with this program; if not, write to the Free Software
a8223e
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
a8223e
+   USA.  */
a8223e
+
a8223e
+#include "dw2-included.h"
a8223e
+
a8223e
+int
a8223e
+main()
a8223e
+{
a8223e
+  return 0;
a8223e
+}
a8223e
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.exp b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
a8223e
new file mode 100644
a8223e
--- /dev/null
a8223e
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
a8223e
@@ -0,0 +1,47 @@
a8223e
+# Copyright 2006 Free Software Foundation, Inc.
a8223e
+
a8223e
+# This program is free software; you can redistribute it and/or modify
a8223e
+# it under the terms of the GNU General Public License as published by
a8223e
+# the Free Software Foundation; either version 2 of the License, or
a8223e
+# (at your option) any later version.
a8223e
+#
a8223e
+# This program is distributed in the hope that it will be useful,
a8223e
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a8223e
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a8223e
+# GNU General Public License for more details.
a8223e
+#
a8223e
+# You should have received a copy of the GNU General Public License
a8223e
+# along with this program; if not, write to the Free Software
a8223e
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
a8223e
+
a8223e
+# Minimal DWARF-2 unit test
a8223e
+
a8223e
+# This test can only be run on targets which support DWARF-2.
a8223e
+# For now pick a sampling of likely targets.
a8223e
+if {![istarget *-*-linux*]
a8223e
+    && ![istarget *-*-gnu*]
a8223e
+    && ![istarget *-*-elf*]
a8223e
+    && ![istarget *-*-openbsd*]
a8223e
+    && ![istarget arm-*-eabi*]
a8223e
+    && ![istarget powerpc-*-eabi*]} {
a8223e
+    return 0
a8223e
+}
a8223e
+
a8223e
+set testfile "dw2-included"
a8223e
+set srcfile ${testfile}.c
a8223e
+set binfile [standard_output_file ${testfile}]
a8223e
+
a8223e
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
a8223e
+    return -1
a8223e
+}
a8223e
+
a8223e
+gdb_exit
a8223e
+gdb_start
a8223e
+gdb_reinitialize_dir $srcdir/$subdir
a8223e
+gdb_load ${binfile}
a8223e
+
a8223e
+gdb_test "set listsize 1" ""
a8223e
+gdb_test "list integer" "int integer;\r"
a8223e
+gdb_test "ptype integer" "type = int\r"
a8223e
+# Path varies depending on the build location.
a8223e
+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\n${decimal}:.*int integer;\r"
a8223e
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.h b/gdb/testsuite/gdb.dwarf2/dw2-included.h
a8223e
new file mode 100644
a8223e
--- /dev/null
a8223e
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.h
a8223e
@@ -0,0 +1,20 @@
a8223e
+/* This testcase is part of GDB, the GNU debugger.
a8223e
+
a8223e
+   Copyright 2006 Free Software Foundation, Inc.
a8223e
+
a8223e
+   This program is free software; you can redistribute it and/or modify
a8223e
+   it under the terms of the GNU General Public License as published by
a8223e
+   the Free Software Foundation; either version 2 of the License, or
a8223e
+   (at your option) any later version.
a8223e
+
a8223e
+   This program is distributed in the hope that it will be useful,
a8223e
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
a8223e
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a8223e
+   GNU General Public License for more details.
a8223e
+
a8223e
+   You should have received a copy of the GNU General Public License
a8223e
+   along with this program; if not, write to the Free Software
a8223e
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
a8223e
+   USA.  */
a8223e
+
a8223e
+int integer;