Jan Kratochvil 2c55a54
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
Jan Kratochvil 2c55a54
===================================================================
Jan Kratochvil 2c55a54
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 2c55a54
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S	2014-02-06 22:02:21.981449555 +0100
ee681d3
@@ -0,0 +1,167 @@
ee681d3
+/* This testcase is part of GDB, the GNU debugger.
ee681d3
+
ee681d3
+   Copyright 2010 Free Software Foundation, Inc.
ee681d3
+
ee681d3
+   This program is free software; you can redistribute it and/or modify
ee681d3
+   it under the terms of the GNU General Public License as published by
ee681d3
+   the Free Software Foundation; either version 3 of the License, or
ee681d3
+   (at your option) any later version.
ee681d3
+
ee681d3
+   This program is distributed in the hope that it will be useful,
ee681d3
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ee681d3
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee681d3
+   GNU General Public License for more details.
ee681d3
+
ee681d3
+   You should have received a copy of the GNU General Public License
ee681d3
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
ee681d3
+
ee681d3
+	.file	"rh-dwarf4-x86_64.c"
ee681d3
+	.section	.debug_abbrev,"",@progbits
ee681d3
+.Ldebug_abbrev0:
ee681d3
+	.section	.debug_info,"",@progbits
ee681d3
+.Ldebug_info0:
ee681d3
+	.section	.debug_line,"",@progbits
ee681d3
+.Ldebug_line0:
ee681d3
+	.text
ee681d3
+.Ltext0:
ee681d3
+.globl main
ee681d3
+	.type	main, @function
ee681d3
+main:
ee681d3
+.LFB0:
ee681d3
+	.file 1 "gdb.dwarf2/rh-dwarf4-x86_64.c"
ee681d3
+	# gdb.dwarf2/rh-dwarf4-x86_64.c:20
ee681d3
+	.loc 1 20 0
ee681d3
+	.cfi_startproc
ee681d3
+	# basic block 2
ee681d3
+	pushq	%rbp
ee681d3
+	.cfi_def_cfa_offset 16
ee681d3
+	movq	%rsp, %rbp
ee681d3
+	.cfi_offset 6, -16
ee681d3
+	.cfi_def_cfa_register 6
ee681d3
+	# gdb.dwarf2/rh-dwarf4-x86_64.c:21
ee681d3
+	.loc 1 21 0
ee681d3
+	movl	$0, %eax
ee681d3
+	# gdb.dwarf2/rh-dwarf4-x86_64.c:22
ee681d3
+	.loc 1 22 0
ee681d3
+	leave
ee681d3
+	.cfi_def_cfa 7, 8
ee681d3
+	ret
ee681d3
+	.cfi_endproc
ee681d3
+.LFE0:
ee681d3
+	.size	main, .-main
ee681d3
+.Letext0:
ee681d3
+	.section	.debug_info
ee681d3
+	.long	0x4e	# Length of Compilation Unit Info
ee681d3
+	.value	0x4	# DWARF version number
ee681d3
+	.long	.Ldebug_abbrev0	# Offset Into Abbrev. Section
ee681d3
+	.byte	0x8	# Pointer Size (in bytes)
ee681d3
+	.uleb128 0x1	# (DIE (0xb) DW_TAG_compile_unit)
ee681d3
+	.long	.LASF0	# DW_AT_producer: "GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)"
ee681d3
+	.byte	0x1	# DW_AT_language
ee681d3
+	.long	.LASF1	# DW_AT_name: "gdb.dwarf2/rh-dwarf4-x86_64.c"
ee681d3
+	.long	.LASF2	# DW_AT_comp_dir
ee681d3
+	.quad	.Ltext0	# DW_AT_low_pc
ee681d3
+	.quad	.Letext0	# DW_AT_high_pc
ee681d3
+	.long	.Ldebug_line0	# DW_AT_stmt_list
ee681d3
+	.uleb128 0x2	# (DIE (0x2d) DW_TAG_subprogram)
ee681d3
+			# DW_AT_external
ee681d3
+	.long	.LASF3	# DW_AT_name: "main"
ee681d3
+	.byte	0x1	# DW_AT_decl_file (gdb.dwarf2/rh-dwarf4-x86_64.c)
ee681d3
+	.byte	0x13	# DW_AT_decl_line
ee681d3
+			# DW_AT_prototyped
ee681d3
+	.long	0x4a	# DW_AT_type
ee681d3
+	.quad	.LFB0	# DW_AT_low_pc
ee681d3
+	.quad	.LFE0	# DW_AT_high_pc
ee681d3
+	.uleb128 0x1	# DW_AT_frame_base
ee681d3
+	.byte	0x9c	# DW_OP_call_frame_cfa
ee681d3
+	.uleb128 0x3	# (DIE (0x4a) DW_TAG_base_type)
ee681d3
+	.byte	0x4	# DW_AT_byte_size
ee681d3
+	.byte	0x5	# DW_AT_encoding
ee681d3
+	.ascii "int\0"	# DW_AT_name
ee681d3
+	.byte	0x0	# end of children of DIE 0xb
ee681d3
+	.section	.debug_abbrev
ee681d3
+	.uleb128 0x1	# (abbrev code)
ee681d3
+	.uleb128 0x11	# (TAG: DW_TAG_compile_unit)
ee681d3
+	.byte	0x1	# DW_children_yes
ee681d3
+	.uleb128 0x25	# (DW_AT_producer)
ee681d3
+	.uleb128 0xe	# (DW_FORM_strp)
ee681d3
+	.uleb128 0x13	# (DW_AT_language)
ee681d3
+	.uleb128 0xb	# (DW_FORM_data1)
ee681d3
+	.uleb128 0x3	# (DW_AT_name)
ee681d3
+	.uleb128 0xe	# (DW_FORM_strp)
ee681d3
+	.uleb128 0x1b	# (DW_AT_comp_dir)
ee681d3
+	.uleb128 0xe	# (DW_FORM_strp)
ee681d3
+	.uleb128 0x11	# (DW_AT_low_pc)
ee681d3
+	.uleb128 0x1	# (DW_FORM_addr)
ee681d3
+	.uleb128 0x12	# (DW_AT_high_pc)
ee681d3
+	.uleb128 0x1	# (DW_FORM_addr)
ee681d3
+	.uleb128 0x10	# (DW_AT_stmt_list)
ee681d3
+	.uleb128 0x17	# (DW_FORM_sec_offset)
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x2	# (abbrev code)
ee681d3
+	.uleb128 0x2e	# (TAG: DW_TAG_subprogram)
ee681d3
+	.byte	0x0	# DW_children_no
ee681d3
+	.uleb128 0x3f	# (DW_AT_external)
ee681d3
+	.uleb128 0x19	# (DW_FORM_flag_present)
ee681d3
+	.uleb128 0x3	# (DW_AT_name)
ee681d3
+	.uleb128 0xe	# (DW_FORM_strp)
ee681d3
+	.uleb128 0x3a	# (DW_AT_decl_file)
ee681d3
+	.uleb128 0xb	# (DW_FORM_data1)
ee681d3
+	.uleb128 0x3b	# (DW_AT_decl_line)
ee681d3
+	.uleb128 0xb	# (DW_FORM_data1)
ee681d3
+	.uleb128 0x27	# (DW_AT_prototyped)
ee681d3
+	.uleb128 0x19	# (DW_FORM_flag_present)
ee681d3
+	.uleb128 0x49	# (DW_AT_type)
ee681d3
+	.uleb128 0x13	# (DW_FORM_ref4)
ee681d3
+	.uleb128 0x11	# (DW_AT_low_pc)
ee681d3
+	.uleb128 0x1	# (DW_FORM_addr)
ee681d3
+	.uleb128 0x12	# (DW_AT_high_pc)
ee681d3
+	.uleb128 0x1	# (DW_FORM_addr)
ee681d3
+	.uleb128 0x40	# (DW_AT_frame_base)
ee681d3
+	.uleb128 0x18	# (DW_FORM_exprloc)
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x3	# (abbrev code)
ee681d3
+	.uleb128 0x24	# (TAG: DW_TAG_base_type)
ee681d3
+	.byte	0x0	# DW_children_no
ee681d3
+	.uleb128 0xb	# (DW_AT_byte_size)
ee681d3
+	.uleb128 0xb	# (DW_FORM_data1)
ee681d3
+	.uleb128 0x3e	# (DW_AT_encoding)
ee681d3
+	.uleb128 0xb	# (DW_FORM_data1)
ee681d3
+	.uleb128 0x3	# (DW_AT_name)
ee681d3
+	.uleb128 0x8	# (DW_FORM_string)
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.section	.debug_pubnames,"",@progbits
ee681d3
+	.long	0x17	# Length of Public Names Info
ee681d3
+	.value	0x2	# DWARF Version
ee681d3
+	.long	.Ldebug_info0	# Offset of Compilation Unit Info
ee681d3
+	.long	0x52	# Compilation Unit Length
ee681d3
+	.long	0x2d	# DIE offset
ee681d3
+	.ascii "main\0"	# external name
ee681d3
+	.long	0x0
ee681d3
+	.section	.debug_aranges,"",@progbits
ee681d3
+	.long	0x2c	# Length of Address Ranges Info
ee681d3
+	.value	0x2	# DWARF Version
ee681d3
+	.long	.Ldebug_info0	# Offset of Compilation Unit Info
ee681d3
+	.byte	0x8	# Size of Address
ee681d3
+	.byte	0x0	# Size of Segment Descriptor
ee681d3
+	.value	0x0	# Pad to 16 byte boundary
ee681d3
+	.value	0x0
ee681d3
+	.quad	.Ltext0	# Address
ee681d3
+	.quad	.Letext0-.Ltext0	# Length
ee681d3
+	.quad	0x0
ee681d3
+	.quad	0x0
ee681d3
+	.section	.debug_str,"MS",@progbits,1
ee681d3
+.LASF2:
ee681d3
+	.string	"."
ee681d3
+.LASF0:
ee681d3
+	.string	"GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)"
ee681d3
+.LASF1:
ee681d3
+	.string	"gdb.dwarf2/rh-dwarf4-x86_64.c"
ee681d3
+.LASF3:
ee681d3
+	.string	"main"
ee681d3
+	.ident	"GCC: (GNU) 4.4.4 20100503 (Red Hat 4.4.4-2)"
ee681d3
+	.section	.note.GNU-stack,"",@progbits
Jan Kratochvil 2c55a54
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c
Jan Kratochvil 2c55a54
===================================================================
Jan Kratochvil 2c55a54
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 2c55a54
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c	2014-02-06 22:02:21.981449555 +0100
ee681d3
@@ -0,0 +1,22 @@
ee681d3
+/* This testcase is part of GDB, the GNU debugger.
ee681d3
+
ee681d3
+   Copyright 2010 Free Software Foundation, Inc.
ee681d3
+
ee681d3
+   This program is free software; you can redistribute it and/or modify
ee681d3
+   it under the terms of the GNU General Public License as published by
ee681d3
+   the Free Software Foundation; either version 3 of the License, or
ee681d3
+   (at your option) any later version.
ee681d3
+
ee681d3
+   This program is distributed in the hope that it will be useful,
ee681d3
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ee681d3
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee681d3
+   GNU General Public License for more details.
ee681d3
+
ee681d3
+   You should have received a copy of the GNU General Public License
ee681d3
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
ee681d3
+
ee681d3
+int
ee681d3
+main (void)
ee681d3
+{
ee681d3
+  return 0;
ee681d3
+}
Jan Kratochvil 2c55a54
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp
Jan Kratochvil 2c55a54
===================================================================
Jan Kratochvil 2c55a54
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 2c55a54
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp	2014-02-06 22:12:10.788032417 +0100
ee681d3
@@ -0,0 +1,42 @@
ee681d3
+# Copyright 2010 Free Software Foundation, Inc.
ee681d3
+
ee681d3
+# This program is free software; you can redistribute it and/or modify
ee681d3
+# it under the terms of the GNU General Public License as published by
ee681d3
+# the Free Software Foundation; either version 3 of the License, or
ee681d3
+# (at your option) any later version.
ee681d3
+#
ee681d3
+# This program is distributed in the hope that it will be useful,
ee681d3
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ee681d3
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee681d3
+# GNU General Public License for more details.
ee681d3
+#
ee681d3
+# You should have received a copy of the GNU General Public License
ee681d3
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
ee681d3
+
ee681d3
+# This test can only be run on targets which support DWARF-2 and use gas.
ee681d3
+# For now pick a sampling of likely targets.
ee681d3
+if {![istarget *-*-linux*]
ee681d3
+    && ![istarget *-*-gnu*]
ee681d3
+    && ![istarget *-*-elf*]
ee681d3
+    && ![istarget *-*-openbsd*]
ee681d3
+    && ![istarget arm-*-eabi*]
ee681d3
+    && ![istarget powerpc-*-eabi*]} {
ee681d3
+    return 0  
ee681d3
+}
ee681d3
+
ee681d3
+if {![istarget x86_64-*]} {
ee681d3
+    return 0  
ee681d3
+}
ee681d3
+
ee681d3
+set testfile "rh-dwarf4-x86_64"
ee681d3
+set srcfile ${testfile}.S
ee681d3
+set executable ${testfile}.x
Jan Kratochvil 2c55a54
+set binfile [standard_output_file ${executable}]
ee681d3
+
ee681d3
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
ee681d3
+    return -1
ee681d3
+}
ee681d3
+
ee681d3
+clean_restart $executable
ee681d3
+
ee681d3
+gdb_test "ptype main" {type = int \(void\)}