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

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