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

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