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

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