Blame SOURCES/gdb-gnat-dwarf-crash-1of3.patch

01917d
commit adde2bff0757e89175ede493f03b86953d0d9352
01917d
Author: Doug Evans <xdje42@gmail.com>
01917d
Date:   Thu Feb 20 09:13:53 2014 -0800
01917d
01917d
    Fix PR symtab/16581
01917d
    
01917d
    	* dwarf2read.c (struct die_info): New member in_process.
01917d
    	(reset_die_in_process): New function.
01917d
    	(process_die): Set it at the start, reset when returning.
01917d
    	(inherit_abstract_dies): Only call process_die if origin_child_die
01917d
    	not already being processed.
01917d
    
01917d
    	testsuite/
01917d
    	* gdb.dwarf2/dw2-icycle.S: New file.
01917d
    	* gdb.dwarf2/dw2-icycle.c: New file.
01917d
    	* gdb.dwarf2/dw2-icycle.exp: New file.
01917d
01917d
### a/gdb/ChangeLog
01917d
### b/gdb/ChangeLog
01917d
## -1,3 +1,14 @@
01917d
+2014-02-20  lin zuojian  <manjian2006@gmail.com>
01917d
+	    Joel Brobecker  <brobecker@adacore.com>
01917d
+	    Doug Evans  <xdje42@gmail.com>
01917d
+
01917d
+	PR symtab/16581
01917d
+	* dwarf2read.c (struct die_info): New member in_process.
01917d
+	(reset_die_in_process): New function.
01917d
+	(process_die): Set it at the start, reset when returning.
01917d
+	(inherit_abstract_dies): Only call process_die if origin_child_die
01917d
+	not already being processed.
01917d
+
01917d
 2014-02-20  Joel Brobecker  <brobecker@adacore.com>
01917d
 
01917d
 	* windows-nat.c (handle_unload_dll): Add function documentation.
01917d
--- a/gdb/dwarf2read.c
01917d
+++ b/gdb/dwarf2read.c
01917d
@@ -1225,6 +1225,9 @@ struct die_info
01917d
        type derived from this DIE.  */
01917d
     unsigned char building_fullname : 1;
01917d
 
01917d
+    /* True if this die is in process.  PR 16581.  */
01917d
+    unsigned char in_process : 1;
01917d
+
01917d
     /* Abbrev number */
01917d
     unsigned int abbrev;
01917d
 
01917d
@@ -8008,11 +8011,28 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
01917d
     }
01917d
 }
01917d
 
01917d
+/* Reset the in_process bit of a die.  */
01917d
+
01917d
+static void
01917d
+reset_die_in_process (void *arg)
01917d
+{
01917d
+  struct die_info *die = arg;
01917d
+  die->in_process = 0;
01917d
+}
01917d
+
01917d
 /* Process a die and its children.  */
01917d
 
01917d
 static void
01917d
 process_die (struct die_info *die, struct dwarf2_cu *cu)
01917d
 {
01917d
+  struct cleanup *in_process;
01917d
+
01917d
+  /* We should only be processing those not already in process.  */
01917d
+  gdb_assert (!die->in_process);
01917d
+
01917d
+  die->in_process = 1;
01917d
+  in_process = make_cleanup (reset_die_in_process,die);
01917d
+
01917d
   switch (die->tag)
01917d
     {
01917d
     case DW_TAG_padding:
01917d
@@ -7278,6 +7298,8 @@ process_die (struct die_info *die, struc
01917d
       new_symbol (die, NULL, cu);
01917d
       break;
01917d
     }
01917d
+
01917d
+  do_cleanups (in_process);
01917d
 }
01917d
 
01917d
 /* A helper function for dwarf2_compute_name which determines whether DIE
01917d
@@ -10967,8 +10989,12 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
01917d
       if (offsetp >= offsets_end
01917d
 	  || offsetp->sect_off > origin_child_die->offset.sect_off)
01917d
 	{
01917d
-	  /* Found that ORIGIN_CHILD_DIE is really not referenced.  */
01917d
-	  process_die (origin_child_die, origin_cu);
01917d
+	  /* Found that ORIGIN_CHILD_DIE is really not referenced.
01917d
+	     Check whether we're already processing ORIGIN_CHILD_DIE.
01917d
+	     This can happen with mutually referenced abstract_origins.
01917d
+	     PR 16581.  */
01917d
+	  if (!origin_child_die->in_process)
01917d
+	    process_die (origin_child_die, origin_cu);
01917d
 	}
