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

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