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

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