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