01917d
       origin_child_die = sibling_die (origin_child_die);
01917d
     }
01917d
### a/gdb/testsuite/ChangeLog
01917d
### b/gdb/testsuite/ChangeLog
01917d
## -1,3 +1,12 @@
01917d
+2014-02-20  lin zuojian  <manjian2006@gmail.com>
01917d
+	    Joel Brobecker  <brobecker@adacore.com>
01917d
+	    Doug Evans  <xdje42@gmail.com>
01917d
+
01917d
+	PR symtab/16581
01917d
+	* gdb.dwarf2/dw2-icycle.S: New file.
01917d
+	* gdb.dwarf2/dw2-icycle.c: New file.
01917d
+	* gdb.dwarf2/dw2-icycle.exp: New file.
01917d
+
01917d
 2014-02-19  Siva Chandra Reddy  <sivachandra@google.com>
01917d
 
01917d
 	* gdb.python/py-value-cc.cc: Improve test case to enable testing
01917d
--- /dev/null
01917d
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S
01917d
@@ -0,0 +1,258 @@
01917d
+/* This testcase is part of GDB, the GNU debugger.
01917d
+
01917d
+   Copyright 2014 Free Software Foundation, Inc.
01917d
+
01917d
+   This program is free software; you can redistribute it and/or modify
01917d
+   it under the terms of the GNU General Public License as published by
01917d
+   the Free Software Foundation; either version 3 of the License, or
01917d
+   (at your option) any later version.
01917d
+
01917d
+   This program is distributed in the hope that it will be useful,
01917d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+   GNU General Public License for more details.
01917d
+
01917d
+   You should have received a copy of the GNU General Public License
01917d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
01917d
+
01917d
+	.text
01917d
+
01917d
+.Ltext0:
01917d
+	.type	p__top__middle__inside.3062, @function
01917d
+p__top__middle__inside.3062:
01917d
+.LFB4:
01917d
+	.file 1 "p.adb"
01917d
+        .4byte 0
01917d
+.LBE6:
01917d
+
01917d
+	.globl	p__top
01917d
+	.type	p__top, @function
01917d
+p__top:
01917d
+.LFB2:
01917d
+        .4byte 0
01917d
+.LFE2:
01917d
+.Letext0:
01917d
+
01917d
+	.section	.debug_info,"",@progbits
01917d
+.Ldebug_info0:
01917d
+	.4byte	.Ledebug_info0 - .Lsdebug_info0  /* Length of CU Info */
01917d
+.Lsdebug_info0:
01917d
+	.2byte	0x4	/* DWARF version number */
01917d
+	.4byte	.Ldebug_abbrev0	/* Offset Into Abbrev. Section */
01917d
+	.byte	0x4	/* Pointer Size (in bytes) */
01917d
+	.uleb128 0x1	/* (DIE (0xb) DW_TAG_compile_unit) */
01917d
+	.ascii	"GNU Ada 4.9.0 20140126\0" /* DW_AT_producer */
01917d
+	.byte	0xd	/* DW_AT_language */
01917d
+	.ascii	"p.adb\0" /* DW_AT_name */
01917d
+	.ascii	"/tmp\0"  /* DW_AT_comp_dir */
01917d
+	.4byte	.Ltext0	/* DW_AT_low_pc */
01917d
+	.4byte	.Letext0-.Ltext0	/* DW_AT_high_pc */
01917d
+.S0x142:
01917d
+	.uleb128 0x8	/* (DIE (0x142) DW_TAG_base_type) */
01917d
+	.byte	0x4	/* DW_AT_byte_size */
01917d
+	.byte	0x5	/* DW_AT_encoding */
01917d
+	.ascii	"integer\0" /* DW_AT_name */
01917d
+
01917d
+	.uleb128 0x13	/* (DIE (0x1b4) DW_TAG_subprogram) */
01917d
+			/* DW_AT_external */
01917d
+	.ascii	"p__top\0" /* DW_AT_name */
01917d
+	.byte	0x1	/* DW_AT_decl_file (p.adb) */
01917d
+	.byte	0x3	/* DW_AT_decl_line */
01917d
+	.4byte	.LFB2	/* DW_AT_low_pc */
01917d
+	.4byte	.LFE2-.LFB2	/* DW_AT_high_pc */
01917d
+	.uleb128 0x1	/* DW_AT_frame_base */
01917d
+	.byte	0x9c	/* DW_OP_call_frame_cfa */
01917d
+			/* DW_AT_GNU_all_call_sites */
01917d
+	.4byte	.S0x4fc - .Ldebug_info0	/* DW_AT_sibling */
01917d
+.S0x1e0:
01917d
+	.uleb128 0x15	/* (DIE (0x1e0) DW_TAG_subprogram) */
01917d
+	.ascii	"p__top__middle\0" /* DW_AT_name */
01917d
+	.byte	0x1	/* DW_AT_decl_file (p.adb) */
01917d
+	.byte	0x4	/* DW_AT_decl_line */
01917d
+	.byte	0x1	/* DW_AT_inline */
01917d
+	.4byte	.S0x374 - .Ldebug_info0	/* DW_AT_sibling */
01917d
+.S0x202:
01917d
+	.uleb128 0x15	/* (DIE (0x202) DW_TAG_subprogram) */
01917d
+	.ascii	"p__top__middle__inside\0" /* DW_AT_name */
01917d
+	.byte	0x1	/* DW_AT_decl_file (p.adb) */
01917d
+	.byte	0x5	/* DW_AT_decl_line */
01917d
+	.byte	0x1	/* DW_AT_inline */
01917d
+	.4byte	.S0x225	- .Ldebug_info0 /* DW_AT_sibling */
01917d
+	.byte	0	/* end of children of DIE 0x202 */
01917d
+.S0x225:
01917d
+	.uleb128 0x18	/* (DIE (0x225) DW_TAG_subprogram) */
01917d
+	.4byte	.S0x202 - .Ldebug_info0	/* DW_AT_abstract_origin */
01917d
+	.4byte	.LFB4	/* DW_AT_low_pc */
01917d
+	.4byte	.LBE6-.LFB4	/* DW_AT_high_pc */
01917d
+	.uleb128 0x1	/* DW_AT_frame_base */
01917d
+	.byte	0x9c	/* DW_OP_call_frame_cfa */
01917d
+	.uleb128 0x1	/* DW_AT_static_link */
01917d
+	.byte	0x56	/* DW_OP_reg6 */
01917d
+			/* DW_AT_GNU_all_call_sites */
01917d
+	.uleb128 0x1a	/* (DIE (0x247) DW_TAG_inlined_subroutine) */
01917d
+	.4byte	.S0x1e0 - .Ldebug_info0	/* DW_AT_abstract_origin */
01917d
+	.4byte	.LFB4	/* DW_AT_low_pc */
01917d
+	.4byte	.LBE6-.LFB4	/* DW_AT_high_pc */
01917d
+	.byte	0x1	/* DW_AT_call_file (p.adb) */
01917d
+	.byte	0x14	/* DW_AT_call_line */
01917d
+	.4byte	.S0x374	- .Ldebug_info0 /* DW_AT_sibling */
01917d
+	.byte	0	/* end of children of DIE 0x247 */
01917d
+	.byte	0	/* end of children of DIE 0x225 */
01917d
+	.byte	0	/* end of children of DIE 0x1e0 */
01917d
+.S0x374:
01917d
+	.uleb128 0x23	/* (DIE (0x382) DW_TAG_inlined_subroutine) */
01917d
+	.4byte	.S0x1e0 - .Ldebug_info0 /* DW_AT_abstract_origin */
01917d
+	.4byte	.LFB4	/* DW_AT_low_pc */
01917d
+	.4byte	.LBE6-.LFB4	/* DW_AT_high_pc */
01917d
+	.byte	0x1	/* DW_AT_call_file (p.adb) */
01917d
+	.byte	0x1d	/* DW_AT_call_line */
01917d
+	.byte	0	/* end of children of DIE 0x382 */
01917d
+	.byte	0	/* end of children of DIE 0x1b4 */
01917d
+.S0x4fc:
01917d
+	.uleb128 0x28	/* (DIE (0x52e) DW_TAG_subprogram) */
01917d
+			/* DW_AT_external */
01917d
+	.ascii	"__gnat_rcheck_PE_Explicit_Raise\0" /* DW_AT_name */
01917d
+			/* DW_AT_artificial */
01917d
+			/* DW_AT_declaration */
01917d
+	.byte	0	/* end of children of DIE 0x52e */
01917d
+	.byte	0	/* end of children of DIE 0xb */
01917d
+.Ledebug_info0:
01917d
+
01917d
+	.section	.debug_abbrev,"",@progbits
01917d
+.Ldebug_abbrev0:
01917d
+	.uleb128 0x1	/* (abbrev code) */
01917d
+	.uleb128 0x11	/* (TAG: DW_TAG_compile_unit) */
01917d
+	.byte	0x1	/* DW_children_yes */
01917d
+	.uleb128 0x25	/* (DW_AT_producer) */
01917d
+	.uleb128 0x8	/* (DW_FORM_string) */
01917d
+	.uleb128 0x13	/* (DW_AT_language) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x3	/* (DW_AT_name) */
01917d
+	.uleb128 0x8	/* (DW_FORM_string) */
01917d
+	.uleb128 0x1b	/* (DW_AT_comp_dir) */
01917d
+	.uleb128 0x8	/* (DW_FORM_string) */
01917d
+	.uleb128 0x11	/* (DW_AT_low_pc) */
01917d
+	.uleb128 0x1	/* (DW_FORM_addr) */
01917d
+	.uleb128 0x12	/* (DW_AT_high_pc) */
01917d
+	.uleb128 0x6	/* (DW_FORM_data4) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.uleb128 0x8	/* (abbrev code) */
01917d
+	.uleb128 0x24	/* (TAG: DW_TAG_base_type) */
01917d
+	.byte	0	/* DW_children_no */
01917d
+	.uleb128 0xb	/* (DW_AT_byte_size) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x3e	/* (DW_AT_encoding) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x3	/* (DW_AT_name) */
01917d
+	.uleb128 0x8	/* (DW_FORM_string) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.uleb128 0x13	/* (abbrev code) */
01917d
+	.uleb128 0x2e	/* (TAG: DW_TAG_subprogram) */
01917d
+	.byte	0x1	/* DW_children_yes */
01917d
+	.uleb128 0x3f	/* (DW_AT_external) */
01917d
+	.uleb128 0x19	/* (DW_FORM_flag_present) */
01917d
+	.uleb128 0x3	/* (DW_AT_name) */
01917d
+	.uleb128 0x8	/* (DW_FORM_string) */
01917d
+	.uleb128 0x3a	/* (DW_AT_decl_file) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x3b	/* (DW_AT_decl_line) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x11	/* (DW_AT_low_pc) */
01917d
+	.uleb128 0x1	/* (DW_FORM_addr) */
01917d
+	.uleb128 0x12	/* (DW_AT_high_pc) */
01917d
+	.uleb128 0x6	/* (DW_FORM_data4) */
01917d
+	.uleb128 0x40	/* (DW_AT_frame_base) */
01917d
+	.uleb128 0x18	/* (DW_FORM_exprloc) */
01917d
+	.uleb128 0x2117	/* (DW_AT_GNU_all_call_sites) */
01917d
+	.uleb128 0x19	/* (DW_FORM_flag_present) */
01917d
+	.uleb128 0x1	/* (DW_AT_sibling) */
01917d
+	.uleb128 0x13	/* (DW_FORM_ref4) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.uleb128 0x15	/* (abbrev code) */
01917d
+	.uleb128 0x2e	/* (TAG: DW_TAG_subprogram) */
01917d
+	.byte	0x1	/* DW_children_yes */
01917d
+	.uleb128 0x3	/* (DW_AT_name) */
01917d
+	.uleb128 0x8	/* (DW_FORM_string) */
01917d
+	.uleb128 0x3a	/* (DW_AT_decl_file) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x3b	/* (DW_AT_decl_line) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x20	/* (DW_AT_inline) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x1	/* (DW_AT_sibling) */
01917d
+	.uleb128 0x13	/* (DW_FORM_ref4) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.uleb128 0x18	/* (abbrev code) */
01917d
+	.uleb128 0x2e	/* (TAG: DW_TAG_subprogram) */
01917d
+	.byte	0x1	/* DW_children_yes */
01917d
+	.uleb128 0x31	/* (DW_AT_abstract_origin) */
01917d
+	.uleb128 0x13	/* (DW_FORM_ref4) */
01917d
+	.uleb128 0x11	/* (DW_AT_low_pc) */
01917d
+	.uleb128 0x1	/* (DW_FORM_addr) */
01917d
+	.uleb128 0x12	/* (DW_AT_high_pc) */
01917d
+	.uleb128 0x6	/* (DW_FORM_data4) */
01917d
+	.uleb128 0x40	/* (DW_AT_frame_base) */
01917d
+	.uleb128 0x18	/* (DW_FORM_exprloc) */
01917d
+	.uleb128 0x48	/* (DW_AT_static_link) */
01917d
+	.uleb128 0x18	/* (DW_FORM_exprloc) */
01917d
+	.uleb128 0x2117	/* (DW_AT_GNU_all_call_sites) */
01917d
+	.uleb128 0x19	/* (DW_FORM_flag_present) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.uleb128 0x1a	/* (abbrev code) */
01917d
+	.uleb128 0x1d	/* (TAG: DW_TAG_inlined_subroutine) */
01917d
+	.byte	0x1	/* DW_children_yes */
01917d
+	.uleb128 0x31	/* (DW_AT_abstract_origin) */
01917d
+	.uleb128 0x13	/* (DW_FORM_ref4) */
01917d
+	.uleb128 0x11	/* (DW_AT_low_pc) */
01917d
+	.uleb128 0x1	/* (DW_FORM_addr) */
01917d
+	.uleb128 0x12	/* (DW_AT_high_pc) */
01917d
+	.uleb128 0x6	/* (DW_FORM_data4) */
01917d
+	.uleb128 0x58	/* (DW_AT_call_file) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x59	/* (DW_AT_call_line) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x1	/* (DW_AT_sibling) */
01917d
+	.uleb128 0x13	/* (DW_FORM_ref4) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.uleb128 0x23	/* (abbrev code) */
01917d
+	.uleb128 0x1d	/* (TAG: DW_TAG_inlined_subroutine) */
01917d
+	.byte	0x1	/* DW_children_yes */
01917d
+	.uleb128 0x31	/* (DW_AT_abstract_origin) */
01917d
+	.uleb128 0x13	/* (DW_FORM_ref4) */
01917d
+	.uleb128 0x11	/* (DW_AT_low_pc) */
01917d
+	.uleb128 0x1	/* (DW_FORM_addr) */
01917d
+	.uleb128 0x12	/* (DW_AT_high_pc) */
01917d
+	.uleb128 0x6	/* (DW_FORM_data4) */
01917d
+	.uleb128 0x58	/* (DW_AT_call_file) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.uleb128 0x59	/* (DW_AT_call_line) */
01917d
+	.uleb128 0xb	/* (DW_FORM_data1) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.uleb128 0x28	/* (abbrev code) */
01917d
+	.uleb128 0x2e	/* (TAG: DW_TAG_subprogram) */
01917d
+	.byte	0x1	/* DW_children_yes */
01917d
+	.uleb128 0x3f	/* (DW_AT_external) */
01917d
+	.uleb128 0x19	/* (DW_FORM_flag_present) */
01917d
+	.uleb128 0x3	/* (DW_AT_name) */
01917d
+	.uleb128 0x8	/* (DW_FORM_string) */
01917d
+	.uleb128 0x34	/* (DW_AT_artificial) */
01917d
+	.uleb128 0x19	/* (DW_FORM_flag_present) */
01917d
+	.uleb128 0x3c	/* (DW_AT_declaration) */
01917d
+	.uleb128 0x19	/* (DW_FORM_flag_present) */
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+	.byte	0
01917d
+
01917d
+        .section .debug_line
01917d
+.Lline1_begin:
01917d
+        .byte   0
01917d
+
01917d
--- /dev/null
01917d
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.c
01917d
@@ -0,0 +1,24 @@
01917d
+/* This testcase is part of GDB, the GNU debugger.
01917d
+
01917d
+   Copyright 2004-2014 Free Software Foundation, Inc.
01917d
+
01917d
+   This program is free software; you can redistribute it and/or modify
01917d
+   it under the terms of the GNU General Public License as published by
01917d
+   the Free Software Foundation; either version 3 of the License, or
01917d
+   (at your option) any later version.
01917d
+
01917d
+   This program is distributed in the hope that it will be useful,
01917d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+   GNU General Public License for more details.
01917d
+
01917d
+   You should have received a copy of the GNU General Public License
01917d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
01917d
+
01917d
+/* Dummy main function.  */
01917d
+
01917d
+int
01917d
+main()
01917d
+{
01917d
+  return 0;
01917d
+}
01917d
--- /dev/null
01917d
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp
01917d
@@ -0,0 +1,46 @@
01917d
+# Copyright 2014 Free Software Foundation, Inc.
01917d
+
01917d
+# This program is free software; you can redistribute it and/or modify
01917d
+# it under the terms of the GNU General Public License as published by
01917d
+# the Free Software Foundation; either version 3 of the License, or
01917d
+# (at your option) any later version.
01917d
+#
01917d
+# This program is distributed in the hope that it will be useful,
01917d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+# GNU General Public License for more details.
01917d
+#
01917d
+# You should have received a copy of the GNU General Public License
01917d
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
01917d
+
01917d
+# This test exercises PR 16581.
01917d
+
01917d
+load_lib dwarf.exp
01917d
+
01917d
+# This test can only be run on targets which support DWARF-2 and use gas.
01917d
+if {![dwarf2_support]} {
01917d
+    return 0
01917d
+}
01917d
+
01917d
+standard_testfile .S .c
01917d
+
01917d
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
01917d
+	  [list $srcfile $srcfile2] {nodebug}] } {
01917d
+    return -1
01917d
+}
01917d
+
01917d
+# We are trying to verify that the partial symtab to symtab expansion
01917d
+# for the debugging info hand-coded in our assembly file does not cause
01917d
+# the debugger to crash (infinite recursion).  To facilitate the test,
01917d
+# start the debugger with -readnow.  This force expansion as soon as
01917d
+# the objfile is loaded.
01917d
+
01917d
+set saved_gdbflags $GDBFLAGS
01917d
+set GDBFLAGS "$GDBFLAGS -readnow"
01917d
+clean_restart ${testfile}
01917d
+set GDBFLAGS $saved_gdbflags
01917d
+
01917d
+# And just to be sure that the debugger did not crash after having
01917d
+# expanded our symbols, do a life-check.
01917d
+
01917d
+gdb_test "echo life check\\n" "life check"