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

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