Blame SOURCES/gdb-test-dw2-aranges.patch

7a6771
[archer-tromey-delayed-symfile]
7a6771
7a6771
commit 77fa7778a37b0d28a7e4e5235f074a10ecf1815d
7a6771
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
7a6771
Date:   Sat Aug 15 15:05:54 2009 +0200
7a6771
7a6771
    Test for "handle incorrect aranges".
7a6771
    
7a6771
    readelf:
7a6771
    Contents of the .debug_aranges section:
7a6771
    
7a6771
      Length:                   8
7a6771
      Version:                  2
7a6771
      Offset into .debug_info:  0x0
7a6771
      Pointer Size:             0
7a6771
      Segment Size:             0
7a6771
    
7a6771
        Address    Length
7a6771
    Floating point exception
7a6771
    
7a6771
    	* gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files.
7a6771
7a6771
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
7a6771
===================================================================
7a6771
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
7a6771
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.S	2014-02-06 22:02:22.087449660 +0100
7a6771
@@ -0,0 +1,140 @@
7a6771
+/* This testcase is part of GDB, the GNU debugger.
7a6771
+
7a6771
+   Copyright 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
7a6771
+
7a6771
+   This program is free software; you can redistribute it and/or modify
7a6771
+   it under the terms of the GNU General Public License as published by
7a6771
+   the Free Software Foundation; either version 3 of the License, or
7a6771
+   (at your option) any later version.
7a6771
+
7a6771
+   This program is distributed in the hope that it will be useful,
7a6771
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
7a6771
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7a6771
+   GNU General Public License for more details.
7a6771
+
7a6771
+   You should have received a copy of the GNU General Public License
7a6771
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
7a6771
+
7a6771
+/* Test .debug_aranges containing zero address_size.  */
7a6771
+
7a6771
+/* Dummy function to provide debug information for.  */
7a6771
+
7a6771
+	.text
7a6771
+.Lbegin_text1:
7a6771
+	.globl main
7a6771
+	.type main, %function
7a6771
+main:
7a6771
+.Lbegin_main:
7a6771
+	.int 0
7a6771
+.Lend_main:
7a6771
+	.size main, .-main
7a6771
+.Lend_text1:
7a6771
+
7a6771
+/* Debug information */
7a6771
+
7a6771
+	.section .debug_info
7a6771
+.Lcu1_begin:
7a6771
+	/* CU header */
7a6771
+	.4byte	.Lcu1_end - .Lcu1_start		/* Length of Compilation Unit */
7a6771
+.Lcu1_start:
7a6771
+	.2byte	2				/* DWARF Version */
7a6771
+	.4byte	.Labbrev1_begin			/* Offset into abbrev section */
7a6771
+	.byte	4				/* Pointer size */
7a6771
+
7a6771
+	/* CU die */
7a6771
+	.uleb128 1				/* Abbrev: DW_TAG_compile_unit */
7a6771
+	.4byte	.Lend_text1			/* DW_AT_high_pc */
7a6771
+	.4byte	.Lbegin_text1			/* DW_AT_low_pc */
7a6771
+	.ascii	"file1.txt\0"			/* DW_AT_name */
7a6771
+	.ascii	"GNU C 3.3.3\0"			/* DW_AT_producer */
7a6771
+	.byte	1				/* DW_AT_language (C) */
7a6771
+
7a6771
+	/* main */
7a6771
+	.uleb128	2			/* Abbrev: DW_TAG_subprogram */
7a6771
+	.byte		1			/* DW_AT_external */
7a6771
+	.byte		1			/* DW_AT_decl_file */
7a6771
+	.byte		2			/* DW_AT_decl_line */
7a6771
+	.ascii		"main\0"		/* DW_AT_name */
7a6771
+	.4byte		.Ltype_int-.Lcu1_begin	/* DW_AT_type */
7a6771
+	.4byte		.Lbegin_main	/* DW_AT_low_pc */
7a6771
+	.4byte		.Lend_main		/* DW_AT_high_pc */
7a6771
+	.byte		1			/* DW_AT_frame_base: length */
7a6771
+	.byte		0x55			/* DW_AT_frame_base: DW_OP_reg5 */
7a6771
+
7a6771
+.Ltype_int:
7a6771
+	.uleb128	3			/* Abbrev: DW_TAG_base_type */
7a6771
+	.ascii		"int\0"			/* DW_AT_name */
7a6771
+	.byte		4			/* DW_AT_byte_size */
7a6771
+	.byte		5			/* DW_AT_encoding */
7a6771
+
7a6771
+	.byte		0			/* End of children of CU */
7a6771
+
7a6771
+.Lcu1_end:
7a6771
+
7a6771
+/* Abbrev table */
7a6771
+	.section .debug_abbrev
7a6771
+.Labbrev1_begin:
7a6771
+	.uleb128	1			/* Abbrev code */
7a6771
+	.uleb128	0x11			/* DW_TAG_compile_unit */
7a6771
+	.byte		1			/* has_children */
7a6771
+	.uleb128	0x12			/* DW_AT_high_pc */
7a6771
+	.uleb128	0x1			/* DW_FORM_addr */
7a6771
+	.uleb128	0x11			/* DW_AT_low_pc */
7a6771
+	.uleb128	0x1			/* DW_FORM_addr */
7a6771
+	.uleb128	0x3			/* DW_AT_name */
7a6771
+	.uleb128	0x8			/* DW_FORM_string */
7a6771
+	.uleb128	0x25			/* DW_AT_producer */
7a6771
+	.uleb128	0x8			/* DW_FORM_string */
7a6771
+	.uleb128	0x13			/* DW_AT_language */
7a6771
+	.uleb128	0xb			/* DW_FORM_data1 */
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+
7a6771
+	.uleb128	2			/* Abbrev code */
7a6771
+	.uleb128	0x2e			/* DW_TAG_subprogram */
7a6771
+	.byte		0			/* has_children */
7a6771
+	.uleb128	0x3f			/* DW_AT_external */
7a6771
+	.uleb128	0xc			/* DW_FORM_flag */
7a6771
+	.uleb128	0x3a			/* DW_AT_decl_file */
7a6771
+	.uleb128	0xb			/* DW_FORM_data1 */
7a6771
+	.uleb128	0x3b			/* DW_AT_decl_line */
7a6771
+	.uleb128	0xb			/* DW_FORM_data1 */
7a6771
+	.uleb128	0x3			/* DW_AT_name */
7a6771
+	.uleb128	0x8			/* DW_FORM_string */
7a6771
+	.uleb128	0x49			/* DW_AT_type */
7a6771
+	.uleb128	0x13			/* DW_FORM_ref4 */
7a6771
+	.uleb128	0x11			/* DW_AT_low_pc */
7a6771
+	.uleb128	0x1			/* DW_FORM_addr */
7a6771
+	.uleb128	0x12			/* DW_AT_high_pc */
7a6771
+	.uleb128	0x1			/* DW_FORM_addr */
7a6771
+	.uleb128	0x40			/* DW_AT_frame_base */
7a6771
+	.uleb128	0xa			/* DW_FORM_block1 */
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+
7a6771
+	.uleb128	3			/* Abbrev code */
7a6771
+	.uleb128	0x24			/* DW_TAG_base_type */
7a6771
+	.byte		0			/* has_children */
7a6771
+	.uleb128	0x3			/* DW_AT_name */
7a6771
+	.uleb128	0x8			/* DW_FORM_string */
7a6771
+	.uleb128	0xb			/* DW_AT_byte_size */
7a6771
+	.uleb128	0xb			/* DW_FORM_data1 */
7a6771
+	.uleb128	0x3e			/* DW_AT_encoding */
7a6771
+	.uleb128	0xb			/* DW_FORM_data1 */
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+	.byte		0x0			/* Terminator */
7a6771
+
7a6771
+/* aranges table */
7a6771
+	.section .debug_aranges
7a6771
+	.long	.Laranges_end - 1f
7a6771
+1:
7a6771
+	.2byte	2				/* aranges Version */
7a6771
+	.4byte	.Lcu1_begin - .debug_info	/* Offset into .debug_info section */
7a6771
+	/* The GDB crasher is this zero value.  */
7a6771
+	.byte		0			/* aranges address_size */
7a6771
+	.byte		0			/* aranges segment_size */
7a6771
+
7a6771
+.Laranges_end:
7a6771
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
7a6771
===================================================================
7a6771
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
7a6771
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp	2014-02-06 22:09:08.322852771 +0100
7a6771
@@ -0,0 +1,40 @@
7a6771
+# Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
7a6771
+
7a6771
+# This program is free software; you can redistribute it and/or modify
7a6771
+# it under the terms of the GNU General Public License as published by
7a6771
+# the Free Software Foundation; either version 3 of the License, or
7a6771
+# (at your option) any later version.
7a6771
+#
7a6771
+# This program is distributed in the hope that it will be useful,
7a6771
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
7a6771
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7a6771
+# GNU General Public License for more details.
7a6771
+#
7a6771
+# You should have received a copy of the GNU General Public License
7a6771
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
7a6771
+
7a6771
+# Test .debug_aranges containing zero address_size.
7a6771
+
7a6771
+# This test can only be run on targets which support DWARF-2 and use gas.
7a6771
+# For now pick a sampling of likely targets.
7a6771
+if {![istarget *-*-linux*]
7a6771
+    && ![istarget *-*-gnu*]
7a6771
+    && ![istarget *-*-elf*]
7a6771
+    && ![istarget *-*-openbsd*]
7a6771
+    && ![istarget arm-*-eabi*]
7a6771
+    && ![istarget powerpc-*-eabi*]} {
7a6771
+    return 0  
7a6771
+}
7a6771
+
7a6771
+set testfile "dw2-aranges"
7a6771
+set srcfile ${testfile}.S
7a6771
+set binfile [standard_output_file ${testfile}]
7a6771
+
7a6771
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {nodebug}] != "" } {
7a6771
+    return -1
7a6771
+}
7a6771
+
7a6771
+clean_restart $testfile
7a6771
+
7a6771
+# Failed gdb_load would abort the testcase execution earlier.
7a6771
+pass "file loaded"