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