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

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