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

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