]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Treat attributes as code in DWARF assembler
authorTom Tromey <tromey@adacore.com>
Fri, 30 May 2025 16:16:24 +0000 (10:16 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 16 Sep 2025 15:25:44 +0000 (09:25 -0600)
The DWARF assembler treats the 'children' of a DIE as plain Tcl code,
evaluating it in the parent context.

I don't recall why, but when I wrote this code, I didn't do the same
thing for the attributes.  Instead, there I implemented a special
syntax.  I was looking at this today and wondered why I didn't just
use ordinary evaluation as well.

This patch implements this idea.  Attributes are now evaluated as
plain code.  This is a bit less "magical", is slightly shorter due to
lack of braces, and most importantly now allows comments in the
attributes section.

Note that some [subst {}] calls had to be added.  This could be fixed
by changing DWARF expressions to also be plain Tcl code.  I think that
would be a good idea, but I didn't want to tack it on here.

This patch requires the full ("DW_AT_...") name for attributes.  I did
this to avoid any possibility of name clashes.  I've long considered
that my original decision to allow short names for tags and attributes
was a mistake.  It's worth noting that many existing tests already
used the long names here.

Most of this patch was written by script.  The main changes are in
dwarf.exp, but as noted, there were some minor fixups needed in some
tests.

Also, after committing, 'git show' indicated some whitespace issues,
so I've gone through and "tabified" some things, which is why the
patch might be otherwise larger than it should be.  (This was
discussed a bit during the v1 submission.)

v1 was here:

https://inbox.sourceware.org/gdb-patches/20250530183845.2179955-1-tromey@adacore.com/

In v2 I've rebased and fixed up various tests that either changed or
were added since v1.

Regression tested on x86-64 Fedora 41.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
186 files changed:
gdb/testsuite/gdb.base/until-trailing-insns.exp
gdb/testsuite/gdb.compile/compile-ops.exp
gdb/testsuite/gdb.cp/call-method-register.exp
gdb/testsuite/gdb.cp/incomplete-type-overload.exp
gdb/testsuite/gdb.cp/nsalias.exp
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
gdb/testsuite/gdb.dlang/circular.exp
gdb/testsuite/gdb.dlang/dlang-start-2.exp
gdb/testsuite/gdb.dlang/watch-loc.exp
gdb/testsuite/gdb.dwarf2/DW_OP_piece_with_DW_OP_GNU_uninit.exp
gdb/testsuite/gdb.dwarf2/ada-array-bound.exp
gdb/testsuite/gdb.dwarf2/ada-cold-name.exp
gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
gdb/testsuite/gdb.dwarf2/ada-thick-pointer.exp
gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp
gdb/testsuite/gdb.dwarf2/arr-opt-out.exp
gdb/testsuite/gdb.dwarf2/arr-stride.exp
gdb/testsuite/gdb.dwarf2/arr-subrange.exp
gdb/testsuite/gdb.dwarf2/assign-variable-value-to-register.exp
gdb/testsuite/gdb.dwarf2/atomic-type.exp
gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp
gdb/testsuite/gdb.dwarf2/bad-regnum.exp
gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
gdb/testsuite/gdb.dwarf2/calling-convention.exp
gdb/testsuite/gdb.dwarf2/clang-cli-macro.exp
gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
gdb/testsuite/gdb.dwarf2/corrupt.exp
gdb/testsuite/gdb.dwarf2/count.exp
gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
gdb/testsuite/gdb.dwarf2/cu-empty-name.exp
gdb/testsuite/gdb.dwarf2/cu-no-addrs.exp
gdb/testsuite/gdb.dwarf2/data-loc.exp
gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp
gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp
gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp
gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
gdb/testsuite/gdb.dwarf2/debug-names.exp
gdb/testsuite/gdb.dwarf2/dw-form-ref-addr-with-type-units.exp
gdb/testsuite/gdb.dwarf2/dw-form-strx.exp.tcl
gdb/testsuite/gdb.dwarf2/dw2-align.exp
gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-abstract-origin.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
gdb/testsuite/gdb.dwarf2/dw2-bfloat16.exp
gdb/testsuite/gdb.dwarf2/dw2-complex-parts.exp
gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
gdb/testsuite/gdb.dwarf2/dw2-empty-file-name.exp
gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp
gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
gdb/testsuite/gdb.dwarf2/dw2-entry-value-2.exp
gdb/testsuite/gdb.dwarf2/dw2-epilogue-begin.exp.tcl
gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp
gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-forth-and-back.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-symbol.exp
gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
gdb/testsuite/gdb.dwarf2/dw2-lines.exp
gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp
gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.exp
gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-psym-warning.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp
gdb/testsuite/gdb.dwarf2/dw2-skipped-line-entries.exp
gdb/testsuite/gdb.dwarf2/dw2-step-between-different-inline-functions.exp
gdb/testsuite/gdb.dwarf2/dw2-step-between-inline-func-blocks.exp
gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp
gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp
gdb/testsuite/gdb.dwarf2/dw2-unexpected-entry-pc.exp
gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp
gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
gdb/testsuite/gdb.dwarf2/dw2-weird-type-len.exp
gdb/testsuite/gdb.dwarf2/dw2-wrong-mangled-name.exp
gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
gdb/testsuite/gdb.dwarf2/dwz-unused-pu.exp
gdb/testsuite/gdb.dwarf2/dwz.exp
gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl
gdb/testsuite/gdb.dwarf2/dwznolink.exp
gdb/testsuite/gdb.dwarf2/dyn-type-unallocated.exp
gdb/testsuite/gdb.dwarf2/dynamic-bit-offset.exp
gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
gdb/testsuite/gdb.dwarf2/enum-type.exp
gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp
gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp
gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
gdb/testsuite/gdb.dwarf2/fission-with-type-unit.exp
gdb/testsuite/gdb.dwarf2/formdata16.exp
gdb/testsuite/gdb.dwarf2/fortran-var-string.exp
gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp
gdb/testsuite/gdb.dwarf2/forward-spec.exp
gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
gdb/testsuite/gdb.dwarf2/implptrconst.exp
gdb/testsuite/gdb.dwarf2/implptrpiece.exp
gdb/testsuite/gdb.dwarf2/implref-array.exp
gdb/testsuite/gdb.dwarf2/implref-const.exp
gdb/testsuite/gdb.dwarf2/implref-global.exp
gdb/testsuite/gdb.dwarf2/implref-struct.exp
gdb/testsuite/gdb.dwarf2/imported-unit-abstract-const-value.exp
gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl
gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
gdb/testsuite/gdb.dwarf2/imported-unit.exp
gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp
gdb/testsuite/gdb.dwarf2/intbits.exp
gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp
gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp
gdb/testsuite/gdb.dwarf2/loclists-start-end.exp
gdb/testsuite/gdb.dwarf2/macro-complaints.exp
gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl
gdb/testsuite/gdb.dwarf2/main-subprogram.exp
gdb/testsuite/gdb.dwarf2/mega-enum.exp
gdb/testsuite/gdb.dwarf2/method-ptr.exp
gdb/testsuite/gdb.dwarf2/missing-line-table.exp
gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
gdb/testsuite/gdb.dwarf2/missing-type-name.exp
gdb/testsuite/gdb.dwarf2/multidictionary.exp
gdb/testsuite/gdb.dwarf2/nameless-enum.exp
gdb/testsuite/gdb.dwarf2/negative-data-member-location.exp
gdb/testsuite/gdb.dwarf2/nonvar-access.exp
gdb/testsuite/gdb.dwarf2/nostaticblock.exp
gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
gdb/testsuite/gdb.dwarf2/opt-out-not-implptr.exp
gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp
gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp
gdb/testsuite/gdb.dwarf2/rust-enum.exp
gdb/testsuite/gdb.dwarf2/self-spec.exp
gdb/testsuite/gdb.dwarf2/short-build-id.exp
gdb/testsuite/gdb.dwarf2/shortpiece.exp
gdb/testsuite/gdb.dwarf2/static-optimized-out.exp
gdb/testsuite/gdb.dwarf2/staticvirtual.exp
gdb/testsuite/gdb.dwarf2/struct-decl.exp
gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
gdb/testsuite/gdb.dwarf2/struct-with-sig.exp
gdb/testsuite/gdb.dwarf2/subrange-enum.exp
gdb/testsuite/gdb.dwarf2/subrange.exp
gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp
gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp
gdb/testsuite/gdb.dwarf2/symtab-producer.exp
gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp
gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
gdb/testsuite/gdb.dwarf2/utf-rust.exp
gdb/testsuite/gdb.dwarf2/var-access.exp
gdb/testsuite/gdb.dwarf2/variant.exp
gdb/testsuite/gdb.dwarf2/varval.exp
gdb/testsuite/gdb.dwarf2/void-type.exp
gdb/testsuite/gdb.python/py-linetable-empty.exp
gdb/testsuite/gdb.python/py-sym-artificial.exp
gdb/testsuite/gdb.reverse/map-to-same-line.exp
gdb/testsuite/gdb.trace/entry-values.exp
gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
gdb/testsuite/lib/dwarf.exp

index a3701f21ae46de21325ead8e634630512e73090c..cc28adcea29133ea19b391be90513590adf3c9cf 100644 (file)
@@ -100,16 +100,16 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name until-trailing-isns.c}
-           {stmt_list $L DW_FORM_sec_offset}
-           {low_pc 0 addr}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name until-trailing-isns.c
+           DW_AT_stmt_list $L DW_FORM_sec_offset
+           DW_AT_low_pc 0 addr
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc $main_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_len DW_FORM_data4
            }
        }
     }
index 410d5a435537300983c30c347cef368e087ad669..9633551e8e024d271779d0a9b7957e26e579ded6 100644 (file)
@@ -375,36 +375,36 @@ Dwarf::assemble $asm_file {
        declare_labels int_label
 
        compile_unit {
-           {name file1.txt}
-           {language @DW_LANG_C}
-           {low_pc $func_start addr}
-           {high_pc $func_end addr}
+           DW_AT_name file1.txt
+           DW_AT_language @DW_LANG_C
+           DW_AT_low_pc $func_start addr
+           DW_AT_high_pc $func_end addr
        } {
            global program
 
            int_label: base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            subprogram {
-               {external 1 flag}
-               {name func}
-               {low_pc $func_start addr}
-               {high_pc $func_end addr}
+               DW_AT_external 1 flag
+               DW_AT_name func
+               DW_AT_low_pc $func_start addr
+               DW_AT_high_pc $func_end addr
            } {
                formal_parameter {
-                   {name param}
-                   {variable_parameter 1 flag}
-                   {type :$int_label}
-                   {location $program SPECIAL_expr}
+                   DW_AT_name param
+                   DW_AT_variable_parameter 1 flag
+                   DW_AT_type :$int_label
+                   DW_AT_location $program SPECIAL_expr
                }
 
                formal_parameter {
-                   {name optimized_out}
-                   {variable_parameter 1 flag}
-                   {type :$int_label}
+                   DW_AT_name optimized_out
+                   DW_AT_variable_parameter 1 flag
+                   DW_AT_type :$int_label
                }
            }
        }
index dfd3ce0838d4f5dd9f77719d8606e8c063337c3b..b736312a65e4a6aa0360ed19a1055b960a8e16c7 100644 (file)
@@ -45,59 +45,59 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
-           {DW_AT_name     $::srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name      $::srcfile
+           DW_AT_comp_dir /tmp
        } {
            declare_labels int_type_label struct_type_label \
                struct_ptr_type_label
            set ptr_size [get_sizeof "void *" 96]
 
            DW_TAG_subprogram {
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc $main_length data8}
-               {DW_AT_type :$int_type_label}
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_length data8
+               DW_AT_type :$int_type_label
            }
 
            int_type_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
 
            struct_type_label: DW_TAG_structure_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_name small}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_name small
            } {
                member {
-                   {name xxx}
-                   {type :$int_type_label}
-                   {data_member_location 0 data1}
+                   DW_AT_name xxx
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_member_location 0 data1
                }
                subprogram {
-                   {name yyy}
-                   {type :$int_type_label}
+                   DW_AT_name yyy
+                   DW_AT_type :$int_type_label
                } {
                    formal_parameter {
-                       {type :$struct_ptr_type_label}
-                       {artificial 1 flag_present}
+                       DW_AT_type :$struct_ptr_type_label
+                       DW_AT_artificial 1 flag_present
                    }
                }
            }
 
            struct_ptr_type_label: DW_TAG_pointer_type {
-               {DW_AT_byte_size $ptr_size DW_FORM_data1}
-               {type :$struct_type_label}
+               DW_AT_byte_size $ptr_size DW_FORM_data1
+               DW_AT_type :$struct_type_label
            }
 
            DW_TAG_variable {
-               {DW_AT_name global_var}
-               {DW_AT_type :$struct_type_label}
-               {DW_AT_location {
+               DW_AT_name global_var
+               DW_AT_type :$struct_type_label
+               DW_AT_location {
                    DW_OP_reg0
-               } SPECIAL_expr}
-               {external 1 flag}
+               } SPECIAL_expr
+               DW_AT_external 1 flag
            }
        }
     }
index aa51fd9054d84343d7fd7c2b86d1a4033e8b3896..aa582e01406008a1d9ab479519d30a66eaf5cf8c 100644 (file)
@@ -57,105 +57,109 @@ Dwarf::assemble ${asm_file} {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
-           {name $srcfile}
-           {stmt_list $L DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name $srcfile
+           DW_AT_stmt_list $L DW_FORM_sec_offset
        } {
            declare_labels int_label base_label complete_label incomplete_label
            declare_labels ptr_base_label ptr_inc_label ptr_comp_label ptr_int_label
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "int"}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            base_label: DW_TAG_class_type {
-               {DW_AT_byte_size $struct_base_size DW_FORM_sdata}
-               {DW_AT_name "base"}
+               DW_AT_byte_size $struct_base_size DW_FORM_sdata
+               DW_AT_name "base"
            } {
                DW_TAG_member {
-                   {DW_AT_name "member"}
-                   {DW_AT_type :$int_label}
-                   {DW_AT_data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name "member"
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
            }
 
            complete_label: DW_TAG_class_type {
-               {DW_AT_byte_size $struct_complete_size DW_FORM_sdata}
-               {DW_AT_name "complete"}
+               DW_AT_byte_size $struct_complete_size DW_FORM_sdata
+               DW_AT_name "complete"
            } {
                DW_TAG_inheritance {
-                   {DW_AT_type :$base_label}
-                   {DW_AT_data_member_location 0 DW_FORM_sdata}
-                   {DW_AT_accessibility 1 DW_FORM_data1}
+                   DW_AT_type :$base_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
+                   DW_AT_accessibility 1 DW_FORM_data1
                }
            }
 
            incomplete_label: DW_TAG_class_type {
-               {DW_AT_name "incomplete"}
-               {DW_AT_declaration 1 DW_FORM_flag_present}
+               DW_AT_name "incomplete"
+               DW_AT_declaration 1 DW_FORM_flag_present
            }
 
            ptr_base_label: DW_TAG_pointer_type {
-               {DW_AT_byte_size $addr_size DW_FORM_udata}
-               {DW_AT_type :$base_label}
+               DW_AT_byte_size $addr_size DW_FORM_udata
+               DW_AT_type :$base_label
            }
 
            ptr_inc_label: DW_TAG_pointer_type {
-               {DW_AT_byte_size $addr_size DW_FORM_udata}
-               {DW_AT_type :$incomplete_label}
+               DW_AT_byte_size $addr_size DW_FORM_udata
+               DW_AT_type :$incomplete_label
            }
 
            ptr_comp_label: DW_TAG_pointer_type {
-               {DW_AT_byte_size $addr_size DW_FORM_udata}
-               {DW_AT_type :$complete_label}
+               DW_AT_byte_size $addr_size DW_FORM_udata
+               DW_AT_type :$complete_label
            }
 
            ptr_int_label: DW_TAG_pointer_type {
-               {DW_AT_byte_size $addr_size DW_FORM_udata}
-               {DW_AT_type :$int_label}
+               DW_AT_byte_size $addr_size DW_FORM_udata
+               DW_AT_type :$int_label
            }
 
        DW_TAG_variable {
-           {DW_AT_name "comp"}
-           {DW_AT_type :$complete_label}
-           {DW_AT_location {DW_OP_addr [gdb_target_symbol "comp"]} SPECIAL_expr}
-           {DW_AT_external 1 DW_FORM_flag}
+           DW_AT_name "comp"
+           DW_AT_type :$complete_label
+           DW_AT_location [subst {DW_OP_addr [gdb_target_symbol "comp"]}] \
+               SPECIAL_expr
+           DW_AT_external 1 DW_FORM_flag
        }
 
        DW_TAG_variable {
-           {DW_AT_name "cp"}
-           {DW_AT_type :$ptr_comp_label}
-           {DW_AT_location {DW_OP_addr [gdb_target_symbol "cp"]} SPECIAL_expr}
-           {DW_AT_external 1 DW_FORM_flag}
+           DW_AT_name "cp"
+           DW_AT_type :$ptr_comp_label
+           DW_AT_location [subst {DW_OP_addr [gdb_target_symbol "cp"]}] \
+               SPECIAL_expr
+           DW_AT_external 1 DW_FORM_flag
        }
 
        DW_TAG_variable {
-           {DW_AT_name "inc"}
-           {DW_AT_type :$ptr_inc_label}
-           {DW_AT_location {DW_OP_addr [gdb_target_symbol "inc"]} SPECIAL_expr}
-           {DW_AT_external 1 DW_FORM_flag}
+           DW_AT_name "inc"
+           DW_AT_type :$ptr_inc_label
+           DW_AT_location [subst {DW_OP_addr [gdb_target_symbol "inc"]}] \
+               SPECIAL_expr
+           DW_AT_external 1 DW_FORM_flag
        }
 
        DW_TAG_variable {
-           {DW_AT_name "ip"}
-           {DW_AT_type :$ptr_int_label}
-           {DW_AT_location {DW_OP_addr [gdb_target_symbol "ip"]} SPECIAL_expr}
-           {DW_AT_external 1 DW_FORM_flag}
+           DW_AT_name "ip"
+           DW_AT_type :$ptr_int_label
+           DW_AT_location [subst {DW_OP_addr [gdb_target_symbol "ip"]}] \
+               SPECIAL_expr
+           DW_AT_external 1 DW_FORM_flag
        }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func {"main"}}
-               {DW_AT_external 1 flag}
+               MACRO_AT_func {"main"}
+               DW_AT_external 1 flag
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {"foo"}}
-               {DW_AT_type :$int_label}
-               {DW_AT_external 1 flag}
+               MACRO_AT_func {"foo"}
+               DW_AT_type :$int_label
+               DW_AT_external 1 flag
            } { formal_parameter {
-                   {DW_AT_name "b"}
-                   {DW_AT_type :$ptr_base_label}
+                   DW_AT_name "b"
+                   DW_AT_type :$ptr_base_label
                }
            }
        }
index a145410e5b82930e7057a6ab3eb38b2fa648eace..7ad2da8019016c9181028dadf7a202742e07d6c8 100644 (file)
@@ -56,111 +56,113 @@ standard_testfile .cc nsalias-dw.S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       compile_unit {{language @DW_LANG_C_plus_plus}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C_plus_plus
+       } {
            declare_labels int_label outer_label inner_label innermost_label
            declare_labels im_foo_label i_foo_label o_foo_label
            declare_labels OuterInner_label oi1_label oi2_label
 
            int_label: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            outer_label: DW_TAG_namespace {
-               {name outer}
+               DW_AT_name outer
            } {
                inner_label: DW_TAG_namespace {
-                   {name inner}
+                   DW_AT_name inner
                } {
                    innermost_label: DW_TAG_namespace {
-                       {name innermost}
+                       DW_AT_name innermost
                    } {
                        DW_TAG_variable {
-                           {name x}
-                           {type :$int_label}
-                           {const_value 2 DW_FORM_data1}
+                           DW_AT_name x
+                           DW_AT_type :$int_label
+                           DW_AT_const_value 2 DW_FORM_data1
                        }
 
                        im_foo_label: DW_TAG_subprogram {
-                           {name foo}
-                           {external 1 flag_present}
-                           {declaration 1 flag_present}
+                           DW_AT_name foo
+                           DW_AT_external 1 flag_present
+                           DW_AT_declaration 1 flag_present
                        }
                    }
 
                    imported_declaration {
-                       {name Innermost}
-                       {import :$innermost_label}
+                       DW_AT_name Innermost
+                       DW_AT_import :$innermost_label
                    }
 
                    DW_TAG_variable {
-                       {name x}
-                       {type :$int_label}
-                       {const_value 1 DW_FORM_data1}
+                       DW_AT_name x
+                       DW_AT_type :$int_label
+                       DW_AT_const_value 1 DW_FORM_data1
                    }
 
                    i_foo_label: subprogram {
-                       {name foo}
-                       {external 1 flag_present}
-                       {declaration 1 flag_present}
+                       DW_AT_name foo
+                       DW_AT_external 1 flag_present
+                       DW_AT_declaration 1 flag_present
                    }
                }
 
                OuterInner_label: imported_declaration {
-                   {name Inner}
-                   {import :$inner_label}
+                   DW_AT_name Inner
+                   DW_AT_import :$inner_label
                }
 
                DW_TAG_variable {
-                   {name x}
-                   {type :$int_label}
-                   {const_value 0 DW_FORM_data1}
+                   DW_AT_name x
+                   DW_AT_type :$int_label
+                   DW_AT_const_value 0 DW_FORM_data1
                }
 
                o_foo_label: subprogram {
-                   {name foo}
-                   {external 1 flag_present}
-                   {declaration 1 flag_present}
+                   DW_AT_name foo
+                   DW_AT_external 1 flag_present
+                   DW_AT_declaration 1 flag_present
                }
            }
 
            imported_declaration {
-               {name Outer}
-               {import :$outer_label}
+               DW_AT_name Outer
+               DW_AT_import :$outer_label
            }
 
            oi1_label: imported_declaration {
-               {name oi1}
-               {import :$OuterInner_label}
+               DW_AT_name oi1
+               DW_AT_import :$OuterInner_label
            }
 
            oi2_label: imported_declaration {
-               {name oi2}
-               {import :$oi1_label}
+               DW_AT_name oi2
+               DW_AT_import :$oi1_label
            }
 
            imported_declaration {
-               {name oi3}
-               {import :$oi2_label}
+               DW_AT_name oi3
+               DW_AT_import :$oi2_label
            }
 
            subprogram {
-               {specification :$im_foo_label}
-               {low_pc 0x4 DW_FORM_addr}
-               {high_pc 0x7 DW_FORM_addr}
+               DW_AT_specification :$im_foo_label
+               DW_AT_low_pc 0x4 DW_FORM_addr
+               DW_AT_high_pc 0x7 DW_FORM_addr
            }
 
            subprogram {
-               {specification :$i_foo_label}
-               {low_pc 0x8 DW_FORM_addr}
-               {high_pc 0xb DW_FORM_addr}
+               DW_AT_specification :$i_foo_label
+               DW_AT_low_pc 0x8 DW_FORM_addr
+               DW_AT_high_pc 0xb DW_FORM_addr
            }
 
            subprogram {
-               {specification :$o_foo_label}
-               {low_pc 0xc DW_FORM_addr}
-               {high_pc 0xf DW_FORM_addr}
+               DW_AT_specification :$o_foo_label
+               DW_AT_low_pc 0xc DW_FORM_addr
+               DW_AT_high_pc 0xf DW_FORM_addr
            }
        }
     }
@@ -253,19 +255,19 @@ set imports {
     declare_labels n0_label
 
     n0_label: DW_TAG_namespace {
-       {name n0}
+       DW_AT_name n0
     } {
        DW_TAG_variable {
-           {name x}
-           {type :$int_label}
-           {const_value 3 DW_FORM_data1}
+           DW_AT_name x
+           DW_AT_type :$int_label
+           DW_AT_const_value 3 DW_FORM_data1
        }
     }
 
     declare_labels n0_import
     n0_import: imported_declaration {
-       {name N0}
-       {import :$n0_label}
+       DW_AT_name N0
+       DW_AT_import :$n0_label
     }
 }
 
@@ -273,8 +275,8 @@ for {set i 1} {$i <= 100} {incr i} {
     append imports [format "
        declare_labels n%d_import
        n%d_import: imported_declaration {
-           {name N%d}
-           {import :\$n%d_import}
+           DW_AT_name N%d
+           DW_AT_import :\$n%d_import
        }" $i $i $i [expr {$i - 1}]]
 }
 
@@ -283,13 +285,15 @@ standard_testfile .cc nsalias-r-dw.S
 set asm_file [standard_output_file $srcfile2]
 set the_dwarf [format {
     cu {} {
-       compile_unit {{language @DW_LANG_C_plus_plus}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C_plus_plus
+       } {
            declare_labels int_label n0_label
 
            int_label: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
 %s
index 569519be66a317d1eb520f30da3f3bc8a14b01ae..292be705f05ce915373b7c6551d2f8652bde0b2f 100644 (file)
@@ -56,7 +56,7 @@ proc write_just_debugaltlink {filename dwzname buildid} {
        # Only the DWARF reader checks .gnu_debugaltlink, so make sure
        # there is a bit of DWARF in here.
        cu {} {
-           compile_unit {{language @DW_LANG_C}} {
+           compile_unit {DW_AT_language @DW_LANG_C} {
            }
        }
     }
@@ -76,17 +76,19 @@ proc write_dwarf_file {filename buildid {value 99}} {
        build_id $buildid
 
        cu {} {
-           compile_unit {{language @DW_LANG_C}} {
+           compile_unit {
+               DW_AT_language @DW_LANG_C
+           } {
                int_label2: base_type {
-                   {name int}
-                   {byte_size 4 sdata}
-                   {encoding @DW_ATE_signed}
+                   DW_AT_name int
+                   DW_AT_byte_size 4 sdata
+                   DW_AT_encoding @DW_ATE_signed
                }
 
                constant {
-                   {name the_int}
-                   {type :$int_label2}
-                   {const_value $value data1}
+                   DW_AT_name the_int
+                   DW_AT_type :$int_label2
+                   DW_AT_const_value $value data1
                }
            }
        }
index e31894594b97d09636477ddec850476497038679..cc79062ea6d189f8a3371a283affb07c7d8252d4 100644 (file)
@@ -27,98 +27,98 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {language @DW_LANG_D}
+           DW_AT_language @DW_LANG_D
        } {
            declare_labels circular1_label circular2_label circular3_label
            declare_labels circular4_label circular5_label
 
            circular1_label: module {
-               {name circular1}
+               DW_AT_name circular1
            } {
                imported_module {
-                   {import :$circular2_label}
+                   DW_AT_import :$circular2_label
                }
                imported_module {
-                   {import :$circular3_label}
+                   DW_AT_import :$circular3_label
                }
                imported_module {
-                   {import :$circular4_label}
+                   DW_AT_import :$circular4_label
                }
                imported_module {
-                   {import :$circular5_label}
+                   DW_AT_import :$circular5_label
                }
 
                subprogram {
-                   {external 1 flag_present}
-                   {MACRO_AT_func {found}}
+                   DW_AT_external 1 flag_present
+                   MACRO_AT_func {found}
                }
            }
 
            circular2_label: module {
-               {name circular2}
+               DW_AT_name circular2
            } {
                imported_module {
-                   {import :$circular1_label}
+                   DW_AT_import :$circular1_label
                }
                imported_module {
-                   {import :$circular3_label}
+                   DW_AT_import :$circular3_label
                }
                imported_module {
-                   {import :$circular4_label}
+                   DW_AT_import :$circular4_label
                }
                imported_module {
-                   {import :$circular5_label}
+                   DW_AT_import :$circular5_label
                }
            }
 
            circular3_label: module {
-               {name circular3}
+               DW_AT_name circular3
            } {
                imported_module {
-                   {import :$circular1_label}
+                   DW_AT_import :$circular1_label
                }
                imported_module {
-                   {import :$circular2_label}
+                   DW_AT_import :$circular2_label
                }
                imported_module {
-                   {import :$circular4_label}
+                   DW_AT_import :$circular4_label
                }
                imported_module {
-                   {import :$circular5_label}
+                   DW_AT_import :$circular5_label
                }
            }
 
            circular4_label: module {
-               {name circular4}
+               DW_AT_name circular4
            } {
                imported_module {
-                   {import :$circular1_label}
+                   DW_AT_import :$circular1_label
                }
                imported_module {
-                   {import :$circular2_label}
+                   DW_AT_import :$circular2_label
                }
                imported_module {
-                   {import :$circular3_label}
+                   DW_AT_import :$circular3_label
                }
                imported_module {
-                   {import :$circular5_label}
+                   DW_AT_import :$circular5_label
                }
            }
 
            circular5_label: module {
-               {name circular5}
+               DW_AT_name circular5
            } {
                imported_module {
-                   {import :$circular1_label}
+                   DW_AT_import :$circular1_label
                }
                imported_module {
-                   {import :$circular2_label}
+                   DW_AT_import :$circular2_label
                }
                imported_module {
-                   {import :$circular3_label}
+                   DW_AT_import :$circular3_label
                }
                imported_module {
-                   {import :$circular4_label}
+                   DW_AT_import :$circular4_label
                }
            }
        }
index 403dcfd1ed8a26da42881493d60407d22c2c4515..b5c054256a327b941ebc2079d6a4c238f8490377 100644 (file)
@@ -40,24 +40,24 @@ Dwarf::assemble $asm_file {
 
     cu { label cu_start } {
        compile_unit {
-           {language @DW_LANG_D}
+           DW_AT_language @DW_LANG_D
        } {
            module {
-               {name dmain}
+               DW_AT_name dmain
            }
            subprogram {
-               {name "D main" }
-               {MIPS_linkage_name "_Dmain"}
-               {low_pc $dmain_start DW_FORM_addr}
-               {high_pc "$dmain_start + $dmain_length" DW_FORM_addr}
-               {external 1 flag_present}
+               DW_AT_name "D main"
+               DW_AT_MIPS_linkage_name "_Dmain"
+               DW_AT_low_pc $dmain_start DW_FORM_addr
+               DW_AT_high_pc "$dmain_start + $dmain_length" DW_FORM_addr
+               DW_AT_external 1 flag_present
            }
            subprogram {
-               {name "dmain._d_cmain!().main" }
-               {MIPS_linkage_name "main"}
-               {low_pc $main_start DW_FORM_addr}
-               {high_pc "$main_start + $main_length" DW_FORM_addr}
-               {external 1 flag_present}
+               DW_AT_name "dmain._d_cmain!().main"
+               DW_AT_MIPS_linkage_name "main"
+               DW_AT_low_pc $main_start DW_FORM_addr
+               DW_AT_high_pc "$main_start + $main_length" DW_FORM_addr
+               DW_AT_external 1 flag_present
            }
        }
     }
index ec50e91a478454e42ab972704bccabd500ba7fed..7cfc539f6a35b17510b12a046af58a8d36109f54 100644 (file)
@@ -33,30 +33,30 @@ Dwarf::assemble $asm_file {
 
     cu { label cu_start } {
        compile_unit {
-           {language @DW_LANG_D}
+           DW_AT_language @DW_LANG_D
        } {
            declare_labels watch_module_label watch_struct_label
 
            watch_module_label: module {
-               {name watch}
+               DW_AT_name watch
            } {
                watch_struct_label: structure_type {
-                   {name tstruct}
-                   {byte_size 1 data1}
+                   DW_AT_name tstruct
+                   DW_AT_byte_size 1 data1
                }
 
                tag_variable {
-                   {name my_data}
-                   {type :$watch_struct_label}
-                   {location {
+                   DW_AT_name my_data
+                   DW_AT_type :$watch_struct_label
+                   DW_AT_location [subst {
                        addr [gdb_target_symbol my_data]
-                   } SPECIAL_expr}
-                   {external 1 flag}
+                   }] SPECIAL_expr
+                   DW_AT_external 1 flag
                }
 
                subprogram {
-                   {MACRO_AT_func { "_Dmain" }}
-                   {external 1 flag_present}
+                   MACRO_AT_func { "_Dmain" }
+                   DW_AT_external 1 flag_present
                }
            }
        }
index 673520774159f0090ac344e347e957e6508bd188..291bc83e667ccabbe22cbae6183ca03327c7b04e 100644 (file)
@@ -35,37 +35,37 @@ Dwarf::assemble $asm_file {
            declare_labels i64_type i32_type
 
            i64_type: base_type {
-               {name "int64_t"}
-               {encoding @DW_ATE_signed}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name "int64_t"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 8 DW_FORM_sdata
            }
 
            i32_type: base_type {
-               {name "int32_t"}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name "int32_t"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            DW_TAG_variable {
-               {name i64_var}
-               {type :$i64_type}
-               {location {
+               DW_AT_name i64_var
+               DW_AT_type :$i64_type
+               DW_AT_location [subst {
                    DW_OP_constu $::c64
                    DW_OP_stack_value
                    DW_OP_GNU_uninit
                    DW_OP_piece 8
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {name i32_var}
-               {type :$i32_type}
-               {location {
+               DW_AT_name i32_var
+               DW_AT_type :$i32_type
+               DW_AT_location [subst {
                    DW_OP_constu $::c32
                    DW_OP_stack_value
                    DW_OP_GNU_uninit
                    DW_OP_piece 4
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
        }
     }
index f48df7baf1f27df4a58c9f39bb7bdba97f2c5573..779ce009e211dcc99744c95cd94a059fb23801f8 100644 (file)
@@ -31,49 +31,50 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_language @DW_LANG_Ada95}
-               {DW_AT_name     $srcfile}
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name  $srcfile
        } {
            declare_labels byte array disc struct
 
            byte: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_unsigned}
-               {DW_AT_name      byte}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_unsigned
+               DW_AT_name       byte
            }
 
            array: DW_TAG_array_type {
-               {DW_AT_name array_type}
-               {DW_AT_type :$byte}
+               DW_AT_name array_type
+               DW_AT_type :$byte
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$byte}
-                   {DW_AT_upper_bound :$disc}
+                   DW_AT_type         :$byte
+                   DW_AT_upper_bound :$disc
                }
            }
 
            struct: DW_TAG_structure_type {
-               {DW_AT_name discriminated}
-               {DW_AT_byte_size 4 DW_FORM_sdata}
+               DW_AT_name discriminated
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                disc: DW_TAG_member {
-                   {DW_AT_name disc}
-                   {DW_AT_type :$byte}
-                   {DW_AT_data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name disc
+                   DW_AT_type :$byte
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
                DW_TAG_member {
-                   {DW_AT_name nums}
-                   {DW_AT_type :$array}
-                   {DW_AT_data_member_location 1 DW_FORM_sdata}
+                   DW_AT_name nums
+                   DW_AT_type :$array
+                   DW_AT_data_member_location 1 DW_FORM_sdata
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name "value"}
-               {DW_AT_type :$struct}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "our_data"]}
-                   SPECIAL_expr}
+               DW_AT_name "value"
+               DW_AT_type :$struct
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location \
+                   [subst {DW_OP_addr [gdb_target_symbol "our_data"]}] \
+                   SPECIAL_expr
            }
        }
     }
index c5758c2f210146b2dfc2bef8216b7306f202725b..35203199147cb39b0df189ad7d0044f2834c8d62 100644 (file)
@@ -30,28 +30,28 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
         } {
            declare_labels b_l
 
            b_l: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      bool}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      bool
            }
 
             DW_TAG_subprogram {
-                {name pck__xtra__function.cold}
-               {MACRO_AT_range {first}}
-                {type :$b_l}
+               DW_AT_name pck__xtra__function.cold
+               MACRO_AT_range {first}
+               DW_AT_type :$b_l
            }
 
             DW_TAG_subprogram {
-                {name pck__xtra__function}
-                {MACRO_AT_range {second}}
-                {type :$b_l}
+               DW_AT_name pck__xtra__function
+               MACRO_AT_range {second}
+               DW_AT_type :$b_l
            }
        }
     }
index 9f2061c0a951b4788435fd4d8a2de18de640effd..915f47ebaaf7a918a69a05e667d2d548e3e7ea31 100644 (file)
@@ -31,31 +31,31 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
 
         } {
            declare_labels b_l
 
            b_l: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      bool}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      bool
            }
            # Here the name comes first and the linkage name second.
             DW_TAG_subprogram {
-                {name system__namefirst}
-               {linkage_name __gnat_namefirst}
-               {MACRO_AT_range {first}}
-                {type :$b_l}
+               DW_AT_name system__namefirst
+               DW_AT_linkage_name __gnat_namefirst
+               MACRO_AT_range {first}
+               DW_AT_type :$b_l
            }
            # Here the linkage name comes first and the name second.
             DW_TAG_subprogram {
-               {linkage_name __gnat_namesecond}
-                {name system__namesecond}
-                {MACRO_AT_range {second}}
-                {type :$b_l}
+               DW_AT_linkage_name __gnat_namesecond
+               DW_AT_name system__namesecond
+               MACRO_AT_range {second}
+               DW_AT_type :$b_l
            }
        }
     }
index 5032252230d3b4062f22de441c141b2953bdca91..0efb8cbf233b4bfb161ccf634d463b5f048961e8 100644 (file)
@@ -31,53 +31,53 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     $srcfile}
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     $srcfile
         } {
            declare_labels integer array array_pointer bounds_pointer
 
             integer: DW_TAG_base_type {
-                {DW_AT_byte_size 8 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      integer}
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
             }
 
            array: DW_TAG_array_type {
-               {DW_AT_name array_type}
-               {DW_AT_type :$integer}
+               DW_AT_name array_type
+               DW_AT_type :$integer
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer}
-                   {DW_AT_lower_bound 1 DW_FORM_data1}
-                   {DW_AT_upper_bound 7 DW_FORM_data1}
+                   DW_AT_type        :$integer
+                   DW_AT_lower_bound 1 DW_FORM_data1
+                   DW_AT_upper_bound 7 DW_FORM_data1
                }
            }
 
            array_pointer: DW_TAG_pointer_type {
-               {DW_AT_type :$array}
-               {DW_AT_byte_size 8 DW_FORM_sdata}
+               DW_AT_type :$array
+               DW_AT_byte_size 8 DW_FORM_sdata
            }
 
            # This isn't exactly what GNAT emits, but it doesn't
            # matter.
            bounds_pointer: DW_TAG_pointer_type {
-               {DW_AT_type :$integer}
-               {DW_AT_byte_size 8 DW_FORM_sdata}
+               DW_AT_type :$integer
+               DW_AT_byte_size 8 DW_FORM_sdata
            }
 
            DW_TAG_structure_type {
-               {DW_AT_name thick_pointer_type}
-               {DW_AT_byte_size 8 DW_FORM_sdata}
+               DW_AT_name thick_pointer_type
+               DW_AT_byte_size 8 DW_FORM_sdata
            } {
                DW_TAG_member {
-                   {DW_AT_name P_ARRAY}
-                   {DW_AT_type :$array_pointer}
-                   {DW_AT_data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name P_ARRAY
+                   DW_AT_type :$array_pointer
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
                DW_TAG_member {
-                   {DW_AT_name P_BOUNDS}
-                   {DW_AT_type :$bounds_pointer}
-                   {DW_AT_data_member_location 8 DW_FORM_sdata}
+                   DW_AT_name P_BOUNDS
+                   DW_AT_type :$bounds_pointer
+                   DW_AT_data_member_location 8 DW_FORM_sdata
                }
            }
        }
index e1a76bff6a6d34ffc103ff6b67d58293b36d7b6a..a7544265da89075e4c590fc3b4c1122f44132c31 100644 (file)
@@ -35,10 +35,10 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     fd.adb}
-                {DW_AT_comp_dir /tmp}
+       DW_TAG_compile_unit {
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     fd.adb
+           DW_AT_comp_dir /tmp
         } {
            declare_labels array_elt_label integer_label array_label \
                 typedef_label ref_type_label
@@ -48,8 +48,8 @@ Dwarf::assemble $asm_file {
             # A structure with no size attribute, to mimick structures
             # in Ada that have a dynamic size...
             array_elt_label: structure_type {
-                {name fd__Tints_doubledC}
-                {artificial 1 DW_FORM_flag_present}
+               DW_AT_name fd__Tints_doubledC
+               DW_AT_artificial 1 DW_FORM_flag_present
             }
 
             # ... and a corresponding XVZ variable, supposed to be there
@@ -58,44 +58,44 @@ Dwarf::assemble $asm_file {
             # it has been optimized out (which the compiler can do,
             # even if it at the expense of debuggability).
             DW_TAG_variable {
-                {name fd__Tints_doubledC___XVZ}
-                {DW_AT_type :$integer_label}
-                {artificial 1 DW_FORM_flag_present}
+               DW_AT_name fd__Tints_doubledC___XVZ
+               DW_AT_type :$integer_label
+               DW_AT_artificial 1 DW_FORM_flag_present
             }
 
             integer_label: DW_TAG_base_type {
-                {DW_AT_byte_size $int_size DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      integer}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
             }
 
            array_label: DW_TAG_array_type {
-               {DW_AT_name fd__ints_doubled}
-               {DW_AT_type :$array_elt_label}
+               DW_AT_name fd__ints_doubled
+               DW_AT_type :$array_elt_label
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer_label}
-                   {DW_AT_upper_bound 2 DW_FORM_data1}
+                   DW_AT_type        :$integer_label
+                   DW_AT_upper_bound 2 DW_FORM_data1
                }
            }
 
             typedef_label: DW_TAG_typedef {
-                {DW_AT_name fd__ints_doubled}
-                {DW_AT_type :$array_label}
+               DW_AT_name fd__ints_doubled
+               DW_AT_type :$array_label
             }
 
             ref_type_label: DW_TAG_reference_type {
-                {DW_AT_byte_size $ptr_size DW_FORM_sdata}
-                {DW_AT_type :$typedef_label}
+               DW_AT_byte_size $ptr_size DW_FORM_sdata
+               DW_AT_type :$typedef_label
             }
 
             DW_TAG_variable {
-                {name fd__global}
-                {DW_AT_type :$ref_type_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol fd__global]
-                } SPECIAL_expr}
-                {external 1 flag}
+               DW_AT_name fd__global
+               DW_AT_type :$ref_type_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol fd__global]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
             }
 
        }
index 6bbfef29052543062a48f09447eee36daec3f081..d3ccec8af67a684a2b9599c3a66fab7d16ebddbd 100644 (file)
@@ -29,51 +29,51 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_Ada95}
-           {DW_AT_name     foo.adb}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name      foo.adb
+           DW_AT_comp_dir /tmp
        } {
            declare_labels integer_label array_label \
                low_bound_label high_bound_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_signed
+               DW_AT_name       integer
            }
 
            # Note that the bounds don't have a location -- they are
            # optimized out.  This mimics what it is seen sometimes in
            # the wild with optimized Ada code.
            low_bound_label: DW_TAG_variable {
-               {DW_AT_name pck__table___L}
-               {DW_AT_type :$integer_label}
-               {DW_AT_declaration 1 flag}
+               DW_AT_name pck__table___L
+               DW_AT_type :$integer_label
+               DW_AT_declaration 1 flag
            }
            high_bound_label: DW_TAG_variable {
-               {DW_AT_name pck__table___U}
-               {DW_AT_type :$integer_label}
-               {DW_AT_declaration 1 flag}
+               DW_AT_name pck__table___U
+               DW_AT_type :$integer_label
+               DW_AT_declaration 1 flag
            }
 
            array_label: DW_TAG_array_type {
-               {DW_AT_name pck__table}
-               {DW_AT_type :$integer_label}
+               DW_AT_name pck__table
+               DW_AT_type :$integer_label
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer_label}
-                   {DW_AT_lower_bound :$low_bound_label}
-                   {DW_AT_upper_bound :$high_bound_label}
+                   DW_AT_type         :$integer_label
+                   DW_AT_lower_bound :$low_bound_label
+                   DW_AT_upper_bound :$high_bound_label
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name the_table}
-               {DW_AT_type :$array_label}
-               {DW_AT_location {
+               DW_AT_name the_table
+               DW_AT_type :$array_label
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol global_array]
-               } SPECIAL_expr}
-               {DW_AT_external 1 flag}
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
            }
        }
     }
index be0fdf32ba8512aeb62f7694e9e02e95f965eb40..bad1ffe4e9b169e95a38541e121bfb9029b5b805 100644 (file)
@@ -24,86 +24,86 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     foo.adb}
-                {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     foo.adb
+           DW_AT_comp_dir /tmp
         } {
            declare_labels integer_label array_elt_label array_label \
                 big_array_label struct_label
 
             integer_label: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
             }
 
             array_elt_label: DW_TAG_subrange_type {
-                {DW_AT_lower_bound 0xe0 DW_FORM_data1}
-                {DW_AT_upper_bound 0x1f DW_FORM_data1}
-                {DW_AT_name        pck__item}
-                {DW_AT_type        :$integer_label}
+               DW_AT_lower_bound 0xe0 DW_FORM_data1
+               DW_AT_upper_bound 0x1f DW_FORM_data1
+               DW_AT_name        pck__item
+               DW_AT_type        :$integer_label
             }
 
             DW_TAG_typedef {
-                {DW_AT_name pck__table}
-                {DW_AT_type :$array_label}
+               DW_AT_name pck__table
+               DW_AT_type :$array_label
             }
 
            array_label: DW_TAG_array_type {
-               {DW_AT_name pck__table}
-                {DW_AT_bit_stride 6 DW_FORM_data1}
-               {DW_AT_type :$array_elt_label}
+               DW_AT_name pck__table
+               DW_AT_bit_stride 6 DW_FORM_data1
+               DW_AT_type :$array_elt_label
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer_label}
-                   {DW_AT_lower_bound 0 DW_FORM_data1}
-                   {DW_AT_upper_bound 4 DW_FORM_data1}
+                   DW_AT_type        :$integer_label
+                   DW_AT_lower_bound 0 DW_FORM_data1
+                   DW_AT_upper_bound 4 DW_FORM_data1
                }
            }
 
             DW_TAG_typedef {
-                {DW_AT_name pck__big_table}
-                {DW_AT_type :$big_array_label}
+               DW_AT_name pck__big_table
+               DW_AT_type :$big_array_label
             }
 
            big_array_label: DW_TAG_array_type {
-               {DW_AT_name pck__big_table}
-                {DW_AT_byte_stride 1 DW_FORM_data1}
-               {DW_AT_type :$array_elt_label}
+               DW_AT_name pck__big_table
+               DW_AT_byte_stride 1 DW_FORM_data1
+               DW_AT_type :$array_elt_label
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer_label}
-                   {DW_AT_lower_bound 0 DW_FORM_data1}
-                   {DW_AT_upper_bound 4 DW_FORM_data1}
+                   DW_AT_type        :$integer_label
+                   DW_AT_lower_bound 0 DW_FORM_data1
+                   DW_AT_upper_bound 4 DW_FORM_data1
                }
            }
 
            struct_label: DW_TAG_structure_type {
-               {name struct_type}
-               {byte_size 16 DW_FORM_sdata}
+               DW_AT_name struct_type
+               DW_AT_byte_size 16 DW_FORM_sdata
            } {
                member {
-                   {name intfield}
-                   {type :$integer_label}
-                   {data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name intfield
+                   DW_AT_type :$integer_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
                member {
-                   {name arrayfield}
-                   {type :$array_label}
-                   {data_member_location 4 DW_FORM_sdata}
+                   DW_AT_name arrayfield
+                   DW_AT_type :$array_label
+                   DW_AT_data_member_location 4 DW_FORM_sdata
                }
            }
 
            DW_TAG_variable {
-               {name the_struct}
-               {external 1 DW_FORM_flag}
-               {location {
+               DW_AT_name the_struct
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location {
                    DW_OP_const1u 1
                    DW_OP_stack_value
                    DW_OP_piece 4
                    DW_OP_piece 12
-               } SPECIAL_expr}
-               {type :$struct_label}
+               } SPECIAL_expr
+               DW_AT_type :$struct_label
            }
        }
     }
index 05fe7782bdeef9a883d1e6e0d1ba7cbe1a40b9ae..24d4600488deb76776d60dc96d6eddf2f1d6bbc4 100644 (file)
@@ -23,52 +23,52 @@ standard_testfile main.c -dw.S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     foo.adb}
-                {DW_AT_comp_dir /tmp}
-               {MACRO_AT_range {main}}
-            } {
+       DW_TAG_compile_unit {
+               DW_AT_language @DW_LANG_Ada95
+               DW_AT_name     foo.adb
+               DW_AT_comp_dir /tmp
+               MACRO_AT_range {main}
+           } {
            declare_labels boolean_label typedef_label array_label enum_label
 
-            boolean_label: DW_TAG_base_type {
-                {DW_AT_byte_size 1 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_boolean}
-                {DW_AT_name      boolean}
-            }
+           boolean_label: DW_TAG_base_type {
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_boolean
+               DW_AT_name      boolean
+           }
 
-            typedef_label: DW_TAG_typedef {
-                {DW_AT_name pck__table}
-                {DW_AT_type :$array_label}
-            }
+           typedef_label: DW_TAG_typedef {
+               DW_AT_name pck__table
+               DW_AT_type :$array_label
+           }
 
            array_label: DW_TAG_array_type {
-               {DW_AT_name pck__table}
-               {DW_AT_type :$boolean_label}
+               DW_AT_name pck__table
+               DW_AT_type :$boolean_label
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$enum_label}
-                   {DW_AT_lower_bound 0   DW_FORM_data1}
-                   {DW_AT_upper_bound 128 DW_FORM_data1}
+                   DW_AT_type        :$enum_label
+                   DW_AT_lower_bound 0   DW_FORM_data1
+                   DW_AT_upper_bound 128 DW_FORM_data1
                }
            }
 
            enum_label: DW_TAG_enumeration_type {
-               {DW_AT_name      pck__enum_t}
-                {DW_AT_byte_size 1 DW_FORM_sdata}
-            } {
-                DW_TAG_enumerator {
-                    {DW_AT_name        pck__enum_000}
-                    {DW_AT_const_value 0 DW_FORM_sdata}
-                }
-                DW_TAG_enumerator {
-                    {DW_AT_name        pck__enum_001}
-                    {DW_AT_const_value 1 DW_FORM_sdata}
-                }
-                DW_TAG_enumerator {
-                    {DW_AT_name        pck__enum_128}
-                    {DW_AT_const_value 128 DW_FORM_sdata}
-                }
+               DW_AT_name      pck__enum_t
+               DW_AT_byte_size 1 DW_FORM_sdata
+           } {
+               DW_TAG_enumerator {
+                   DW_AT_name        pck__enum_000
+                   DW_AT_const_value 0 DW_FORM_sdata
+               }
+               DW_TAG_enumerator {
+                   DW_AT_name        pck__enum_001
+                   DW_AT_const_value 1 DW_FORM_sdata
+               }
+               DW_TAG_enumerator {
+                   DW_AT_name        pck__enum_128
+                   DW_AT_const_value 128 DW_FORM_sdata
+               }
            }
        }
     }
index 64a86ecf4e0630c43c7363d252bb2175c95000ab..1ebd622f4309b78650a8fb6bcfcf009dfc8e5d2d 100644 (file)
@@ -36,29 +36,29 @@ Dwarf::assemble $dwarf_file {
            declare_labels int_label float_label
 
            int_label: DW_TAG_base_type {
-               { DW_AT_name int }
-               { DW_AT_byte_size 4 DW_FORM_udata }
-               { DW_AT_encoding @DW_ATE_signed }
+               DW_AT_name int
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            float_label: DW_TAG_base_type {
-               { DW_AT_name float }
-               { DW_AT_byte_size 4 DW_FORM_udata }
-               { DW_AT_encoding @DW_ATE_float }
+               DW_AT_name float
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_encoding @DW_ATE_float
            }
 
            DW_TAG_subprogram {
-               { DW_AT_name main }
-               { DW_AT_low_pc $main_start DW_FORM_addr }
-               { DW_AT_high_pc $main_end DW_FORM_addr }
-               { DW_AT_type :$int_label }
+               DW_AT_name main
+               DW_AT_low_pc $main_start DW_FORM_addr
+               DW_AT_high_pc $main_end DW_FORM_addr
+               DW_AT_type :$int_label
            } {
                DW_TAG_variable {
-                   { DW_AT_name foo }
-                   { DW_AT_type :$float_label }
-                   { DW_AT_location {
+                   DW_AT_name foo
+                   DW_AT_type :$float_label
+                   DW_AT_location [subst {
                        DW_OP_regx $::st0_dwarf_regnum
-                   } SPECIAL_expr }
+                   }] SPECIAL_expr
                }
            }
        }
index 2e6d903992985d0a0754c69f91917acdda8e7014..022b63c2ef2641bfcb6240a9d4d4fc742a400373 100644 (file)
@@ -27,54 +27,54 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_C11}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+           DW_AT_language @DW_LANG_C11
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
+       } {
            declare_labels i_l c_l c_c_l ac_c_l pac_c_l vpac_c_l avpac_c_l
 
-            i_l: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      int}
-            }
-
-            c_l: DW_TAG_base_type {
-                {DW_AT_byte_size 2 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_unsigned}
-                {DW_AT_name      char}
-            }
-
-            c_c_l: DW_TAG_const_type {
-                {DW_AT_type :$c_l}
-            }
-
-            ac_c_l: DW_TAG_atomic_type {
-                {DW_AT_type :$c_c_l}
-            }
-
-            pac_c_l: DW_TAG_pointer_type {
-                {DW_AT_byte_size 8 DW_FORM_sdata}
-                {DW_AT_type :$ac_c_l}
-            }
-
-            vpac_c_l: DW_TAG_volatile_type {
-                {DW_AT_type :$pac_c_l}
-            }
-
-            avpac_c_l: DW_TAG_atomic_type {
-                {DW_AT_type :$vpac_c_l}
-            }
-
-            DW_TAG_subprogram {
-                {MACRO_AT_func {f}}
-                {type :$i_l}
-            } {
-                DW_TAG_formal_parameter {
-                    {type :$avpac_c_l}
-                    {name x}
-                }
-            }
+           i_l: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
+           }
+
+           c_l: DW_TAG_base_type {
+               DW_AT_byte_size 2 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_unsigned
+               DW_AT_name      char
+           }
+
+           c_c_l: DW_TAG_const_type {
+               DW_AT_type :$c_l
+           }
+
+           ac_c_l: DW_TAG_atomic_type {
+               DW_AT_type :$c_c_l
+           }
+
+           pac_c_l: DW_TAG_pointer_type {
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_type :$ac_c_l
+           }
+
+           vpac_c_l: DW_TAG_volatile_type {
+               DW_AT_type :$pac_c_l
+           }
+
+           avpac_c_l: DW_TAG_atomic_type {
+               DW_AT_type :$vpac_c_l
+           }
+
+           DW_TAG_subprogram {
+               MACRO_AT_func {f}
+               DW_AT_type :$i_l
+           } {
+               DW_TAG_formal_parameter {
+                   DW_AT_type :$avpac_c_l
+                   DW_AT_name x
+               }
+           }
        }
     }
 }
index 1876849afd3c0ad2d3efeeed5c4040e02dfee003..0cd26e80f4479e5cd1bcc669d7540128b9082bc1 100644 (file)
@@ -33,23 +33,23 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels myint
 
            myint: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      myint}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      myint
            }
 
            DW_TAG_namespace {
-               {DW_AT_name ns}
+               DW_AT_name ns
            } {
                spec: DW_TAG_variable {
-                   {DW_AT_name v}
-                   {DW_AT_type :$myint}
-                   {DW_AT_declaration 1 DW_FORM_flag_present}
+                   DW_AT_name v
+                   DW_AT_type :$myint
+                   DW_AT_declaration 1 DW_FORM_flag_present
                }
            }
        }
@@ -57,17 +57,17 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            # The new indexer has special code to compute the full
            # name of an object that uses a specification that appears
            # later in the DWARF.
            DW_TAG_variable {
-               {DW_AT_specification %$spec}
-               {DW_AT_location {
+               DW_AT_specification %$spec
+               DW_AT_location {
                    DW_OP_const1u 23
                    DW_OP_stack_value
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
        }
     }
index b443f82cfdea70b112ea1609bb822d4e6721e009..eea13af3aa4ed23982df2ed0172a790098ebb39e 100644 (file)
@@ -27,34 +27,34 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
        } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            DW_TAG_variable {
-               {DW_AT_name foo1}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {
+               DW_AT_name foo1
+               DW_AT_type :$integer_label
+               DW_AT_location {
                    DW_OP_regx 2147483647
-               } SPECIAL_expr}
-               {external 1 flag}
+               } SPECIAL_expr
+               DW_AT_external 1 flag
            }
 
            DW_TAG_variable {
-               {DW_AT_name foo2}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {
+               DW_AT_name foo2
+               DW_AT_type :$integer_label
+               DW_AT_location {
                    DW_OP_regx -1
-               } SPECIAL_expr}
-               {external 1 flag}
+               } SPECIAL_expr
+               DW_AT_external 1 flag
            }
        }
     }
index d2eb9bf7bde37336fea79c625d6b948de9eee5e9..82eaed776cdb57ac92d852556e1dd1f043d5f187 100644 (file)
@@ -32,37 +32,37 @@ Dwarf::assemble $asm_file {
            declare_labels struct_label var_label int_label
 
            int_label: base_type {
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
-               {name int}
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
 
            struct_label: structure_type {
-               {name S}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name S
+               DW_AT_byte_size 8 DW_FORM_sdata
            } {
                member {
-                   {name bitfield}
-                   {type :$int_label}
-                   {bit_size 12 DW_FORM_sdata}
-                   {bit_offset 20 DW_FORM_sdata}
+                   DW_AT_name bitfield
+                   DW_AT_type :$int_label
+                   DW_AT_bit_size 12 DW_FORM_sdata
+                   DW_AT_bit_offset 20 DW_FORM_sdata
                }
                member {
-                   {name intfield}
-                   {type :$int_label}
-                   {data_member_location 4 DW_FORM_sdata}
+                   DW_AT_name intfield
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location 4 DW_FORM_sdata
                }
            }
 
            subprogram {
-               {MACRO_AT_func { main }}
-               {type :$int_label}
-               {external 1 flag}
+               MACRO_AT_func { main }
+               DW_AT_type :$int_label
+               DW_AT_external 1 flag
            } {
                var_label: DW_TAG_variable {
-                   {name var}
-                   {location {} DW_FORM_block1}
-                   {type :$struct_label}
+                   DW_AT_name var
+                   DW_AT_location {} DW_FORM_block1
+                   DW_AT_type :$struct_label
                }
            }
        }
index 3cced7dc6ef97dec88a93dadad0f8ed2de8e3872..d3426b9c5f6eff312318449354688fec38fa7d13 100644 (file)
@@ -42,26 +42,26 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name "calling-convention"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "calling-convention"
        } {
            declare_labels int_label
 
            int_label: base_type {
-               {byte_size [get_sizeof "int" 4] sdata}
-               {encoding @DW_ATE_signed}
-               {name "int"}
+               DW_AT_byte_size [get_sizeof "int" 4] sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            subprogram {
-               {MACRO_AT_func { foo }}
-               {type :$int_label}
-               {calling_convention @DW_CC_nocall}
+               MACRO_AT_func { foo }
+               DW_AT_type :$int_label
+               DW_AT_calling_convention @DW_CC_nocall
            }
 
            subprogram {
-               {MACRO_AT_func { main }}
-               {type :$int_label}
+               MACRO_AT_func { main }
+               DW_AT_type :$int_label
            }
        }
     }
index b856c5b1815c0419e3c9afe1839e7fae2710b9ce..d73a3a1cbb4ac6e42ae5229fd1fa95ed05657a72 100644 (file)
@@ -37,22 +37,22 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_producer "clang version 15.0.0"}
-           {DW_AT_language @DW_LANG_C11}
-           {DW_AT_name $::srcfile}
-           {DW_AT_macros $cu_macros DW_FORM_sec_offset}
-           {DW_AT_stmt_list $L DW_FORM_sec_offset}
+           DW_AT_producer "clang version 15.0.0"
+           DW_AT_language @DW_LANG_C11
+           DW_AT_name $::srcfile
+           DW_AT_macros $cu_macros DW_FORM_sec_offset
+           DW_AT_stmt_list $L DW_FORM_sec_offset
        } {
            declare_labels int_type
 
            int_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name int
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
-               {type :$int_type}
+               MACRO_AT_func {main}
+               DW_AT_type :$int_type
            }
        }
     }
index 9b18d9a00529f303565b4f4ccde45cbc29fc2834..f4d91951551987819e7c6bef035e68e64a759ecd 100644 (file)
@@ -41,13 +41,13 @@ proc do_test {cu_lang gdb_lang} {
        # both 32- and 64-bit machines.
        cu { addr_size 4 } {
            compile_unit {
-               {name file1.txt}
-               {language @$cu_lang}
-               {MACRO_AT_range {func}}
+               DW_AT_name file1.txt
+               DW_AT_language @$cu_lang
+               MACRO_AT_range {func}
            } {
                subprogram {
-                   {external 1 flag}
-                   {MACRO_AT_func {func}}
+                   DW_AT_external 1 flag
+                   MACRO_AT_func {func}
                } {
                }
            }
index b9f242cd5314802a619bf939a57669ba0f88dad1..a68b7e33538b0a93ba1dd9e0f5852c19643e071a 100644 (file)
@@ -36,31 +36,31 @@ Dwarf::assemble $asm_file {
            declare_labels int_label
 
            int_label: base_type {
-               {byte_size 4 sdata}
-               {name "int"}
+               DW_AT_byte_size 4 sdata
+               DW_AT_name "int"
            }
 
            enumeration_type {
-               {name "ENUM"}
-               {byte_size 4 sdata}
+               DW_AT_name "ENUM"
+               DW_AT_byte_size 4 sdata
            } {
                enumerator {
-                   {name "A"}
-                   {const_value 0 sdata}
+                   DW_AT_name "A"
+                   DW_AT_const_value 0 sdata
                }
                enumerator {
-                   {name "B"}
-                   {const_value 1 sdata}
-                   {sibling 12345678 DW_FORM_ref4}
+                   DW_AT_name "B"
+                   DW_AT_const_value 1 sdata
+                   DW_AT_sibling 12345678 DW_FORM_ref4
                } {
                    base_type {
-                       {byte_size 1 sdata}
-                       {name "char"}
+                       DW_AT_byte_size 1 sdata
+                       DW_AT_name "char"
                    }
                }
                array_type {
-                   {type :$int_label}
-                   {sibling 12345678 DW_FORM_ref4}
+                   DW_AT_type :$int_label
+                   DW_AT_sibling 12345678 DW_FORM_ref4
                }
            }
        }
index a8b216d82f75d7ad428886dad24ff48916d71cc8..4d2ec311dc7cff4f6a9ea0d1a1d6231a630e5374 100644 (file)
@@ -25,100 +25,101 @@ standard_testfile main.c .S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       compile_unit {{language @DW_LANG_C99}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C99
+       } {
            declare_labels char_label \
                array_size_type_label long_unsigned_int_label \
                array_label array_label2 static_array_label \
                vla_length_label vla_array_label
 
            char_label: base_type {
-               {name char}
-               {encoding @DW_ATE_signed}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name char
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            array_size_type_label: base_type {
-               {byte_size 8 DW_FORM_sdata}
-               {encoding @DW_ATE_unsigned}
-               {name __ARRAY_SIZE_TYPE__}
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name __ARRAY_SIZE_TYPE__
            }
 
            long_unsigned_int_label: base_type {
-               {byte_size 8 DW_FORM_sdata}
-               {encoding @DW_ATE_unsigned}
-               {name "long unsigned int"}
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "long unsigned int"
            }
 
            array_label: array_type {
-               {type :$char_label}
+               DW_AT_type :$char_label
            } {
                subrange_type {
-                   {count {DW_OP_lit5} SPECIAL_expr}
-                   {type :$char_label}
+                   DW_AT_count {DW_OP_lit5} SPECIAL_expr
+                   DW_AT_type :$char_label
                }
            }
 
            array_label2: array_type {
-               {type :$char_label}
+               DW_AT_type :$char_label
            } {
                subrange_type {
-                   {count {DW_OP_lit1} SPECIAL_expr}
-                   {type :$char_label}
+                   DW_AT_count {DW_OP_lit1} SPECIAL_expr
+                   DW_AT_type :$char_label
                }
            }
 
            static_array_label: array_type {
-               {type :$char_label}
+               DW_AT_type :$char_label
            } {
                subrange_type {
-                   {count 5 DW_FORM_sdata}
-                   {type :$char_label}
+                   DW_AT_count 5 DW_FORM_sdata
+                   DW_AT_type :$char_label
                }
            }
 
            vla_length_label:
            DW_TAG_variable {
-               {location
-                   {
-                       lit6
-                       stack_value
-                   } SPECIAL_expr}
-               {name "__vla_array_length"}
-               {type :$long_unsigned_int_label}
-               {artificial 1 DW_FORM_flag_present}
+               DW_AT_location {
+                   lit6
+                   stack_value
+               } SPECIAL_expr
+               DW_AT_name "__vla_array_length"
+               DW_AT_type :$long_unsigned_int_label
+               DW_AT_artificial 1 DW_FORM_flag_present
            }
 
            vla_array_label: array_type {
-               {type :$char_label}
+               DW_AT_type :$char_label
            } {
                subrange_type {
-                   {type :$array_size_type_label}
-                   {count :$vla_length_label}
+                   DW_AT_type :$array_size_type_label
+                   DW_AT_count :$vla_length_label
                }
            }
 
            DW_TAG_variable {
-               {name array2}
-               {type :$array_label2}
-               {const_value 65 DW_FORM_udata}
+               DW_AT_name array2
+               DW_AT_type :$array_label2
+               DW_AT_const_value 65 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {name array}
-               {type :$array_label}
-               {const_value hello DW_FORM_block1}
+               DW_AT_name array
+               DW_AT_type :$array_label
+               DW_AT_const_value hello DW_FORM_block1
            }
 
            DW_TAG_variable {
-               {name static_array}
-               {type :$static_array_label}
-               {const_value world DW_FORM_block1}
+               DW_AT_name static_array
+               DW_AT_type :$static_array_label
+               DW_AT_const_value world DW_FORM_block1
            }
 
            DW_TAG_variable {
-               {name vla_array}
-               {type :$vla_array_label}
-               {const_value saluton DW_FORM_block1}
+               DW_AT_name vla_array
+               DW_AT_type :$vla_array_label
+               DW_AT_const_value saluton DW_FORM_block1
            }
        }
     }
index 744239900ae790cdd90865f48d7c6e181db238ef..a21e980fcf0f5ad086e31a8b56eeeb6501867930 100644 (file)
@@ -32,49 +32,49 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
 
        } {
            declare_labels a_l b_l
 
            a_l: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
            }
 
            # To expose the bug that existed at one point this
            # structure must have a linkage name, but no name, and the
            # linkage name is something that doesn't demangle.
            b_l: DW_TAG_structure_type {
-               {DW_AT_byte_size 8 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_linkage_name <anon>}
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_linkage_name <anon>
            } {
                member {
-                   {name x}
-                   {type :$a_l}
-                   {data_member_location 0 data1}
+                   DW_AT_name x
+                   DW_AT_type :$a_l
+                   DW_AT_data_member_location 0 data1
                }
                member {
-                   {name y}
-                   {type :$a_l}
-                   {data_member_location 0 data1}
+                   DW_AT_name y
+                   DW_AT_type :$a_l
+                   DW_AT_data_member_location 0 data1
                }
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
-               {type :$a_l}
+               MACRO_AT_func {main}
+               DW_AT_type :$a_l
            }
            DW_TAG_variable {
-               {type :$b_l}
-               {external 1 flag}
-               {DW_AT_name global_var}
-               {DW_AT_location {
+               DW_AT_type :$b_l
+               DW_AT_external 1 flag
+               DW_AT_name global_var
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol global_var]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
        }
     }
index 6bed9e5e2791b3e86293550f0a27699ce82aded4..6ee55a619a18346ae46dbe2b30efdaac2bd6cd31 100644 (file)
@@ -27,10 +27,10 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_producer "Tsetsuite"}
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     ""}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_producer "Tsetsuite"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     ""
+           DW_AT_comp_dir /tmp
        } {
        }
     }
index 7f36878b53f8d95701a24477080ca8514ad89eed..796f935eefe02d811315dd97b57592cf46c27183 100644 (file)
@@ -35,13 +35,13 @@ Dwarf::assemble $asm_file {
        # The PC range here is intentionally empty -- this was the
        # trigger for the bug.
        compile_unit {
-           {language @DW_LANG_C}
-           {DW_AT_low_pc $main_start DW_FORM_addr}
-           {DW_AT_high_pc $main_start DW_FORM_addr}
+           DW_AT_language @DW_LANG_C
+           DW_AT_low_pc $main_start DW_FORM_addr
+           DW_AT_high_pc $main_start DW_FORM_addr
        } {
            DW_TAG_subprogram {
-               {DW_AT_name "main"}
-               {DW_AT_low_pc $main_start DW_FORM_addr}
+               DW_AT_name "main"
+               DW_AT_low_pc $main_start DW_FORM_addr
            }
        }
     }
index 20500cb622e4bd8f1e4793f445a557773a29edf7..94b9e09e8d7c55ba8e6edea8f9582ecec0b33332 100644 (file)
@@ -34,83 +34,83 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     foo.adb}
-                {DW_AT_comp_dir /tmp}
-        } {
-            declare_labels integer_label array_label array_ptr_label
+       DW_TAG_compile_unit {
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     foo.adb
+           DW_AT_comp_dir /tmp
+       } {
+           declare_labels integer_label array_label array_ptr_label
            set int_size [get_sizeof "int" 4]
            set voidp_size [get_sizeof "void *" 96]
 
-            integer_label: DW_TAG_base_type {
-                {DW_AT_byte_size $int_size DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      integer}
-            }
+           integer_label: DW_TAG_base_type {
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
+           }
 
            array_label: DW_TAG_array_type {
-               {DW_AT_name foo__array_type}
-               {DW_AT_type :$integer_label}
-                {DW_AT_data_location {
-                    DW_OP_push_object_address
-                    DW_OP_deref
-                } SPECIAL_expr}
-                {external 1 flag}
+               DW_AT_name foo__array_type
+               DW_AT_type :$integer_label
+               DW_AT_data_location {
+                   DW_OP_push_object_address
+                   DW_OP_deref
+               } SPECIAL_expr
+               DW_AT_external 1 flag
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer_label}
-                    {DW_AT_lower_bound {
-                        DW_OP_push_object_address
-                        DW_OP_plus_uconst $voidp_size
-                        DW_OP_deref
-                        DW_OP_deref_size $int_size
-                    } SPECIAL_expr}
-                    {DW_AT_upper_bound {
-                        DW_OP_push_object_address
-                        DW_OP_plus_uconst $voidp_size
-                        DW_OP_deref
-                        DW_OP_plus_uconst $int_size
-                        DW_OP_deref_size $int_size
-                    } SPECIAL_expr}
+                   DW_AT_type        :$integer_label
+                   DW_AT_lower_bound [subst {
+                       DW_OP_push_object_address
+                       DW_OP_plus_uconst $voidp_size
+                       DW_OP_deref
+                       DW_OP_deref_size $int_size
+                   }] SPECIAL_expr
+                   DW_AT_upper_bound [subst {
+                       DW_OP_push_object_address
+                       DW_OP_plus_uconst $voidp_size
+                       DW_OP_deref
+                       DW_OP_plus_uconst $int_size
+                       DW_OP_deref_size $int_size
+                   }] SPECIAL_expr
                }
            }
-            array_ptr_label: DW_TAG_typedef {
-                {DW_AT_name foo__array_type}
-                {DW_AT_type :$array_label}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__three}
-                {DW_AT_type :$array_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_1]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__three_tdef}
-                {DW_AT_type :$array_ptr_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_1]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__five}
-                {DW_AT_type :$array_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_2]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__five_tdef}
-                {DW_AT_type :$array_ptr_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_2]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
+           array_ptr_label: DW_TAG_typedef {
+               DW_AT_name foo__array_type
+               DW_AT_type :$array_label
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__three
+               DW_AT_type :$array_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_1]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__three_tdef
+               DW_AT_type :$array_ptr_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_1]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__five
+               DW_AT_type :$array_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_2]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__five_tdef
+               DW_AT_type :$array_ptr_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_2]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
        }
     }
 }
index ac9c7741b67423504a3874029cf71b64d5f843c3..9ac9d94008d258784669870e8d3431ad35cf0e27 100644 (file)
@@ -31,20 +31,20 @@ Dwarf::assemble $asm_file {
 
     cu { label cu_label } {
        compile_unit {
-           {language @DW_LANG_C}
-           {name $srcfile}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name $srcfile
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc $main_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_len DW_FORM_data4
            }
            subprogram {
-               {external 1 flag}
-               {name frame2}
-               {low_pc $frame2_start addr}
-               {high_pc $frame2_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name frame2
+               DW_AT_low_pc $frame2_start addr
+               DW_AT_high_pc $frame2_len DW_FORM_data4
            }
        }
     }
index c758db776f4c38567c78c3803adbf6cdbed6e602..6fdb1b2ee68477ee79f99379927218d578e721ad 100644 (file)
@@ -35,11 +35,13 @@ Dwarf::assemble {
     }
 
     cu { label cu_label } {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {DW_AT_name _start}
-               {DW_AT_low_pc $_start_start DW_FORM_addr}
-               {DW_AT_high_pc $_start_end DW_FORM_addr}
+               DW_AT_name _start
+               DW_AT_low_pc $_start_start DW_FORM_addr
+               DW_AT_high_pc $_start_end DW_FORM_addr
            }
        }
     }
@@ -49,18 +51,18 @@ Dwarf::assemble {
            declare_labels int_type
 
            structure_type {
-               {name struct_with_int_member}
-               {byte_size 4 sdata}
+               DW_AT_name struct_with_int_member
+               DW_AT_byte_size 4 sdata
            } {
                member {
-                   {name member}
-                   {type :$int_type}
+                   DW_AT_name member
+                   DW_AT_type :$int_type
                }
            }
            int_type: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 sdata
            }
        }
     }
index 44d623b43ad29b761664161399e330646624d6dc..5c84480e1570e594412be12ba951ac76531d889f 100644 (file)
@@ -35,16 +35,18 @@ Dwarf::assemble {
     }
 
     cu { label cu_label } {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {DW_AT_name _start}
-               {DW_AT_low_pc $_start_start DW_FORM_addr}
-               {DW_AT_high_pc $_start_end DW_FORM_addr}
+               DW_AT_name _start
+               DW_AT_low_pc $_start_start DW_FORM_addr
+               DW_AT_high_pc $_start_end DW_FORM_addr
            }
            base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
        }
     }
index 1ec4a18dd6d7fe1c0a64e68922cb242d4b075f1b..64550abb06f4059a346faa0ad25c9677a4e7d2b5 100644 (file)
@@ -39,16 +39,18 @@ Dwarf::assemble {
     }
 
     cu { label cu_label } {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {DW_AT_name _start}
-               {DW_AT_low_pc $_start_start DW_FORM_addr}
-               {DW_AT_high_pc $_start_end DW_FORM_addr}
+               DW_AT_name _start
+               DW_AT_low_pc $_start_start DW_FORM_addr
+               DW_AT_high_pc $_start_end DW_FORM_addr
            }
            base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
        }
     }
index 495045827e118766ea86526bbda9cc2122cfb318..6ab6142f8a1569586133a512ec8b99d697fa392a 100644 (file)
@@ -40,32 +40,36 @@ Dwarf::assemble {
     }
 
     cu { label cu_label version $dwarf_version } {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {DW_AT_name _start}
-               {DW_AT_low_pc $_start_start DW_FORM_addr}
-               {DW_AT_high_pc $_start_end DW_FORM_addr}
+               DW_AT_name _start
+               DW_AT_low_pc $_start_start DW_FORM_addr
+               DW_AT_high_pc $_start_end DW_FORM_addr
            }
        }
     }
 
     tu { label tu_label version $dwarf_version } 0x8ece66f4224fddb3 "" {
-       type_unit {{language @DW_LANG_C}} {
+       type_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            declare_labels int_type
 
            structure_type {
-               {name struct_with_int_member}
-               {byte_size 4 sdata}
+               DW_AT_name struct_with_int_member
+               DW_AT_byte_size 4 sdata
            } {
                member {
-                   {name member}
-                   {type :$int_type}
+                   DW_AT_name member
+                   DW_AT_type :$int_type
                }
            }
            int_type: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 sdata
            }
        }
     }
index 67a4f4947336b5cb249e8cd75cba0e557b538284..5ef21a6725548a7837a76c1a7973f458a88a8e3e 100644 (file)
@@ -35,16 +35,18 @@ Dwarf::assemble {
     }
 
     cu { label cu_label } {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {DW_AT_name _start}
-               {DW_AT_low_pc $_start_start DW_FORM_addr}
-               {DW_AT_high_pc $_start_end DW_FORM_addr}
+               DW_AT_name _start
+               DW_AT_low_pc $_start_start DW_FORM_addr
+               DW_AT_high_pc $_start_end DW_FORM_addr
            }
            base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
        }
     }
index 6253629237a785aeb42bb14fdbcc620e808c4275..396fd948b4c145310cd2e19561f8baa9dc0fe66b 100644 (file)
@@ -42,8 +42,8 @@ Dwarf::assemble $asm_file {
        compile_unit {
        } {
            subprogram {
-               {MACRO_AT_func {main}}
-               {type %$int_type}
+               MACRO_AT_func {main}
+               DW_AT_type %$int_type
            }
        }
     }
@@ -61,9 +61,9 @@ Dwarf::assemble $asm_file {
        compile_unit {
        } {
            int_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name int
            }
        }
     }
@@ -79,19 +79,19 @@ Dwarf::assemble $asm_file {
                declare_labels dummy_int_type
 
                the_type_i: structure_type {
-                       {name s}
-                       {byte_size 4 sdata}
+                   DW_AT_name s
+                   DW_AT_byte_size 4 sdata
                } {
-                       member {
-                       {name i}
-                       {type :$dummy_int_type}
-                       }
+                   member {
+                       DW_AT_name i
+                       DW_AT_type :$dummy_int_type
+                   }
                }
 
                dummy_int_type: base_type {
-                       {name int}
-                       {encoding @DW_ATE_signed}
-                       {byte_size 4 sdata}
+                   DW_AT_name int
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_byte_size 4 sdata
                }
            }
        }
index bc5a65482c32e22887acff42e2fc2df37e132f0c..0e5cee2f76aefaac2398874e6e1cd69bb3c4f7e2 100644 (file)
@@ -32,23 +32,23 @@ Dwarf::assemble $asm_file {
        version 5
     } {
        DW_TAG_compile_unit {
-           {DW_AT_str_offsets_base $base_offset_cu1 sec_offset}
+           DW_AT_str_offsets_base $base_offset_cu1 sec_offset
        } {
            declare_labels int4_type
 
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      $::int_str_idx DW_FORM_strx_id}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      $::int_str_idx DW_FORM_strx_id
            }
 
            DW_TAG_variable {
-               {DW_AT_name global_var}
-               {DW_AT_type :$int4_type}
-               {DW_AT_location {
+               DW_AT_name global_var
+               DW_AT_type :$int4_type
+               DW_AT_location {
                    DW_OP_const1u 12
                    DW_OP_stack_value
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
        }
     }
index 4d43816c4084889edaf87379ef686b3b0c9a6d61..dfb11af8c1c38094232d990e00b8004d62e6471a 100644 (file)
@@ -27,39 +27,39 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_C_plus_plus}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
+       } {
            declare_labels itype ptype
 
-            itype: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name int_4096}
-               {DW_AT_alignment 4096 DW_FORM_sdata}
-            }
+           itype: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name int_4096
+               DW_AT_alignment 4096 DW_FORM_sdata
+           }
 
-            ptype: DW_TAG_pointer_type {
-                {DW_AT_byte_size 8 DW_FORM_sdata}
-                {DW_AT_type :$itype}
-               {DW_AT_alignment 4096 DW_FORM_sdata}
-            }
+           ptype: DW_TAG_pointer_type {
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_type :$itype
+               DW_AT_alignment 4096 DW_FORM_sdata
+           }
 
-            DW_TAG_typedef {
-                {DW_AT_name ptr_4096}
-                {DW_AT_type :$ptype}
-            }
+           DW_TAG_typedef {
+               DW_AT_name ptr_4096
+               DW_AT_type :$ptype
+           }
 
            DW_TAG_structure_type {
-               {DW_AT_name "struct_4096"}
-               {DW_AT_byte_size 4096 DW_FORM_sdata}
-               {DW_AT_alignment 4096 DW_FORM_udata}
+               DW_AT_name "struct_4096"
+               DW_AT_byte_size 4096 DW_FORM_sdata
+               DW_AT_alignment 4096 DW_FORM_udata
            } {
                member {
-                   {name a}
-                   {type :$itype}
-                   {data_member_location 0 data1}
+                   DW_AT_name a
+                   DW_AT_type :$itype
+                   DW_AT_data_member_location 0 data1
                }
            }
        }
index 0dd59bb044b3277f1fe0dd9fdc8b519d0d04f78c..928edf05226ce2b5e9ab2ba8b5516d85c73badf8 100644 (file)
@@ -25,7 +25,9 @@ set asm_file [standard_output_file $srcfile2]
 
 Dwarf::assemble $asm_file {
     cu { label cu_start } {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
        }
     }
     aranges { addr_zero true } cu_start {
index 9c1f4240af5046f41df54e94e44fdb61e39390eb..0ee06b05ac9bc7dddf0326e0943c6e5ec1736c82 100644 (file)
@@ -93,75 +93,75 @@ proc run_test { dwarf_version } {
 
        cu { version $dwarf_version } {
            compile_unit {
-               {producer "GNU C 14.1.0"}
-               {language @DW_LANG_C}
-               {name $::srcfile}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
-               {low_pc 0 addr}
+               DW_AT_producer "GNU C 14.1.0"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name $::srcfile
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+               DW_AT_low_pc 0 addr
            } {
                int_label: base_type {
-                   {name "int"}
-                   {byte_size 4 sdata}
-                   {encoding @DW_ATE_signed}
+                   DW_AT_name "int"
+                   DW_AT_byte_size 4 sdata
+                   DW_AT_encoding @DW_ATE_signed
                }
                foo_func: subprogram {
-                   {name foo}
-                   {inline @DW_INL_declared_inlined}
-                   {decl_file 1 data1}
-                   {decl_line $::func_a_decl_line data1}
+                   DW_AT_name foo
+                   DW_AT_inline @DW_INL_declared_inlined
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::func_a_decl_line data1
                } {
                    foo_block: lexical_block {
                    } {
                        value_label: DW_TAG_variable {
-                           {name value}
-                           {type :$int_label}
+                           DW_AT_name value
+                           DW_AT_type :$int_label
                        }
                    }
                }
                subprogram {
-                   {abstract_origin %$foo_func}
-                   {low_pc func_a_0 addr}
-                   {high_pc func_a_6 addr}
-                   {external 1 flag}
+                   DW_AT_abstract_origin %$foo_func
+                   DW_AT_low_pc func_a_0 addr
+                   DW_AT_high_pc func_a_6 addr
+                   DW_AT_external 1 flag
                } {
                    bad_block: lexical_block {
-                       {abstract_origin %$foo_block}
-                       {ranges $block_ranges DW_FORM_sec_offset}
+                       DW_AT_abstract_origin %$foo_block
+                       DW_AT_ranges $block_ranges DW_FORM_sec_offset
                    } {
                        DW_TAG_variable {
-                           {abstract_origin %$value_label}
-                           {DW_AT_location {
+                           DW_AT_abstract_origin %$value_label
+                           DW_AT_location {
                                DW_OP_const1u 23
                                DW_OP_stack_value
-                           } SPECIAL_expr}
+                           } SPECIAL_expr
                        }
                    }
                }
                subprogram {
-                   {name baz}
-                   {low_pc func_b_0 addr}
-                   {high_pc func_b_5 addr}
-                   {external 1 flag}
+                   DW_AT_name baz
+                   DW_AT_low_pc func_b_0 addr
+                   DW_AT_high_pc func_b_5 addr
+                   DW_AT_external 1 flag
                } {
                    inlined_subroutine {
-                       {abstract_origin %$foo_func}
-                       {call_file 1 data1}
-                       {call_line $::call_line data1}
-                       {low_pc func_b_1 addr}
-                       {high_pc func_b_4 addr}
+                       DW_AT_abstract_origin %$foo_func
+                       DW_AT_call_file 1 data1
+                       DW_AT_call_line $::call_line data1
+                       DW_AT_low_pc func_b_1 addr
+                       DW_AT_high_pc func_b_4 addr
                    } {
                        lexical_block {
-                           {abstract_origin %$bad_block}
-                           {low_pc func_b_2 addr}
-                           {high_pc func_b_3 addr}
+                           DW_AT_abstract_origin %$bad_block
+                           DW_AT_low_pc func_b_2 addr
+                           DW_AT_high_pc func_b_3 addr
                        } {
                            DW_TAG_variable {
-                               {abstract_origin %$value_label}
-                               {DW_AT_location {
+                               DW_AT_abstract_origin %$value_label
+                               DW_AT_location {
                                    DW_OP_const1u 99
                                    DW_OP_stack_value
-                               } SPECIAL_expr}
+                               } SPECIAL_expr
                            }
                        }
                    }
index ed03c279275dc52d6271a5272a9df936bb43eb41..a0ae49807a248585880da69573c5e8e25bae9916 100644 (file)
@@ -54,56 +54,56 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir ${srcdir}/${subdir}}
-           {stmt_list $L1 DW_FORM_sec_offset}
-           {ranges ${ranges_label_1} DW_FORM_sec_offset}
-           {DW_AT_low_pc   0 addr}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir ${srcdir}/${subdir}
+           DW_AT_stmt_list $L1 DW_FORM_sec_offset
+           DW_AT_ranges ${ranges_label_1} DW_FORM_sec_offset
+           DW_AT_low_pc   0 addr
        } {
            declare_labels integer_label
 
            DW_TAG_subprogram {
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc $main_length data8}
-               {DW_AT_type :$integer_label}
-               {DW_AT_decl_file 1 data1}
-               {DW_AT_decl_line 10 data1}
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_length data8
+               DW_AT_type :$integer_label
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line 10 data1
            }
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
        }
     }
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     $srcfile2}
-           {DW_AT_comp_dir ${srcdir}/${subdir}}
-           {stmt_list $L2 DW_FORM_sec_offset}
-           {ranges ${ranges_label_2} DW_FORM_sec_offset}
-           {DW_AT_low_pc   0 addr}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     $srcfile2
+           DW_AT_comp_dir ${srcdir}/${subdir}
+           DW_AT_stmt_list $L2 DW_FORM_sec_offset
+           DW_AT_ranges ${ranges_label_2} DW_FORM_sec_offset
+           DW_AT_low_pc   0 addr
        } {
            declare_labels integer_label
 
            DW_TAG_subprogram {
-               {name some_func}
-               {low_pc some_func addr}
-               {high_pc some_func_end addr}
-               {DW_AT_type :$integer_label}
-               {DW_AT_decl_file 2 data1}
-               {DW_AT_decl_line 5 data1}
+               DW_AT_name some_func
+               DW_AT_low_pc some_func addr
+               DW_AT_high_pc some_func_end addr
+               DW_AT_type :$integer_label
+               DW_AT_decl_file 2 data1
+               DW_AT_decl_line 5 data1
            }
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
        }
     }
index f2534cb48afd5f57907dc44f1da9e19ec8b23833..ad6584212dc27ced285a5dc51f327f37bbb7fcb4 100644 (file)
@@ -28,27 +28,26 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_C_plus_plus}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-
-        } {
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
+       } {
            declare_labels b_l
 
            b_l: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      bool}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      bool
            }
-            DW_TAG_subprogram {
-                {MACRO_AT_func {f}}
-                {type :$b_l}
-               {DW_AT_MIPS_linkage_name _Z1fv}
+           DW_TAG_subprogram {
+               MACRO_AT_func {f}
+               DW_AT_type :$b_l
+               DW_AT_MIPS_linkage_name _Z1fv
            }
-            DW_TAG_subprogram {
-                {MACRO_AT_func {g}}
-                {type :$b_l}
-               {DW_AT_MIPS_linkage_name 42 DW_FORM_data1}
+           DW_TAG_subprogram {
+               MACRO_AT_func {g}
+               DW_AT_type :$b_l
+               DW_AT_MIPS_linkage_name 42 DW_FORM_data1
            }
        }
     }
index fd2c899d1754d2d5c9aeb05e25e3307d6d988967..dba8d5eb1db5934dec4836d3e38a87963c2e3ea3 100644 (file)
@@ -30,21 +30,21 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
        } {
            declare_labels b_l
 
            b_l: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      bool}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      bool
            }
            DW_TAG_variable {
-               {name var}
-               {type :$b_l}
-               {external 1 flag}
+               DW_AT_name var
+               DW_AT_type :$b_l
+               DW_AT_external 1 flag
            }
        }
     }
index c611ad29466a84bd9584a3a48c6ab09fbcfd75bc..b8f96a19ab06cb25cff63275ca417af56bd442ef 100644 (file)
@@ -32,35 +32,35 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_C}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
+       } {
            declare_labels bf16_type fp16_type \
                bf16_var fp16_var
 
-            bf16_type: DW_TAG_base_type {
-                {DW_AT_name __bf16}
-               {encoding @DW_ATE_float}
-                {DW_AT_byte_size 2 DW_FORM_sdata}
-            }
+           bf16_type: DW_TAG_base_type {
+               DW_AT_name __bf16
+               DW_AT_encoding @DW_ATE_float
+               DW_AT_byte_size 2 DW_FORM_sdata
+           }
 
-            fp16_type: DW_TAG_base_type {
-                {DW_AT_name __fp16}
-               {encoding @DW_ATE_float}
-                {DW_AT_byte_size 2 DW_FORM_sdata}
-            }
+           fp16_type: DW_TAG_base_type {
+               DW_AT_name __fp16
+               DW_AT_encoding @DW_ATE_float
+               DW_AT_byte_size 2 DW_FORM_sdata
+           }
 
            bf16_var: DW_TAG_variable {
-               {DW_AT_name "bf16_1"}
-               {DW_AT_type :${bf16_type}}
-               {DW_AT_const_value 0x4049 DW_FORM_sdata}
+               DW_AT_name "bf16_1"
+               DW_AT_type :${bf16_type}
+               DW_AT_const_value 0x4049 DW_FORM_sdata
            }
 
            fp16_var: DW_TAG_variable {
-               {DW_AT_name "fp16_1"}
-               {DW_AT_type :${fp16_type}}
-               {DW_AT_const_value 0x4248 DW_FORM_sdata}
+               DW_AT_name "fp16_1"
+               DW_AT_type :${fp16_type}
+               DW_AT_const_value 0x4248 DW_FORM_sdata
            }
        }
     }
index 34746f25608f924f5220d96deb887656552af58e..509924ab5fe61fd008a062a585de2b2fa463ac70 100644 (file)
@@ -52,14 +52,14 @@ Dwarf::assemble $asm_file {
            declare_labels int_type
 
            int_type: DW_TAG_base_type {
-               {DW_AT_byte_size $::int_size DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name int}
+               DW_AT_byte_size $::int_size DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_signed
+               DW_AT_name int
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
-               {type :$int_type}
+               MACRO_AT_func {main}
+               DW_AT_type :$int_type
            }
 
            # GCC complex float.
@@ -67,36 +67,36 @@ Dwarf::assemble $asm_file {
            declare_labels cf_type cd_type cld_type
 
            cf_type: DW_TAG_base_type {
-               {DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_complex_float}
-               {DW_AT_name      "complex float"}
+               DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_complex_float
+               DW_AT_name       "complex float"
            }
 
            cd_type: DW_TAG_base_type {
-               {DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_complex_float}
-               {DW_AT_name      "complex double"}
+               DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_complex_float
+               DW_AT_name       "complex double"
            }
 
            cld_type: DW_TAG_base_type {
-               {DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_complex_float}
-               {DW_AT_name      "complex long double"}
+               DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_complex_float
+               DW_AT_name       "complex long double"
            }
 
            DW_TAG_variable {
-               {name var_complex_float}
-               {DW_AT_type :$cf_type}
+               DW_AT_name var_complex_float
+               DW_AT_type :$cf_type
            }
 
            DW_TAG_variable {
-               {name var_complex_double}
-               {DW_AT_type :$cd_type}
+               DW_AT_name var_complex_double
+               DW_AT_type :$cd_type
            }
 
            DW_TAG_variable {
-               {name var_complex_long_double}
-               {DW_AT_type :$cld_type}
+               DW_AT_name var_complex_long_double
+               DW_AT_type :$cld_type
            }
 
            # GCC complex int.
@@ -105,14 +105,14 @@ Dwarf::assemble $asm_file {
            declare_labels ci_type
 
            ci_type: DW_TAG_base_type {
-               {DW_AT_byte_size [expr 2 * $::int_size] DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_lo_user}
-               {DW_AT_name      "complex int"}
+               DW_AT_byte_size [expr 2 * $::int_size] DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_lo_user
+               DW_AT_name       "complex int"
            }
 
            DW_TAG_variable {
-               {name var_complex_int}
-               {DW_AT_type :$ci_type}
+               DW_AT_name var_complex_int
+               DW_AT_type :$ci_type
            }
 
            # Clang complex float.
@@ -122,36 +122,36 @@ Dwarf::assemble $asm_file {
            declare_labels clang_cf_type clang_cd_type clang_cld_type
 
            clang_cf_type: DW_TAG_base_type {
-               {DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_complex_float}
-               {DW_AT_name      "complex"}
+               DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_complex_float
+               DW_AT_name       "complex"
            }
 
            DW_TAG_variable {
-               {name var_complex_clang_float}
-               {DW_AT_type :$clang_cf_type}
+               DW_AT_name var_complex_clang_float
+               DW_AT_type :$clang_cf_type
            }
 
            clang_cd_type: DW_TAG_base_type {
-               {DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_complex_float}
-               {DW_AT_name      "complex"}
+               DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_complex_float
+               DW_AT_name       "complex"
            }
 
            DW_TAG_variable {
-               {name var_complex_clang_double}
-               {DW_AT_type :$clang_cd_type}
+               DW_AT_name var_complex_clang_double
+               DW_AT_type :$clang_cd_type
            }
 
            clang_cld_type: DW_TAG_base_type {
-               {DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_complex_float}
-               {DW_AT_name      "complex"}
+               DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_complex_float
+               DW_AT_name       "complex"
            }
 
            DW_TAG_variable {
-               {name var_complex_clang_long_double}
-               {DW_AT_type :$clang_cld_type}
+               DW_AT_name var_complex_clang_long_double
+               DW_AT_type :$clang_cld_type
            }
        }
     }
index cec101762a217bda8b15e15dfa2aab3dd3cd9f05..ddbab26ddc9315aa8c0a21ab88b1b5d2b8ddae1d 100644 (file)
@@ -43,15 +43,15 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {producer "gcc" }
-           {language @DW_LANG_C}
-           {name ${srcfile3}}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_producer "gcc"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile3}
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
        }
     }
index 85b6f8beeb899def2ad36d820b937b26531447c5..2a32433285c2a4595ea7ecb107471746a42fba27 100644 (file)
@@ -33,13 +33,13 @@ Dwarf::assemble $asm_file {
 
     cu { version 5 } {
        compile_unit {
-           {language @DW_LANG_C}
-           {name $srcfile}
-           {stmt_list $Llines DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name $srcfile
+           DW_AT_stmt_list $Llines DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
        }
     }
index e7950403c845200ec3f91a62b908bcdca91984de..1a0eebad452b833560d8764ae69c7fd6027412d3 100644 (file)
@@ -159,20 +159,20 @@ proc_with_prefix use_low_high_bounds_without_entry_pc { dwarf_vesion } {
 
        cu { version $::dwarf_version } {
            compile_unit {
-               {producer "gcc"}
-               {language @DW_LANG_C}
-               {name ${srcfile}}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name ${srcfile}
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
            } {
                subprogram {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $::foo_decl_line data1}
-                   {decl_column 1 data1}
-                   {low_pc $::foo_start addr}
-                   {high_pc $::foo_len $::ptr_type}
-                   {external 1 flag}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::foo_decl_line data1
+                   DW_AT_decl_column 1 data1
+                   DW_AT_low_pc $::foo_start addr
+                   DW_AT_high_pc $::foo_len $::ptr_type
+                   DW_AT_external 1 flag
                }
            }
        }
@@ -202,21 +202,21 @@ proc_with_prefix use_low_high_bounds_with_entry_pc { dwarf_version } {
 
        cu { version $::dwarf_version } {
            compile_unit {
-               {producer "gcc"}
-               {language @DW_LANG_C}
-               {name ${srcfile}}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name ${srcfile}
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
            } {
                subprogram {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $::foo_decl_line data1}
-                   {decl_column 1 data1}
-                   {low_pc $::foo_start addr}
-                   {high_pc $::foo_len $::ptr_type}
-                   {external 1 flag}
-                   {entry_pc foo_middle addr}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::foo_decl_line data1
+                   DW_AT_decl_column 1 data1
+                   DW_AT_low_pc $::foo_start addr
+                   DW_AT_high_pc $::foo_len $::ptr_type
+                   DW_AT_external 1 flag
+                   DW_AT_entry_pc foo_middle addr
                }
            }
        }
@@ -248,21 +248,21 @@ proc_with_prefix use_low_high_bounds_with_entry_offset { dwarf_version } {
 
        cu { version $::dwarf_version } {
            compile_unit {
-               {producer "gcc"}
-               {language @DW_LANG_C}
-               {name ${srcfile}}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name ${srcfile}
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
            } {
                subprogram {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $::foo_decl_line data1}
-                   {decl_column 1 data1}
-                   {low_pc $::foo_start addr}
-                   {high_pc $::foo_len $::ptr_type}
-                   {external 1 flag}
-                   {entry_pc $foo_offset data4}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::foo_decl_line data1
+                   DW_AT_decl_column 1 data1
+                   DW_AT_low_pc $::foo_start addr
+                   DW_AT_high_pc $::foo_len $::ptr_type
+                   DW_AT_external 1 flag
+                   DW_AT_entry_pc $foo_offset data4
                }
            }
        }
@@ -293,20 +293,20 @@ proc_with_prefix use_ranges_without_entry_pc { dwarf_version } {
 
        cu { version $::dwarf_version } {
            compile_unit {
-               {producer "gcc"}
-               {language @DW_LANG_C}
-               {name ${srcfile}}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
-               {low_pc 0 addr}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name ${srcfile}
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+               DW_AT_low_pc 0 addr
            } {
                subprogram {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $::foo_decl_line data1}
-                   {decl_column 1 data1}
-                   {external 1 flag}
-                   {ranges ${ranges_label} DW_FORM_sec_offset}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::foo_decl_line data1
+                   DW_AT_decl_column 1 data1
+                   DW_AT_external 1 flag
+                   DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
                }
            }
        }
@@ -357,21 +357,21 @@ proc_with_prefix use_ranges_with_entry_pc { dwarf_version } {
 
        cu { version $::dwarf_version } {
            compile_unit {
-               {producer "gcc"}
-               {language @DW_LANG_C}
-               {name ${srcfile}}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
-               {low_pc 0 addr}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name ${srcfile}
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+               DW_AT_low_pc 0 addr
            } {
                subprogram {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $::foo_decl_line data1}
-                   {decl_column 1 data1}
-                   {external 1 flag}
-                   {ranges ${ranges_label} DW_FORM_sec_offset}
-                   {entry_pc foo_middle addr}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::foo_decl_line data1
+                   DW_AT_decl_column 1 data1
+                   DW_AT_external 1 flag
+                   DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
+                   DW_AT_entry_pc foo_middle addr
                }
            }
        }
@@ -424,21 +424,21 @@ proc_with_prefix use_ranges_with_entry_offset { dwarf_version } {
 
        cu { version $::dwarf_version } {
            compile_unit {
-               {producer "gcc"}
-               {language @DW_LANG_C}
-               {name ${srcfile}}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
-               {low_pc 0 addr}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name ${srcfile}
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+               DW_AT_low_pc 0 addr
            } {
                subprogram {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $::foo_decl_line data1}
-                   {decl_column 1 data1}
-                   {external 1 flag}
-                   {ranges ${ranges_label} DW_FORM_sec_offset}
-                   {entry_pc $foo_offset data4}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::foo_decl_line data1
+                   DW_AT_decl_column 1 data1
+                   DW_AT_external 1 flag
+                   DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
+                   DW_AT_entry_pc $foo_offset data4
                }
            }
        }
index bba4cfb198a8434045afd4e77c0d938570a69100..97194d53339e10a7e0e6bb1824648adb5b4ed3d0 100644 (file)
@@ -51,69 +51,69 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_Fortran90}
-           {name dw2-entry-points.f90}
-           {comp_dir /tmp}
+           DW_AT_language @DW_LANG_Fortran90
+           DW_AT_name dw2-entry-points.f90
+           DW_AT_comp_dir /tmp
        } {
            int_label: base_type {
-               {name "int"}
-               {byte_size $int_size sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name "int"
+               DW_AT_byte_size $int_size sdata
+               DW_AT_encoding @DW_ATE_signed
            }
            subprogram {
-               {name prog}
-               {decl_file 1 data1}
-               {decl_line $prog_line data1}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
-               {external 1 flag}
-               {main_subprogram 1 flag}
+               DW_AT_name prog
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $prog_line data1
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
+               DW_AT_external 1 flag
+               DW_AT_main_subprogram 1 flag
            }
            subprogram {
-               {name bar}
-               {decl_file 1 data1}
-               {decl_line $bar_line data1}
-               {external 1 flag}
-               {low_pc $bar_helper_start addr}
-               {high_pc "$bar_helper_start + $bar_helper_len" addr}
+               DW_AT_name bar
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $bar_line data1
+               DW_AT_external 1 flag
+               DW_AT_low_pc $bar_helper_start addr
+               DW_AT_high_pc "$bar_helper_start + $bar_helper_len" addr
            } {
                formal_parameter {
-                   {name I}
-                   {type :$int_label}
-                   {location {addr $global_I} SPECIAL_expr}
+                   DW_AT_name I
+                   DW_AT_type :$int_label
+                   DW_AT_location [subst {addr $global_I}] SPECIAL_expr
                }
                formal_parameter {
-                   {name J}
-                   {type :$int_label}
-                   {location {addr $global_J} SPECIAL_expr}
+                   DW_AT_name J
+                   DW_AT_type :$int_label
+                   DW_AT_location [subst {addr $global_J}] SPECIAL_expr
                }
                entry_point {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $foo_line data1}
-                   {low_pc foo_entry_label addr}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $foo_line data1
+                   DW_AT_low_pc foo_entry_label addr
                } {
                    formal_parameter {
-                       {name J}
-                       {type :$int_label}
-                       {location {addr $global_J} SPECIAL_expr}
+                       DW_AT_name J
+                       DW_AT_type :$int_label
+                       DW_AT_location [subst {addr $global_J}] SPECIAL_expr
                    }
                    formal_parameter {
-                       {name K}
-                       {type :$int_label}
-                       {location {addr $global_K} SPECIAL_expr}
+                       DW_AT_name K
+                       DW_AT_type :$int_label
+                       DW_AT_location [subst {addr $global_K}] SPECIAL_expr
                    }
                }
                entry_point {
-                       {name foobar}
-                       {decl_file 1 data1}
-                       {decl_line $foobar_line data1}
-                       {low_pc foobar_entry_label addr}
+                       DW_AT_name foobar
+                       DW_AT_decl_file 1 data1
+                       DW_AT_decl_line $foobar_line data1
+                       DW_AT_low_pc foobar_entry_label addr
                    } {
                    formal_parameter {
-                       {name J}
-                       {type :$int_label}
-                       {location {addr $global_J} SPECIAL_expr}
+                       DW_AT_name J
+                       DW_AT_type :$int_label
+                       DW_AT_location [subst {addr $global_J}] SPECIAL_expr
                    }
                }
            }
@@ -122,48 +122,48 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_Fortran90}
-           {name dw2-entry-points-2.f90}
-           {comp_dir /tmp}
+           DW_AT_language @DW_LANG_Fortran90
+           DW_AT_name dw2-entry-points-2.f90
+           DW_AT_comp_dir /tmp
        } {
            int2_label: base_type {
-               {name "int"}
-               {byte_size $int_size sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name "int"
+               DW_AT_byte_size $int_size sdata
+               DW_AT_encoding @DW_ATE_signed
            }
            subprogram {
-               {name barso}
-               {decl_file 1 data1}
-               {decl_line $bar_line data1}
-               {external 1 flag}
-               {low_pc $barso_helper_start addr}
-               {high_pc "$barso_helper_start + $barso_helper_len" addr}
+               DW_AT_name barso
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $bar_line data1
+               DW_AT_external 1 flag
+               DW_AT_low_pc $barso_helper_start addr
+               DW_AT_high_pc "$barso_helper_start + $barso_helper_len" addr
            } {
                formal_parameter {
-                   {name I}
-                   {type :$int2_label}
-                   {location {addr $global_I} SPECIAL_expr}
+                   DW_AT_name I
+                   DW_AT_type :$int2_label
+                   DW_AT_location [subst {addr $global_I}] SPECIAL_expr
                }
                formal_parameter {
-                   {name J}
-                   {type :$int2_label}
-                   {location {addr $global_J} SPECIAL_expr}
+                   DW_AT_name J
+                   DW_AT_type :$int2_label
+                   DW_AT_location [subst {addr $global_J}] SPECIAL_expr
                }
                entry_point {
-                   {name fooso}
-                   {decl_file 1 data1}
-                   {decl_line $foo_line data1}
-                   {low_pc fooso_entry_label addr}
+                   DW_AT_name fooso
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $foo_line data1
+                   DW_AT_low_pc fooso_entry_label addr
                } {
                    formal_parameter {
-                       {name J}
-                       {type :$int2_label}
-                       {location {addr $global_J} SPECIAL_expr}
+                       DW_AT_name J
+                       DW_AT_type :$int2_label
+                       DW_AT_location [subst {addr $global_J}] SPECIAL_expr
                    }
                    formal_parameter {
-                       {name K}
-                       {type :$int2_label}
-                       {location {addr $global_K} SPECIAL_expr}
+                       DW_AT_name K
+                       DW_AT_type :$int2_label
+                       DW_AT_location [subst {addr $global_K}] SPECIAL_expr
                    }
                }
            }
index 55ecf9cece7ed31780d7d1d06d491c9a978345bc..7dd859ccef68216436527f0022d7f4ed7c162fcc 100644 (file)
@@ -45,47 +45,47 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_name $srcfile}
+           DW_AT_name $srcfile
        } {
            declare_labels integer
 
            integer: DW_TAG_base_type {
-               {DW_AT_byte_size 8 DW_FORM_sdata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name integer}
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name integer
            }
 
            DW_TAG_subprogram {
-               { DW_AT_name main }
-               { DW_AT_low_pc $main_start DW_FORM_addr }
-               { DW_AT_high_pc $main_end DW_FORM_addr }
+                DW_AT_name main
+                DW_AT_low_pc $main_start DW_FORM_addr
+                DW_AT_high_pc $main_end DW_FORM_addr
            } {
                DW_TAG_variable {
-                   { DW_AT_name argc }
-                   { DW_AT_type :$integer }
-                   { DW_AT_location {
+                    DW_AT_name argc
+                    DW_AT_type :$integer
+                    DW_AT_location [subst {
                        DW_OP_entry_value {
                            DW_OP_regx $::dwarf_regnum
                        }
-                   } SPECIAL_expr }
+                   }] SPECIAL_expr
                }
            }
 
            DW_TAG_subprogram {
-               { DW_AT_name bar }
-               { DW_AT_low_pc $bar_start DW_FORM_addr }
-               { DW_AT_high_pc $bar_end DW_FORM_addr }
+                DW_AT_name bar
+                DW_AT_low_pc $bar_start DW_FORM_addr
+                DW_AT_high_pc $bar_end DW_FORM_addr
            } {
                DW_TAG_variable {
-                   { DW_AT_name foo }
-                   { DW_AT_type :$integer }
-                   { DW_AT_location {
+                    DW_AT_name foo
+                    DW_AT_type :$integer
+                    DW_AT_location [subst {
                        DW_OP_entry_value {
                            DW_OP_bregx $::dwarf_regnum 0
                            DW_OP_deref_size 4
                        }
                        DW_OP_stack_value
-                   } SPECIAL_expr }
+                   }] SPECIAL_expr
                }
            }
        }
index 954a25223daa1678d8590eb42692e3c3b9685ef0..7e60b6e28bf3d42c3b0db91c2d9b6fd19cfc19ed 100644 (file)
@@ -56,42 +56,42 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-prologue-end.c}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
-           {producer "clang version 17.0.1"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-prologue-end.c
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
+           DW_AT_producer "clang version 17.0.1"
        } {
            declare_labels char_label
 
            char_label: base_type {
-               {name char}
-               {encoding @DW_ATE_signed}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name char
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            subprogram {
-               {external 1 flag}
-               {name trivial}
-               {low_pc $trivial_start addr}
-               {high_pc "$trivial_start + $trivial_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name trivial
+               DW_AT_low_pc $trivial_start addr
+               DW_AT_high_pc "$trivial_start + $trivial_len" addr
            }
            subprogram {
-               {external 1 flag}
-               {name watch}
-               {low_pc $watch_start addr}
-               {high_pc "$watch_start + $watch_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name watch
+               DW_AT_low_pc $watch_start addr
+               DW_AT_high_pc "$watch_start + $watch_len" addr
            } {
                DW_TAG_variable {
-                   {name local}
-                   {type :$char_label}
-                   {DW_AT_location {DW_OP_reg0} SPECIAL_expr}
+                   DW_AT_name local
+                   DW_AT_type :$char_label
+                   DW_AT_location {DW_OP_reg0} SPECIAL_expr
                }
            }
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            }
        }
     }
index a8ade903e613dd0b19844c66c862d0613f1d2030..766608944fc1b1f8c518cc2c1ee8f775c8453124 100644 (file)
@@ -23,91 +23,91 @@ standard_testfile dw2-fixed-point.c dw2-fixed-point-dw.S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     pck.ads}
-                {DW_AT_comp_dir /tmp}
-        } {
-            declare_labels fp1_base_type fp2_base_type fp3_small \
-                fp3_base_type fp1_range_type
-
-            fp1_base_type: DW_TAG_base_type {
-                {DW_AT_byte_size     1 DW_FORM_sdata}
-                {DW_AT_encoding      @DW_ATE_signed_fixed}
-                {DW_AT_name          pck__fp1_type}
-                {DW_AT_binary_scale  -4 DW_FORM_sdata}
-            }
-
-            DW_TAG_variable {
-                {DW_AT_name pck__fp1_var}
-                {DW_AT_type :$fp1_base_type}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol pck__fp1_var]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-
-            DW_TAG_variable {
-                {DW_AT_name pck__fp1_var2}
-                {DW_AT_type :$fp1_base_type}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol pck__fp1_var2]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-
-            fp2_base_type: DW_TAG_base_type {
-                {DW_AT_byte_size     1 DW_FORM_sdata}
-                {DW_AT_encoding      @DW_ATE_signed_fixed}
-                {DW_AT_name          pck__fp2_type}
-                {DW_AT_decimal_scale -2 DW_FORM_sdata}
-            }
-
-            DW_TAG_variable {
-                {DW_AT_name pck__fp2_var}
-                {DW_AT_type :$fp2_base_type}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol pck__fp2_var]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-
-            fp3_small: DW_TAG_constant {
-                {DW_AT_GNU_numerator   1 DW_FORM_data1}
-                {DW_AT_GNU_denominator 30 DW_FORM_sdata}
-            }
-
-            fp3_base_type: DW_TAG_base_type {
-                {DW_AT_byte_size     1 DW_FORM_sdata}
-                {DW_AT_encoding      @DW_ATE_signed_fixed}
-                {DW_AT_name          pck__fp3_type}
-                {DW_AT_small         :$fp3_small}
-            }
-
-            DW_TAG_variable {
-                {DW_AT_name pck__fp3_var}
-                {DW_AT_type :$fp3_base_type}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol pck__fp3_var]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-
-            fp1_range_type: DW_TAG_subrange_type {
-                 {DW_AT_lower_bound 0xf0 DW_FORM_data1}
-                 {DW_AT_upper_bound 0x10 DW_FORM_data1}
-                 {DW_AT_name foo__fp1_range_type}
-                 {DW_AT_type :$fp1_base_type}
-             }
-
-             DW_TAG_variable {
-                 {DW_AT_name pck__fp1_range_var}
-                 {DW_AT_type :$fp1_range_type}
-                 {DW_AT_location {
-                     DW_OP_addr [gdb_target_symbol pck__fp1_range_var]
-                 } SPECIAL_expr}
-                 {external 1 flag}
-             }
+       DW_TAG_compile_unit {
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     pck.ads
+           DW_AT_comp_dir /tmp
+       } {
+           declare_labels fp1_base_type fp2_base_type fp3_small \
+               fp3_base_type fp1_range_type
+
+           fp1_base_type: DW_TAG_base_type {
+               DW_AT_byte_size     1 DW_FORM_sdata
+               DW_AT_encoding      @DW_ATE_signed_fixed
+               DW_AT_name          pck__fp1_type
+               DW_AT_binary_scale  -4 DW_FORM_sdata
+           }
+
+           DW_TAG_variable {
+               DW_AT_name pck__fp1_var
+               DW_AT_type :$fp1_base_type
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol pck__fp1_var]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+
+           DW_TAG_variable {
+               DW_AT_name pck__fp1_var2
+               DW_AT_type :$fp1_base_type
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol pck__fp1_var2]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+
+           fp2_base_type: DW_TAG_base_type {
+               DW_AT_byte_size     1 DW_FORM_sdata
+               DW_AT_encoding      @DW_ATE_signed_fixed
+               DW_AT_name          pck__fp2_type
+               DW_AT_decimal_scale -2 DW_FORM_sdata
+           }
+
+           DW_TAG_variable {
+               DW_AT_name pck__fp2_var
+               DW_AT_type :$fp2_base_type
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol pck__fp2_var]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+
+           fp3_small: DW_TAG_constant {
+               DW_AT_GNU_numerator   1 DW_FORM_data1
+               DW_AT_GNU_denominator 30 DW_FORM_sdata
+           }
+
+           fp3_base_type: DW_TAG_base_type {
+               DW_AT_byte_size     1 DW_FORM_sdata
+               DW_AT_encoding      @DW_ATE_signed_fixed
+               DW_AT_name          pck__fp3_type
+               DW_AT_small         :$fp3_small
+           }
+
+           DW_TAG_variable {
+               DW_AT_name pck__fp3_var
+               DW_AT_type :$fp3_base_type
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol pck__fp3_var]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+
+           fp1_range_type: DW_TAG_subrange_type {
+                DW_AT_lower_bound 0xf0 DW_FORM_data1
+                DW_AT_upper_bound 0x10 DW_FORM_data1
+                DW_AT_name foo__fp1_range_type
+                DW_AT_type :$fp1_base_type
+            }
+
+            DW_TAG_variable {
+                DW_AT_name pck__fp1_range_var
+                DW_AT_type :$fp1_range_type
+                DW_AT_location [subst {
+                    DW_OP_addr [gdb_target_symbol pck__fp1_range_var]
+                }] SPECIAL_expr
+                DW_AT_external 1 flag
+            }
        }
     }
 }
index 25a73a69708c649fd326d9d1c85ad8ef1dc7e2cf..2c8213e0ec3ba9905f320cbfc7f3c7b6c72253e2 100644 (file)
@@ -44,17 +44,17 @@ Dwarf::assemble $asm_file {
 
     cu { version 5 } {
        compile_unit {
-           {language @DW_LANG_Mips_Assembler}
-           {name $srcfile}
-           {comp_dir $objdir}
-           {stmt_list $Llines DW_FORM_sec_offset}
-           {producer "GNU AS 2.35.2"}
+           DW_AT_language @DW_LANG_Mips_Assembler
+           DW_AT_name $srcfile
+           DW_AT_comp_dir $objdir
+           DW_AT_stmt_list $Llines DW_FORM_sec_offset
+           DW_AT_producer "GNU AS 2.35.2"
        } {
            subprogram {
-               {external 1 flag}
-               {name bar}
-               {low_pc $bar_start addr}
-               {high_pc "$bar_start + $bar_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name bar
+               DW_AT_low_pc $bar_start addr
+               DW_AT_high_pc "$bar_start + $bar_len" addr
            }
        }
     }
index 309f9d8975c201f65cc75ba525617c1905bd586a..ef48038e46514d0071df38b58600c38a57d7b691 100644 (file)
@@ -29,28 +29,28 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {name file1.txt}
-           {language @DW_LANG_C}
-           {MACRO_AT_range { func }}
+           DW_AT_name file1.txt
+           DW_AT_language @DW_LANG_C
+           MACRO_AT_range { func }
        } {
            int_label: base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func { func }}
+               DW_AT_external 1 flag
+               MACRO_AT_func { func }
            } {
                formal_parameter {
-                   {name param}
-                   {variable_parameter 1 flag}
-                   {type :$int_label}
-                   {location {
+                   DW_AT_name param
+                   DW_AT_variable_parameter 1 flag
+                   DW_AT_type :$int_label
+                   DW_AT_location [subst {
                        addr [gdb_target_symbol ptr]
                        deref
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
            }
        }
index 2781cf3764b12645daeafd8b529e66e36c7c70da..ecf0614bae04029ee46505bb9929dbb4035d0ee4 100644 (file)
@@ -78,29 +78,29 @@ proc do_test { start_label func_name tag } {
 
        cu {} {
            compile_unit {
-               {producer "gcc" }
-               {language @DW_LANG_C}
-               {name ${srcfile3}}
-               {low_pc 0 addr}
-               {stmt_list ${lines_label} DW_FORM_sec_offset}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name ${srcfile3}
+               DW_AT_low_pc 0 addr
+               DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
            } {
                callee_subprog_label: subprogram {
-                   {external 1 flag}
-                   {name callee}
-                   {inline 3 data1}
+                   DW_AT_external 1 flag
+                   DW_AT_name callee
+                   DW_AT_inline 3 data1
                }
                subprogram {
-                   {external 1 flag}
-                   {name main}
-                   {low_pc $main_start addr}
-                   {high_pc "$main_start + $main_len" addr}
+                   DW_AT_external 1 flag
+                   DW_AT_name main
+                   DW_AT_low_pc $main_start addr
+                   DW_AT_high_pc "$main_start + $main_len" addr
                } {
                    inlined_subroutine {
-                       {abstract_origin %$callee_subprog_label}
-                       {low_pc $start_label addr}
-                       {high_pc line_label_6 addr}
-                       {call_file 1 data1}
-                       {call_line 18 data1}
+                       DW_AT_abstract_origin %$callee_subprog_label
+                       DW_AT_low_pc $start_label addr
+                       DW_AT_high_pc line_label_6 addr
+                       DW_AT_call_file 1 data1
+                       DW_AT_call_line 18 data1
                    }
                }
            }
index 2004dfb9f52048e2ca368346b4ae1281511133d3..3d08ac08f71969cf6413863e3b00b084d8eb252b 100644 (file)
@@ -68,29 +68,29 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {producer "gcc" }
-           {language @DW_LANG_C}
-           {name ${srcfile3}}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_producer "gcc"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile3}
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            callee_subprog_label: subprogram {
-               {external 1 flag}
-               {name callee}
-               {inline 3 data1}
+               DW_AT_external 1 flag
+               DW_AT_name callee
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {
                inlined_subroutine {
-                   {abstract_origin %$callee_subprog_label}
-                   {low_pc line_label_3 addr}
-                   {high_pc line_label_5 addr}
-                   {call_file 1 data1}
-                   {call_line 18 data1}
+                   DW_AT_abstract_origin %$callee_subprog_label
+                   DW_AT_low_pc line_label_3 addr
+                   DW_AT_high_pc line_label_5 addr
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line 18 data1
                }
            }
        }
index f7d220cf84ee4577aa794843ff18fa15f85a42c7..ad914b9c915f5136c2f6915246303e886818b9b7 100644 (file)
@@ -57,29 +57,29 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {producer "gcc" }
-           {language @DW_LANG_C}
-           {name ${srcfile3}}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_producer "gcc"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile3}
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            callee_subprog_label: subprogram {
-               {external 1 flag}
-               {name callee}
-               {inline 3 data1}
+               DW_AT_external 1 flag
+               DW_AT_name callee
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {
                inlined_subroutine {
-                   {abstract_origin %$callee_subprog_label}
-                   {low_pc line_label_3 addr}
-                   {high_pc line_label_5 addr}
-                   {call_file 1 data1}
-                   {call_line 18 data1}
+                   DW_AT_abstract_origin %$callee_subprog_label
+                   DW_AT_low_pc line_label_3 addr
+                   DW_AT_high_pc line_label_5 addr
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line 18 data1
                }
            }
        }
index 795f1e011ff4a526ef6b925a84c534c30b456348..e8668e06ff2847fc8fc9e4386063ee53c323d43e 100644 (file)
@@ -58,116 +58,116 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-inline-stepping.c}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
-           {ranges ${ranges_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-inline-stepping.c
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
+           DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name ddd}
-               {low_pc $ddd_start addr}
-               {high_pc "$ddd_start + $ddd_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name ddd
+               DW_AT_low_pc $ddd_start addr
+               DW_AT_high_pc "$ddd_start + $ddd_len" addr
            }
            subprogram {
-               {external 1 flag}
-               {name eee}
-               {low_pc $eee_start addr}
-               {high_pc "$eee_start + $eee_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name eee
+               DW_AT_low_pc $eee_start addr
+               DW_AT_high_pc "$eee_start + $eee_len" addr
            }
            subprogram {
-               {external 1 flag}
-               {name jjj}
-               {low_pc $jjj_start addr}
-               {high_pc "$jjj_start + $jjj_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name jjj
+               DW_AT_low_pc $jjj_start addr
+               DW_AT_high_pc "$jjj_start + $jjj_len" addr
            }
            subprogram {
-               {external 1 flag}
-               {name kkk}
-               {low_pc $kkk_start addr}
-               {high_pc "$kkk_start + $kkk_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name kkk
+               DW_AT_low_pc $kkk_start addr
+               DW_AT_high_pc "$kkk_start + $kkk_len" addr
            }
            aaa_label: subprogram {
-               {name aaa}
-               {inline 3 data1}
+               DW_AT_name aaa
+               DW_AT_inline 3 data1
            }
            bbb_label: subprogram {
-               {name bbb}
-               {inline 3 data1}
+               DW_AT_name bbb
+               DW_AT_inline 3 data1
            }
            ccc_label: subprogram {
-               {name ccc}
-               {inline 3 data1}
+               DW_AT_name ccc
+               DW_AT_inline 3 data1
            }
            ggg_label: subprogram {
-               {name ggg}
-               {inline 3 data1}
+               DW_AT_name ggg
+               DW_AT_inline 3 data1
            }
            hhh_label: subprogram {
-               {name hhh}
-               {inline 3 data1}
+               DW_AT_name hhh
+               DW_AT_inline 3 data1
            }
            iii_label: subprogram {
-               {name iii}
-               {inline 3 data1}
+               DW_AT_name iii
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {
                inlined_subroutine {
-                   {abstract_origin %$aaa_label}
-                   {low_pc main_label2 addr}
-                   {high_pc main_label3 addr}
-                   {call_file 1 data1}
-                   {call_line $call_in_main data1}
+                   DW_AT_abstract_origin %$aaa_label
+                   DW_AT_low_pc main_label2 addr
+                   DW_AT_high_pc main_label3 addr
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line $call_in_main data1
                } {
                    inlined_subroutine {
-                       {abstract_origin %$bbb_label}
-                       {low_pc main_label2 addr}
-                       {high_pc main_label3 addr}
-                       {call_file 1 data1}
-                       {call_line $call_in_aaa data1}
+                       DW_AT_abstract_origin %$bbb_label
+                       DW_AT_low_pc main_label2 addr
+                       DW_AT_high_pc main_label3 addr
+                       DW_AT_call_file 1 data1
+                       DW_AT_call_line $call_in_aaa data1
                    }  {
                        inlined_subroutine {
-                           {abstract_origin %$ccc_label}
-                           {low_pc main_label2 addr}
-                           {high_pc main_label3 addr}
-                           {call_file 1 data1}
-                           {call_line $call_in_bbb data1}
+                           DW_AT_abstract_origin %$ccc_label
+                           DW_AT_low_pc main_label2 addr
+                           DW_AT_high_pc main_label3 addr
+                           DW_AT_call_file 1 data1
+                           DW_AT_call_line $call_in_bbb data1
                        }
                    }
                }
            }
            subprogram {
-               {external 1 flag}
-               {name fff}
-               {low_pc $fff_start addr}
-               {high_pc "$fff_start + $fff_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name fff
+               DW_AT_low_pc $fff_start addr
+               DW_AT_high_pc "$fff_start + $fff_len" addr
            }  {
                inlined_subroutine {
-                   {abstract_origin %$ggg_label}
-                   {low_pc fff_label addr}
-                   {high_pc main_label2 addr}
-                   {call_file 1 data1}
-                   {call_line $call_in_fff data1}
+                   DW_AT_abstract_origin %$ggg_label
+                   DW_AT_low_pc fff_label addr
+                   DW_AT_high_pc main_label2 addr
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line $call_in_fff data1
                } {
                    inlined_subroutine {
-                       {abstract_origin %$hhh_label}
-                       {low_pc fff_label addr}
-                       {high_pc fff_label2 addr}
-                       {call_file 1 data1}
-                       {call_line $call_in_ggg data1}
+                       DW_AT_abstract_origin %$hhh_label
+                       DW_AT_low_pc fff_label addr
+                       DW_AT_high_pc fff_label2 addr
+                       DW_AT_call_file 1 data1
+                       DW_AT_call_line $call_in_ggg data1
                    }  {
                        inlined_subroutine {
-                           {abstract_origin %$iii_label}
-                           {low_pc fff_label addr}
-                           {high_pc fff_label2 addr}
-                           {call_file 1 data1}
-                           {call_line $call_in_hhh data1}
+                           DW_AT_abstract_origin %$iii_label
+                           DW_AT_low_pc fff_label addr
+                           DW_AT_high_pc fff_label2 addr
+                           DW_AT_call_file 1 data1
+                           DW_AT_call_line $call_in_hhh data1
                        }
                    }
                }
index 12812dd439822b4297cdd568b0db6241e475aa42..a4309d4bdd6b0a68d1b80c6dc13f48e0b461c8c6 100644 (file)
@@ -47,29 +47,29 @@ Dwarf::assemble $asm_file {
        # time of writing this, GCC for x86-64 doesn't make use of
        # skip_prologue_using_sal, while clang does.
        compile_unit {
-           {producer "clang xxxx" }
-           {language @DW_LANG_C}
-           {name ${srcfile3}}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_producer "clang xxxx"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile3}
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            callee_subprog_label: subprogram {
-               {external 1 flag}
-               {name callee}
-               {inline 3 data1}
+               DW_AT_external 1 flag
+               DW_AT_name callee
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {
                inlined_subroutine {
-                   {abstract_origin %$callee_subprog_label}
-                   {low_pc line_label_1 addr}
-                   {high_pc line_label_2 addr}
-                   {call_file 1 data1}
-                   {call_line 21 data1}
+                   DW_AT_abstract_origin %$callee_subprog_label
+                   DW_AT_low_pc line_label_1 addr
+                   DW_AT_high_pc line_label_2 addr
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line 21 data1
                }
            }
        }
index 840d813e8a0963bb5a5f0d71a663754377eb2c94..a544616a20083dfb150cd7657d1f16eb509b9e9a 100644 (file)
@@ -49,34 +49,34 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-inline-stepping.c}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
-           {ranges ${ranges_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-inline-stepping.c
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
+           DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name bar}
-               {low_pc $bar_start addr}
-               {high_pc "$bar_start + $bar_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name bar
+               DW_AT_low_pc $bar_start addr
+               DW_AT_high_pc "$bar_start + $bar_len" addr
            }
            foo_prog: subprogram {
-               {name foo}
-               {inline 3 data1}
+               DW_AT_name foo
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {
                inlined_subroutine {
-                   {abstract_origin %$foo_prog}
-                   {low_pc main_label2 addr}
-                   {high_pc main_label3 addr}
-                   {call_file 1 data1}
-                   {call_line $call_line data1}
+                   DW_AT_abstract_origin %$foo_prog
+                   DW_AT_low_pc main_label2 addr
+                   DW_AT_high_pc main_label3 addr
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line $call_line data1
                }
            }
        }
index 320aa34e0c9b26fcce58395cce7c0e74964960d4..2674c17eb6b14befa498b55c11688faa94be6c95 100644 (file)
@@ -43,59 +43,59 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C99}
-           {name $srcfile}
-           {low_pc $main_start addr}
-           {high_pc "$main_start + $main_len" addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C99
+           DW_AT_name $srcfile
+           DW_AT_low_pc $main_start addr
+           DW_AT_high_pc "$main_start + $main_len" addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            int_label: base_type {
-               {name "int"}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name "int"
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            func_label: subprogram {
-               {name func}
-               {inline @DW_INL_declared_inlined}
+               DW_AT_name func
+               DW_AT_inline @DW_INL_declared_inlined
            } {
                num_label: DW_TAG_variable {
-                   {name num}
-                   {type :$int_label}
+                   DW_AT_name num
+                   DW_AT_type :$int_label
                }
                lexical_block {
                } {
                    value_label: DW_TAG_variable {
-                       {name value}
-                       {type :$int_label}
+                       DW_AT_name value
+                       DW_AT_type :$int_label
                    }
                }
            }
 
            subprogram {
-               {name main}
-               {external 1 flag}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_name main
+               DW_AT_external 1 flag
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {
                inlined_subroutine {
-                   {abstract_origin %$func_label}
-                   {low_pc main_label addr}
-                   {high_pc main_label2 addr}
-                   {call_file 1 data1}
-                   {call_line $func_call data1}
+                   DW_AT_abstract_origin %$func_label
+                   DW_AT_low_pc main_label addr
+                   DW_AT_high_pc main_label2 addr
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line $func_call data1
                } {
                    DW_TAG_variable {
-                       {abstract_origin %$num_label}
-                       {location {addr $global_num_addr} SPECIAL_expr}
+                       DW_AT_abstract_origin %$num_label
+                       DW_AT_location [subst {addr $global_num_addr}] SPECIAL_expr
                    }
                    lexical_block {
-                       {low_pc scope_label1 addr}
-                       {high_pc scope_label2 addr}
+                       DW_AT_low_pc scope_label1 addr
+                       DW_AT_high_pc scope_label2 addr
                    } {
                        DW_TAG_variable {
-                           {abstract_origin %$value_label}
-                           {location {addr $global_value_addr} SPECIAL_expr}
+                           DW_AT_abstract_origin %$value_label
+                           DW_AT_location [subst {addr $global_value_addr}] SPECIAL_expr
                        }
                    }
                }
index e65d1b9c0e4ed66a9722a84b98f9cb603c8f303d..8e99cb43265340b514e88f3eac00bff62fcda61a 100644 (file)
@@ -29,10 +29,12 @@ Dwarf::assemble $asm_file {
     declare_labels label1
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {MACRO_AT_range { main }}
-               {DW_AT_specification %$label1}
+               MACRO_AT_range { main }
+               DW_AT_specification %$label1
            }
        }
     }
index bfdd1a7bf7eb35de06efe3daaaca2155d8e68133..ded5f1078994d92618cf4be002e06645485aa5b5 100644 (file)
@@ -26,16 +26,20 @@ Dwarf::assemble $asm_file {
     declare_labels label1
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {MACRO_AT_range { main }}
-               {DW_AT_specification %$label1}
+               MACRO_AT_range { main }
+               DW_AT_specification %$label1
            }
        }
     }
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            label1:
        }
     }
index 3e91a5164d19367bc511d3373bf84ddc670b3973..0ae600454e137f4237927642d21e88031affe2e5 100644 (file)
@@ -30,22 +30,26 @@ Dwarf::assemble $asm_file {
     declare_labels label1 label2
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {MACRO_AT_range { main }}
-               {DW_AT_specification %$label1}
+               MACRO_AT_range { main }
+               DW_AT_specification %$label1
            }
 
            label2: subprogram {
-               {DW_AT_name main}
+               DW_AT_name main
            }
        }
     }
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            label1: subprogram {
-               {DW_AT_specification %$label2}
+               DW_AT_specification %$label2
            }
        }
     }
index dba8b83ae4a6c5c1b509ebe8c33a4c9ce09e2057..fc72cf78ef3f91b433be94225b240b4904689d14 100644 (file)
@@ -27,36 +27,36 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {stmt_list $L1 DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_stmt_list $L1 DW_FORM_sec_offset
        } {
            tag_variable {
-               {name var1}
-               {abstract_origin %$var_label}
-               {const_value 1 DW_FORM_sdata}
+               DW_AT_name var1
+               DW_AT_abstract_origin %$var_label
+               DW_AT_const_value 1 DW_FORM_sdata
            }
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
            int_label: base_type {
-               {byte_size 4 udata}
-               {encoding @DW_ATE_signed}
-               {name int}
+               DW_AT_byte_size 4 udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {stmt_list $L2 DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_stmt_list $L2 DW_FORM_sec_offset
        } {
            var_label: tag_variable {
-               {name "var1"}
-               {type %$int_label}
-               {decl_file 1}
-               {decl_line 1}
+               DW_AT_name "var1"
+               DW_AT_type %$int_label
+               DW_AT_decl_file 1
+               DW_AT_decl_line 1
            }
        }
     }
index ff91d637023485f44c585fa8196b4ce42fa6ce2a..77bac5211dbc9f27e1ad8df8c9bc31657aff0cb2 100644 (file)
@@ -42,16 +42,16 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-is-stmt.c}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-is-stmt.c
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {}
        }
     }
index d3049637a7168a5ea8a9495ec0bcf703fff3b9e8..1b9ccaad5f92c4c7ef848d0371d1408c52321a47 100644 (file)
@@ -42,16 +42,16 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-is-stmt.c}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-is-stmt.c
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            } {}
        }
     }
index ae7f97e2a4543eaafc7c5ceda8ea65205f0d83b5..a973a11a66b3579356441dabbdda8d81b2be4416 100644 (file)
@@ -24,29 +24,29 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {MACRO_AT_range {main}}
+           MACRO_AT_range {main}
        } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
-               {DW_AT_external 1 flag}
+               MACRO_AT_func {main}
+               DW_AT_external 1 flag
            } {
                DW_TAG_lexical_block {
                } {
                    DW_TAG_variable {
-                       {DW_AT_name testvar}
-                           {DW_AT_type :$integer_label}
-                           {DW_AT_external 1 flag}
-                       {DW_AT_location {
+                       DW_AT_name testvar
+                       DW_AT_type :$integer_label
+                       DW_AT_external 1 flag
+                       DW_AT_location [subst {
                            DW_OP_addr [gdb_target_symbol main]
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                }
            }
index d46f0033119c79eb6ae6aa2846c8cbcab8d904be..144e62e8bfe3b43145e76d1320c6d3f1b5eab2ed 100644 (file)
@@ -32,21 +32,21 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-line-number-zero.c}
-           {stmt_list $Llines DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-line-number-zero.c
+           DW_AT_stmt_list $Llines DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {bar1}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {bar1}
            }
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {bar2}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {bar2}
            }
        }
     }
index 16ca54e746e0b20b446a1620ec9df6a43e1c5457..6eacf0be80cdbeba9e847076277bedae2bfb2254 100644 (file)
@@ -59,21 +59,21 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} {
 
        cu { version $cv is_64 $cdw64 } {
            compile_unit {
-               {language @DW_LANG_C}
-               {name $srcfile}
-               {stmt_list $Llines DW_FORM_sec_offset}
+               DW_AT_language @DW_LANG_C
+               DW_AT_name $srcfile
+               DW_AT_stmt_list $Llines DW_FORM_sec_offset
            } {
                subprogram {
-                   {external 1 flag}
-                   {name main}
-                   {low_pc $main_start addr}
-                   {high_pc "$main_start + $main_len" addr}
+                   DW_AT_external 1 flag
+                   DW_AT_name main
+                   DW_AT_low_pc $main_start addr
+                   DW_AT_high_pc "$main_start + $main_len" addr
                }
                subprogram {
-                   {external 1 flag}
-                   {name bar}
-                   {low_pc $bar_start addr}
-                   {high_pc "$bar_start + $bar_len" addr}
+                   DW_AT_external 1 flag
+                   DW_AT_name bar
+                   DW_AT_low_pc $bar_start addr
+                   DW_AT_high_pc "$bar_start + $bar_len" addr
                }
            }
        }
index 309875a854a7cfd1cab31ce49568dc31fce851c5..e05e4c92562815b3bb0698599f453a5e631071d9 100644 (file)
@@ -33,12 +33,12 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name $srcfile}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name $srcfile
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
        }
     }
index 44b1726a1c75927a4e70dd5c3bb8a2f358526a3d..998b614a1939b29d360df908f899c6f136a7263d 100644 (file)
@@ -31,8 +31,8 @@ Dwarf::assemble $asm_file {
        # We should have either one of DW_TAG_compile_unit,
        # DW_TAG_partial_unit, or DW_TAG_type_unit here.
        subprogram {
-           {external 1 flag}
-           {MACRO_AT_func {main}}
+           DW_AT_external 1 flag
+           MACRO_AT_func {main}
        }
     }
 }
index d93080129cce989323c3f3e1aba463bcb6e982e2..ebbe6c05f91f496531c9e6fdbd961740df9dbbd0 100644 (file)
@@ -27,26 +27,26 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
        } {
            declare_labels myint
 
            myint: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      myint}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      myint
            }
 
            DW_TAG_namespace {} {
                DW_TAG_variable {
-                   {DW_AT_name v}
-                   {DW_AT_linkage_name _ZN12_GLOBAL__N_11vE}
-                   {DW_AT_location {
+                   DW_AT_name v
+                   DW_AT_linkage_name _ZN12_GLOBAL__N_11vE
+                   DW_AT_location [subst {
                        DW_OP_addr [gdb_target_symbol _ZN12_GLOBAL__N_11vE]
-                   } SPECIAL_expr}
-                   {DW_AT_type :$myint}
+                   }] SPECIAL_expr
+                   DW_AT_type :$myint
                }
            }
        }
index 86ea143d68a328580cdab1f6f2dcaebaf6ceccce..526f88af7accd971505e4c1496c0aa8e272e7816 100644 (file)
@@ -28,167 +28,167 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name $srcfile}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name $srcfile
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            declare_labels integer_label
            set int_size [get_sizeof "int" 4]
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name int}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
 
            DW_TAG_subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            }
 
            DW_TAG_variable {
-               {DW_AT_name file_locno_resolvable}
-               {DW_AT_type :$integer_label}
+               DW_AT_name file_locno_resolvable
+               DW_AT_type :$integer_label
            }
            DW_TAG_variable {
-               {DW_AT_name file_locno_unresolvable}
-               {DW_AT_type :$integer_label}
+               DW_AT_name file_locno_unresolvable
+               DW_AT_type :$integer_label
            }
            DW_TAG_variable {
-               {DW_AT_name file_locempty_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name file_locempty_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name file_locempty_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name file_locempty_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name file_locaddr_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {
+               DW_AT_name file_locaddr_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol file_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
            DW_TAG_variable {
-               {DW_AT_name file_locaddr_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {
+               DW_AT_name file_locaddr_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol file_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name file_extern_locno_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
+               DW_AT_name file_extern_locno_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
            }
            DW_TAG_variable {
-               {DW_AT_name file_extern_locno_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
+               DW_AT_name file_extern_locno_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
            }
            DW_TAG_variable {
-               {DW_AT_name file_extern_locempty_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name file_extern_locempty_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name file_extern_locempty_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name file_extern_locempty_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name file_extern_locaddr_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {
+               DW_AT_name file_extern_locaddr_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol file_extern_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
            DW_TAG_variable {
-               {DW_AT_name file_extern_locaddr_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {
+               DW_AT_name file_extern_locaddr_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol file_extern_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name main_local_locno_resolvable}
-               {DW_AT_type :$integer_label}
+               DW_AT_name main_local_locno_resolvable
+               DW_AT_type :$integer_label
            }
            DW_TAG_variable {
-               {DW_AT_name main_local_locno_unresolvable}
-               {DW_AT_type :$integer_label}
+               DW_AT_name main_local_locno_unresolvable
+               DW_AT_type :$integer_label
            }
            DW_TAG_variable {
-               {DW_AT_name main_local_locempty_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name main_local_locempty_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name main_local_locempty_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name main_local_locempty_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name main_local_locaddr_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {
+               DW_AT_name main_local_locaddr_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol main_local_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
            DW_TAG_variable {
-               {DW_AT_name main_local_locaddr_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_location {
+               DW_AT_name main_local_locaddr_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol main_local_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name main_extern_locno_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
+               DW_AT_name main_extern_locno_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
            }
            DW_TAG_variable {
-               {DW_AT_name main_extern_locno_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
+               DW_AT_name main_extern_locno_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
            }
            DW_TAG_variable {
-               {DW_AT_name main_extern_locempty_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name main_extern_locempty_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name main_extern_locempty_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {} DW_FORM_block1}
+               DW_AT_name main_extern_locempty_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location {} DW_FORM_block1
            }
            DW_TAG_variable {
-               {DW_AT_name main_extern_locaddr_resolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {
+               DW_AT_name main_extern_locaddr_resolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol main_extern_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
            DW_TAG_variable {
-               {DW_AT_name main_extern_locaddr_unresolvable}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {
+               DW_AT_name main_extern_locaddr_unresolvable
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol main_extern_locaddr_resolvable]
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
        }
     }
index 870c8c15a4cd17609b2a169b4cd270a89da4d702..866df3ac1050ff7902af1b66cbe56756b3cc07f9 100644 (file)
@@ -46,74 +46,74 @@ proc build_test_program {} {
        cu { addr_size 4 } {
     
            DW_TAG_compile_unit {
-               {DW_AT_language @DW_LANG_C99}
-               {DW_AT_name     $srcfile}
-               {DW_AT_comp_dir /tmp}
+               DW_AT_language @DW_LANG_C99
+               DW_AT_name     $srcfile
+               DW_AT_comp_dir /tmp
            } {
                declare_labels int_label struct_label pointer_label \
                               array_label
 
                int_label: DW_TAG_base_type {
-                   {DW_AT_byte_size 4 DW_FORM_sdata}
-                   {DW_AT_encoding  @DW_ATE_signed}
-                   {DW_AT_name      integer}
+                   DW_AT_byte_size 4 DW_FORM_sdata
+                   DW_AT_encoding  @DW_ATE_signed
+                   DW_AT_name      integer
                }
     
                array_label: DW_TAG_array_type {
-                   {DW_AT_name foo__array_type}
-                   {DW_AT_type :$int_label}
+                   DW_AT_name foo__array_type
+                   DW_AT_type :$int_label
                } {
                    DW_TAG_subrange_type {
-                       {DW_AT_type        :$int_label}
-                       {DW_AT_lower_bound 0   DW_FORM_data1}
-                       {DW_AT_upper_bound 127 DW_FORM_data1}
+                       DW_AT_type         :$int_label
+                       DW_AT_lower_bound 0   DW_FORM_data1
+                       DW_AT_upper_bound 127 DW_FORM_data1
                    }   
                }
     
                struct_label: DW_TAG_structure_type {
-                   {DW_AT_name "foo"}
-                   {DW_AT_byte_size 12 DW_FORM_sdata}
+                   DW_AT_name "foo"
+                   DW_AT_byte_size 12 DW_FORM_sdata
                } {
                    member {
-                       {name a}
-                       {type :$int_label}
-                       {data_member_location 0 data1}
+                       DW_AT_name a
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 0 data1
                    }
                    member {
-                       {name x}
-                       {type :$array_label}
-                       {data_member_location 4 data1}
+                       DW_AT_name x
+                       DW_AT_type :$array_label
+                       DW_AT_data_member_location 4 data1
                    }
                    member {
-                       {name y}
-                       {type :$pointer_label}
-                       {data_member_location 8 data1}
+                       DW_AT_name y
+                       DW_AT_type :$pointer_label
+                       DW_AT_data_member_location 8 data1
                    }
                }
     
                pointer_label: DW_TAG_pointer_type {
-                   {DW_AT_byte_size 4 DW_FORM_sdata}
-                   {DW_AT_type  :$struct_label}
+                   DW_AT_byte_size 4 DW_FORM_sdata
+                   DW_AT_type  :$struct_label
                }
     
                DW_TAG_subprogram {
-                   {DW_AT_name func01}
-                   {DW_AT_type :$int_label}
-                   {external   1 flag}
-                   {MACRO_AT_func {func01}}
+                   DW_AT_name func01
+                   DW_AT_type :$int_label
+                   DW_AT_external   1 flag
+                   MACRO_AT_func {func01}
                } {
                    DW_TAG_variable {
-                       {DW_AT_name ptr}
-                       {DW_AT_type :$pointer_label}
-                       {DW_AT_location {} DW_FORM_block1}
+                       DW_AT_name ptr
+                       DW_AT_type :$pointer_label
+                       DW_AT_location {} DW_FORM_block1
                    }
                }
     
                DW_TAG_subprogram {
-                   {DW_AT_name main}
-                   {DW_AT_type :$int_label}
-                   {external   1 flag}
-                   {MACRO_AT_func {main}}
+                   DW_AT_name main
+                   DW_AT_type :$int_label
+                   DW_AT_external   1 flag
+                   MACRO_AT_func {main}
                } {
                }
            }
index 79c03c743a5e040e5b8fcc8e8cf0ec22f4486207..70db4712f49b2b9816ec2e699b3f42f17b408358 100644 (file)
@@ -39,15 +39,15 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name $srcfile}
-           {stmt_list $Llines DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name $srcfile
+           DW_AT_stmt_list $Llines DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start}
-               {high_pc $main_end addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start
+               DW_AT_high_pc $main_end addr
            }
        }
     }
index eea17b0e23066d76728df8026bb76d478c011ced..cf94c71519f82d3b1359ddce246d0f3e12017bc3 100644 (file)
@@ -30,21 +30,21 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-prologue-end.c}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-prologue-end.c
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name foo}
-               {low_pc foo_label addr}
-               {high_pc foo_end addr}
+               DW_AT_external 1 flag
+               DW_AT_name foo
+               DW_AT_low_pc foo_label addr
+               DW_AT_high_pc foo_end addr
            }
            subprogram {
-               {external 1 flag}
-               {name bar}
-               {low_pc bar_label addr}
-               {high_pc bar_end addr}
+               DW_AT_external 1 flag
+               DW_AT_name bar
+               DW_AT_low_pc bar_label addr
+               DW_AT_high_pc bar_end addr
            }
        }
     }
index 070865b939669e61e8605e037fa4ccdbe5b0fd33..8e66abea93c546768ec2027c3d41034690b4c9d5 100644 (file)
@@ -32,15 +32,15 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-prologue-end.c}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-prologue-end.c
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc "$main_start + $main_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc "$main_start + $main_len" addr
            }
        }
     }
index e63bbc34abb01c6c5cf5b0da6989634fb3e6b021..9e39f6bcc0cea6d09ea2494fa9211c8ee589707c 100644 (file)
@@ -45,22 +45,22 @@ Dwarf::assemble $asm_file {
     # .debug_ranges data then the test achieves its objective.
     cu { label cu_label } {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw-ranges-base.c}
-           {stmt_list $L DW_FORM_sec_offset}
-           {ranges ${ranges_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw-ranges-base.c
+           DW_AT_stmt_list $L DW_FORM_sec_offset
+           DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
+               DW_AT_external 1 flag
+               DW_AT_name main
            }
            subprogram {
-               {external 1 flag}
-               {name frame2}
+               DW_AT_external 1 flag
+               DW_AT_name frame2
            }
            subprogram {
-               {external 1 flag}
-               {name frame3}
+               DW_AT_external 1 flag
+               DW_AT_name frame3
            }
        }
     }
index 9fea8a8d6b283e4b9f92214f2e884e9cdd0432c4..56aab606e181e45d6a751f8fe84a064820f8f4a2 100644 (file)
@@ -70,49 +70,49 @@ proc do_test {suffix} {
 
        cu {} {
            compile_unit {
-               {language @DW_LANG_C}
-               {name dw-ranges-func2.c}
-               {stmt_list $L DW_FORM_sec_offset}
-               {low_pc 0 addr}
-               {ranges ${cu_ranges_label} DW_FORM_sec_offset}
+               DW_AT_language @DW_LANG_C
+               DW_AT_name dw-ranges-func2.c
+               DW_AT_stmt_list $L DW_FORM_sec_offset
+               DW_AT_low_pc 0 addr
+               DW_AT_ranges ${cu_ranges_label} DW_FORM_sec_offset
            } {
                integer_label: DW_TAG_base_type {
-                   {DW_AT_byte_size $int_size DW_FORM_sdata}
-                   {DW_AT_encoding  @DW_ATE_signed}
-                   {DW_AT_name      integer}
+                   DW_AT_byte_size $int_size DW_FORM_sdata
+                   DW_AT_encoding  @DW_ATE_signed
+                   DW_AT_name      integer
                }
                volatile_label: DW_TAG_volatile_type {
-                   {type :$integer_label}
+                   DW_AT_type :$integer_label
                }
                DW_TAG_variable {
-                   {name e}
-                   {external 1 flag}
-                   {type :$volatile_label}
-                   {location {addr $e_var} SPECIAL_expr}
+                   DW_AT_name e
+                   DW_AT_external 1 flag
+                   DW_AT_type :$volatile_label
+                   DW_AT_location [subst {addr $e_var}] SPECIAL_expr
                }
                subprogram {
-                   {external 1 flag}
-                   {name main}
-                   {DW_AT_type :$integer_label}
-                   {low_pc $main_start addr}
-                   {high_pc $main_len DW_FORM_data4}
+                   DW_AT_external 1 flag
+                   DW_AT_name main
+                   DW_AT_type :$integer_label
+                   DW_AT_low_pc $main_start addr
+                   DW_AT_high_pc $main_len DW_FORM_data4
                }
                subprogram {
-                   {external 1 flag}
-                   {name foo}
-                   {ranges ${func_ranges_label} DW_FORM_sec_offset}
+                   DW_AT_external 1 flag
+                   DW_AT_name foo
+                   DW_AT_ranges ${func_ranges_label} DW_FORM_sec_offset
                }
                subprogram {
-                   {external 1 flag}
-                   {name bar}
-                   {low_pc $bar_start addr}
-                   {high_pc $bar_len DW_FORM_data4}
+                   DW_AT_external 1 flag
+                   DW_AT_name bar
+                   DW_AT_low_pc $bar_start addr
+                   DW_AT_high_pc $bar_len DW_FORM_data4
                }
                subprogram {
-                   {external 1 flag}
-                   {name baz}
-                   {low_pc $baz_start addr}
-                   {high_pc $baz_len DW_FORM_data4}
+                   DW_AT_external 1 flag
+                   DW_AT_name baz
+                   DW_AT_low_pc $baz_start addr
+                   DW_AT_high_pc $baz_len DW_FORM_data4
                }
            }
        }
index 8e7d51ee72018b8e2837e1f92fbf3b9e8e390f4c..75c874e0ffc7a466f473f828ca7d42ccb07b170f 100644 (file)
@@ -44,13 +44,13 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name $srcfile}
-           {ranges ${ranges_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name $srcfile
+           DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {name quux}
+               DW_AT_external 1 flag
+               DW_AT_name quux
            }
        }
     }
index 6120878a1fb49a47086de9464b3a095fe6c9b24d..fa1e03ba098845101236532a0b4d75748ff157b9 100644 (file)
@@ -61,31 +61,31 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw-ranges-psym.c}
-           {low_pc 0 addr}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw-ranges-psym.c
+           DW_AT_low_pc 0 addr
        } {
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
            subprogram {
-               {external 1 flag}
-               {name foo}
-               {ranges ${func_ranges_label} DW_FORM_sec_offset}
+               DW_AT_external 1 flag
+               DW_AT_name foo
+               DW_AT_ranges ${func_ranges_label} DW_FORM_sec_offset
            }
            subprogram {
-               {external 1 flag}
-               {name bar}
-               {low_pc $bar_start addr}
-               {high_pc $bar_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name bar
+               DW_AT_low_pc $bar_start addr
+               DW_AT_high_pc $bar_len DW_FORM_data4
            }
            subprogram {
-               {external 1 flag}
-               {name baz}
-               {low_pc $baz_start addr}
-               {high_pc $baz_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name baz
+               DW_AT_low_pc $baz_start addr
+               DW_AT_high_pc $baz_len DW_FORM_data4
            }
        }
     }
index e8c98908fd2f60f5700243bf70b2fa98ebef8b1a..6440722699e0b9146c7668dc1d292c2ebc06c8ab 100644 (file)
@@ -63,35 +63,35 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw-ranges-psym.c}
-           {low_pc 0 addr}
-           {ranges ${cu_ranges_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw-ranges-psym.c
+           DW_AT_low_pc 0 addr
+           DW_AT_ranges ${cu_ranges_label} DW_FORM_sec_offset
        } {
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
            volatile_label: DW_TAG_volatile_type {
-               {type :$integer_label}
+               DW_AT_type :$integer_label
            }
            subprogram {
-               {external 1 flag}
-               {name someothername}
-               {ranges ${func_ranges_label} DW_FORM_sec_offset}
+               DW_AT_external 1 flag
+               DW_AT_name someothername
+               DW_AT_ranges ${func_ranges_label} DW_FORM_sec_offset
            }
            subprogram {
-               {external 1 flag}
-               {name bar}
-               {low_pc $bar_start addr}
-               {high_pc $bar_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name bar
+               DW_AT_low_pc $bar_start addr
+               DW_AT_high_pc $bar_len DW_FORM_data4
            }
            subprogram {
-               {external 1 flag}
-               {name baz}
-               {low_pc $baz_start addr}
-               {high_pc $baz_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name baz
+               DW_AT_low_pc $baz_start addr
+               DW_AT_high_pc $baz_len DW_FORM_data4
            }
        }
     }
index 5f3c324e28982e17da26d31a0ec954c48b65e238..7cfeb5894f39b41f7a69dba4a5789f8034daaac2 100644 (file)
@@ -27,27 +27,27 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {MACRO_AT_range {main}}
+           MACRO_AT_range {main}
        } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            DW_TAG_subprogram {
-               {DW_AT_external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            } {
                DW_TAG_variable {
-                   {DW_AT_name bregx}
-                       {DW_AT_type :$integer_label}
-                       {DW_AT_external 1 flag}
-                   {DW_AT_location {
+                   DW_AT_name bregx
+                       DW_AT_type :$integer_label
+                       DW_AT_external 1 flag
+                   DW_AT_location {
                        DW_OP_bregx 0xffffffff 0
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
            }
        }
index 2c2b5ffc7446cfc5e702916dbdd00bf7e760efbe..1d86c61eccf6cd15598d6818e4805c035a9f564d 100644 (file)
@@ -40,14 +40,14 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name $::srcfile}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name $::srcfile
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
        }
     }
index a2f36cf704e87b4983a010db4ea7f37537f3df66..1eb1e38cd98d425e12763bc9ddca2c902e043735 100644 (file)
@@ -79,48 +79,48 @@ Dwarf::assemble $asm_file {
 
     cu { version 4 } {
        compile_unit {
-           {producer "gcc"}
-           {language @DW_LANG_C}
-           {name ${srcfile}}
-           {comp_dir /tmp}
-           {stmt_list $lines_table DW_FORM_sec_offset}
-           {low_pc 0 addr}
+           DW_AT_producer "gcc"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile}
+           DW_AT_comp_dir /tmp
+           DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+           DW_AT_low_pc 0 addr
        } {
            bar_label: subprogram {
-               {external 1 flag}
-               {name bar}
-               {decl_file 1 data1}
-               {decl_line $bar_decl_line data1}
-               {decl_column 1 data1}
-               {inline 3 data1}
+               DW_AT_external 1 flag
+               DW_AT_name bar
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $bar_decl_line data1
+               DW_AT_decl_column 1 data1
+               DW_AT_inline 3 data1
            }
            baz_label: subprogram {
-               {external 1 flag}
-               {name baz}
-               {decl_file 1 data1}
-               {decl_line $baz_decl_line data1}
-               {decl_column 1 data1}
-               {inline 3 data1}
+               DW_AT_external 1 flag
+               DW_AT_name baz
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $baz_decl_line data1
+               DW_AT_decl_column 1 data1
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {name foo}
-               {decl_file 1 data1}
-               {decl_line $foo_decl_line data1}
-               {decl_column 1 data1}
-               {ranges ${ranges_label_foo} DW_FORM_sec_offset}
-               {external 1 flag}
+               DW_AT_name foo
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $foo_decl_line data1
+               DW_AT_decl_column 1 data1
+               DW_AT_ranges ${ranges_label_foo} DW_FORM_sec_offset
+               DW_AT_external 1 flag
            } {
                inlined_subroutine {
-                   {abstract_origin %$bar_label}
-                   {call_file 1 data1}
-                   {call_line $foo_src_2 data1}
-                   {ranges ${ranges_label_bar} DW_FORM_sec_offset}
+                   DW_AT_abstract_origin %$bar_label
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line $foo_src_2 data1
+                   DW_AT_ranges ${ranges_label_bar} DW_FORM_sec_offset
                }
                inlined_subroutine {
-                   {abstract_origin %$baz_label}
-                   {call_file 1 data1}
-                   {call_line $foo_src_3 data1}
-                   {ranges ${ranges_label_baz} DW_FORM_sec_offset}
+                   DW_AT_abstract_origin %$baz_label
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line $foo_src_3 data1
+                   DW_AT_ranges ${ranges_label_baz} DW_FORM_sec_offset
                }
            }
        }
index ea8c7d3e19fbcfa9052114c9f988cee2c9797402..1a76c58953b0e025c957dac9a387c25b7c74fe6e 100644 (file)
@@ -71,34 +71,34 @@ Dwarf::assemble $asm_file {
 
     cu { version 4 } {
        compile_unit {
-           {producer "gcc"}
-           {language @DW_LANG_C}
-           {name ${srcfile}}
-           {comp_dir /tmp}
-           {stmt_list $lines_table DW_FORM_sec_offset}
-           {low_pc 0 addr}
+           DW_AT_producer "gcc"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile}
+           DW_AT_comp_dir /tmp
+           DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+           DW_AT_low_pc 0 addr
        } {
            bar_label: subprogram {
-               {external 1 flag}
-               {name bar}
-               {decl_file 1 data1}
-               {decl_line $bar_decl_line data1}
-               {decl_column 1 data1}
-               {inline 3 data1}
+               DW_AT_external 1 flag
+               DW_AT_name bar
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $bar_decl_line data1
+               DW_AT_decl_column 1 data1
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {name foo}
-               {decl_file 1 data1}
-               {decl_line $foo_decl_line data1}
-               {decl_column 1 data1}
-               {ranges ${ranges_label_foo} DW_FORM_sec_offset}
-               {external 1 flag}
+               DW_AT_name foo
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line $foo_decl_line data1
+               DW_AT_decl_column 1 data1
+               DW_AT_ranges ${ranges_label_foo} DW_FORM_sec_offset
+               DW_AT_external 1 flag
            } {
                inlined_subroutine {
-                   {abstract_origin %$bar_label}
-                   {call_file 1 data1}
-                   {call_line $foo_src_3 data1}
-                   {ranges ${ranges_label_bar} DW_FORM_sec_offset}
+                   DW_AT_abstract_origin %$bar_label
+                   DW_AT_call_file 1 data1
+                   DW_AT_call_line $foo_src_3 data1
+                   DW_AT_ranges ${ranges_label_bar} DW_FORM_sec_offset
                }
            }
        }
index a2d197bee576cb993eb5d6b3b2f03c56710f8d22..3eaaa526794d826cfe838d64ed7bc10805ec7b1a 100644 (file)
@@ -50,17 +50,17 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name $srcfile}
-           {stmt_list $Llines DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name $srcfile
+           DW_AT_stmt_list $Llines DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {bar}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {bar}
            }
        }
     }
index aaa32aec59d41128d57dff1217412f27969d3221..ccee277a5905ae206c03471395337ec0d6616f1e 100644 (file)
@@ -54,23 +54,23 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        partial_label: partial_unit {
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      myint}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      myint
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {DW_AT_name bla.c}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name bla.c
        } {
            imported_unit {
-               {import $partial_label ref_addr}
+               DW_AT_import $partial_label ref_addr
            }
        }
     }
index fce4346feafefd9c1d04ed23ea1634bd80a82e15..3e34c3cc5d0c5f9358c3826c76648e5e5aff195b 100644 (file)
@@ -38,11 +38,11 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            imported_unit {
-               {import $partial_label ref_addr}
+               DW_AT_import $partial_label ref_addr
            }
        }
     }
index d8b738d38c77b585c47cb0eea731249c9fd6ba9e..fb257f0ccc5b581ef69c0340086f826b24ce5eb1 100644 (file)
@@ -102,32 +102,32 @@ proc run_test { entry_label dwarf_version with_line_table } {
 
        cu { version $dwarf_version } {
            compile_unit {
-               {producer "gcc"}
-               {language @DW_LANG_C}
-               {name $::srcfile}
-               {comp_dir /tmp}
-               {stmt_list $lines_table DW_FORM_sec_offset}
-               {low_pc 0 addr}
+               DW_AT_producer "gcc"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name $::srcfile
+               DW_AT_comp_dir /tmp
+               DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+               DW_AT_low_pc 0 addr
            } {
                inline_func: subprogram {
-                   {name bar}
-                   {inline @DW_INL_declared_inlined}
+                   DW_AT_name bar
+                   DW_AT_inline @DW_INL_declared_inlined
                }
                subprogram {
-                   {name foo}
-                   {decl_file 1 data1}
-                   {decl_line $::foo_decl_line data1}
-                   {decl_column 1 data1}
-                   {low_pc $::foo_start addr}
-                   {high_pc $::foo_len $::ptr_type}
-                   {external 1 flag}
+                   DW_AT_name foo
+                   DW_AT_decl_file 1 data1
+                   DW_AT_decl_line $::foo_decl_line data1
+                   DW_AT_decl_column 1 data1
+                   DW_AT_low_pc $::foo_start addr
+                   DW_AT_high_pc $::foo_len $::ptr_type
+                   DW_AT_external 1 flag
                } {
                    inlined_subroutine {
-                       {abstract_origin %$inline_func}
-                       {call_file 1 data1}
-                       {call_line $::bar_call_line data1}
-                       {entry_pc $entry_label addr}
-                       {ranges ${ranges_label} DW_FORM_sec_offset}
+                       DW_AT_abstract_origin %$inline_func
+                       DW_AT_call_file 1 data1
+                       DW_AT_call_line $::bar_call_line data1
+                       DW_AT_entry_pc $entry_label addr
+                       DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
                    }
                }
            }
index 0822c98afb67ea4682d9a960c400017d9f997695..fece76741190f519f496300766615e0c2311768b 100644 (file)
@@ -51,41 +51,41 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_Mips_Assembler}
+           DW_AT_language @DW_LANG_Mips_Assembler
        } {
            unspecified_type_label: unspecified_type {}
 
            DW_TAG_subprogram {
-               {name foo}
-               {low_pc $foo_start addr}
-               {high_pc $foo_end addr}
-               {type :$unspecified_type_label}
+               DW_AT_name foo
+               DW_AT_low_pc $foo_start addr
+               DW_AT_high_pc $foo_end addr
+               DW_AT_type :$unspecified_type_label
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_Mips_Assembler}
-           {producer "GNU AS 2.39.0"}
+           DW_AT_language @DW_LANG_Mips_Assembler
+           DW_AT_producer "GNU AS 2.39.0"
        } {
            DW_TAG_subprogram {
-               {name bar}
-               {low_pc $bar_start addr}
-               {high_pc $bar_end addr}
+               DW_AT_name bar
+               DW_AT_low_pc $bar_start addr
+               DW_AT_high_pc $bar_end addr
            }
        }
     }
 
     cu { version 2 } {
        compile_unit {
-           {language @DW_LANG_Mips_Assembler}
-           {producer "GNU AS 2.40.0"}
+           DW_AT_language @DW_LANG_Mips_Assembler
+           DW_AT_producer "GNU AS 2.40.0"
        } {
            DW_TAG_subprogram {
-               {name foo2}
-               {low_pc $foo2_start addr}
-               {high_pc $foo2_end addr}
+               DW_AT_name foo2
+               DW_AT_low_pc $foo2_start addr
+               DW_AT_high_pc $foo2_end addr
            }
        }
     }
index 0a306ddd2115403dba54a73ed1ebb7b33ae8be12..6632a86a7b8838229039dd22961187415df1951a 100644 (file)
@@ -59,49 +59,49 @@ proc run_test { field_name } {
 
        cu {} {
            DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_C}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
+               DW_AT_language @DW_LANG_C
+               DW_AT_name     $srcfile
+               DW_AT_comp_dir /tmp
            } {
                declare_labels itype ptype stype
 
                itype: DW_TAG_base_type {
-                   {DW_AT_byte_size $int_size DW_FORM_sdata}
-                   {DW_AT_encoding  @DW_ATE_signed}
-                   {DW_AT_name int}
+                   DW_AT_byte_size $int_size DW_FORM_sdata
+                   DW_AT_encoding  @DW_ATE_signed
+                   DW_AT_name int
                }
 
                stype: DW_TAG_structure_type {
-                   {DW_AT_name "foo"}
-                   {DW_AT_byte_size $int_size DW_FORM_sdata}
+                   DW_AT_name "foo"
+                   DW_AT_byte_size $int_size DW_FORM_sdata
                } {
                    member {
-                       {name $field_name}
-                       {type :$itype}
-                       {data_member_location 0 data1}
+                       DW_AT_name $field_name
+                       DW_AT_type :$itype
+                       DW_AT_data_member_location 0 data1
                    }
                }
 
                ptype: DW_TAG_pointer_type {
-                   {DW_AT_type :$stype}
+                   DW_AT_type :$stype
                }
 
                DW_TAG_variable {
-                   {DW_AT_name obj}
-                   {DW_AT_type :$stype}
-                   {DW_AT_location {
+                   DW_AT_name obj
+                   DW_AT_type :$stype
+                   DW_AT_location [subst {
                        DW_OP_addr [gdb_target_symbol obj]
-                   } SPECIAL_expr}
-                   {external 1 flag}
+                   }] SPECIAL_expr
+                   DW_AT_external 1 flag
                }
 
                DW_TAG_variable {
-                   {DW_AT_name ptr}
-                   {DW_AT_type :$ptype}
-                   {DW_AT_location {
+                   DW_AT_name ptr
+                   DW_AT_type :$ptype
+                   DW_AT_location [subst {
                        DW_OP_addr [gdb_target_symbol ptr]
-                   } SPECIAL_expr}
-                   {external 1 flag}
+                   }] SPECIAL_expr
+                   DW_AT_external 1 flag
                }
            }
        }
index e46cbe5daa01940e4b9f73459d9fd00f24b03e1f..6d8d9b1737b7a4207cbf04f4012cba11c80f1749 100644 (file)
@@ -34,51 +34,51 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-            {language @DW_LANG_C}
-            {name ${srcfile}}
-        } {
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile}
+       } {
            declare_labels int4_type struct_type
 
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            struct_type: DW_TAG_structure_type {
-               {DW_AT_name "foo_t" DW_FORM_strp}
-               {DW_AT_byte_size 12 DW_FORM_sdata}
+               DW_AT_name "foo_t" DW_FORM_strp
+               DW_AT_byte_size 12 DW_FORM_sdata
            } {
                member {
-                   {name "aa" DW_FORM_strp}
-                   {type :$int4_type}
-                   {data_member_location 0 data1}
+                   DW_AT_name "aa" DW_FORM_strp
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 0 data1
                }
                member {
-                   {name "bb" DW_FORM_strp}
-                   {type :$int4_type}
-                   {data_member_location 4 data1}
+                   DW_AT_name "bb" DW_FORM_strp
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 4 data1
                }
                member {
-                   {name "cc" DW_FORM_strp}
-                   {type :$int4_type}
-                   {data_member_location 8 data1}
+                   DW_AT_name "cc" DW_FORM_strp
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 8 data1
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name global_var DW_FORM_strp}
-               {DW_AT_type :$struct_type}
-               {DW_AT_location {
+               DW_AT_name global_var DW_FORM_strp
+               DW_AT_type :$struct_type
+               DW_AT_location [subst {
                    DW_OP_addr [gdb_target_symbol global_var]
-               } SPECIAL_expr}
-               {external 1 flag}
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
            }
 
            subprogram {
-               {external 1 flag}
-               {name main DW_FORM_strp}
-               {MACRO_AT_range {main}}
+               DW_AT_external 1 flag
+               DW_AT_name main DW_FORM_strp
+               MACRO_AT_range {main}
            }
        }
     }
index 3e4ffc4d0267d9b6cce1074e5783f828c4e742e0..6432c9db01a449b06d27ba2e73263838ad3f9384 100644 (file)
@@ -34,13 +34,13 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name dw2-vendor-extended-opcode.c}
-           {stmt_list $Llines DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name dw2-vendor-extended-opcode.c
+           DW_AT_stmt_list $Llines DW_FORM_sec_offset
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
        }
     }
index 0c76c874fc5ebb927939f959001e06ecb3edc448..35eaa16f274d5e4f316f53639c99eec77b7d4b0e 100644 (file)
@@ -35,52 +35,52 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
        } {
            declare_labels integer_label foo_t_label bar_t_label
 
            foo_t_label: DW_TAG_structure_type {
-               {name foo_t}
-               {byte_size 3 DW_FORM_sdata}
+               DW_AT_name foo_t
+               DW_AT_byte_size 3 DW_FORM_sdata
            } {
                member {
-                   {name field}
-                   {type :$integer_label}
-                   {data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name field
+                   DW_AT_type :$integer_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
            }
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 3 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 3 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            bar_t_label: DW_TAG_structure_type {
-               {name bar_t}
-               {byte_size 3 DW_FORM_sdata}
+               DW_AT_name bar_t
+               DW_AT_byte_size 3 DW_FORM_sdata
            } {
                member {
-                   {name f}
-                   {type :$foo_t_label}
-                   {data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name f
+                   DW_AT_type :$foo_t_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
            }
 
            DW_TAG_subprogram {
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc $main_len data8}
-               {DW_AT_type :$integer_label}
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_len data8
+               DW_AT_type :$integer_label
            }
 
            DW_TAG_subprogram {
-               {name get_bar}
-               {low_pc $get_bar_start addr}
-               {high_pc $get_bar_len data8}
-               {DW_AT_type :$bar_t_label}
+               DW_AT_name get_bar
+               DW_AT_low_pc $get_bar_start addr
+               DW_AT_high_pc $get_bar_len data8
+               DW_AT_type :$bar_t_label
            }
        }
     }
index 33b1515a5aa9f223d2415e8a379fd7de35600371..f892d703ab5dbe29dc1331d7d24cbe4b14e60cb7 100644 (file)
@@ -33,20 +33,20 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name $srcfile}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name $srcfile
        } {
            subprogram {
-               {MACRO_AT_range {func_demangled_test}}
-               {linkage_name "_FUNC_WRONG_MANGLED__"}
-               {name "func_demangled_test"}
-               {external 1 flag}
+               MACRO_AT_range {func_demangled_test}
+               DW_AT_linkage_name "_FUNC_WRONG_MANGLED__"
+               DW_AT_name "func_demangled_test"
+               DW_AT_external 1 flag
            }
            subprogram {
-               {MACRO_AT_range {main}}
-               {external 1 flag}
-               {name main}
-               {main_subprogram 1 flag}
+               MACRO_AT_range {main}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_main_subprogram 1 flag
            }
        }
     }
index 1d2068887b384e815c1c9efe77e82a318d3bc80b..d5faf6f74d0b0fae762f2a1fdf26afac37fb9b62 100644 (file)
@@ -96,13 +96,13 @@ foreach_with_prefix ranges_sect {ranges rnglists} {
 
            cu {} {
                compile_unit {
-                   {language @DW_LANG_C}
-                   {name $srcfile2}
-                   {ranges ${ranges_label} DW_FORM_sec_offset}
+                   DW_AT_language @DW_LANG_C
+                   DW_AT_name $srcfile2
+                   DW_AT_ranges ${ranges_label} DW_FORM_sec_offset
                } {
                    subprogram {
-                       {external 1 flag}
-                       {name foo}
+                       DW_AT_external 1 flag
+                       DW_AT_name foo
                    }
                }
            }
@@ -123,13 +123,13 @@ foreach_with_prefix ranges_sect {ranges rnglists} {
                version 5
            } {
                compile_unit {
-                   {language @DW_LANG_C}
-                   {name $srcfile2}
-                   {ranges ${rnglists_label} DW_FORM_sec_offset}
+                   DW_AT_language @DW_LANG_C
+                   DW_AT_name $srcfile2
+                   DW_AT_ranges ${rnglists_label} DW_FORM_sec_offset
                } {
                    subprogram {
-                       {external 1 flag}
-                       {name foo}
+                       DW_AT_external 1 flag
+                       DW_AT_name foo
                    }
                }
            }
index b7dc275c94bd7e66f6dba5a1e9942ff96c38c85a..d9daedf17f3e7e3aa9f57aec09799a7d348797f1 100644 (file)
@@ -28,9 +28,11 @@ Dwarf::assemble $asm_file {
     declare_labels partial_label int_label int_label2
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            subprogram {
-               {MACRO_AT_func { main }}
+               MACRO_AT_func { main }
            }
        }
     }
@@ -38,15 +40,15 @@ Dwarf::assemble $asm_file {
     cu {} {
        partial_unit {} {
            int_label: base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            constant {
-               {name the_int}
-               {type :$int_label}
-               {const_value 99 data1}
+               DW_AT_name the_int
+               DW_AT_type :$int_label
+               DW_AT_const_value 99 data1
            }
        }
     }
index 1d214c12e748a81acae3d38d0b68dbced4fdbd5b..ebccea63256c7cae2020ca3fcf4d782941f406ad 100644 (file)
@@ -28,49 +28,53 @@ Dwarf::assemble $asm_file {
     cu {} {
        partial_label: partial_unit {} {
            subprogram {
-               {MACRO_AT_func { main }}
+               MACRO_AT_func { main }
            }
        }
     }
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            int_label2: base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            constant {
-               {name the_int}
-               {type :$int_label2}
-               {const_value 99 data1}
+               DW_AT_name the_int
+               DW_AT_type :$int_label2
+               DW_AT_const_value 99 data1
            }
 
            constant {
-               {name other_int}
-               {type :$int_label2}
-               {const_value 99 data1}
+               DW_AT_name other_int
+               DW_AT_type :$int_label2
+               DW_AT_const_value 99 data1
            }
        }
     }
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            imported_unit {
-               {import $partial_label ref_addr}
+               DW_AT_import $partial_label ref_addr
            }
 
            int_label: base_type {
-               {name int}
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
+               DW_AT_name int
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            constant {
-               {name the_int}
-               {type :$int_label}
-               {const_value 23 data1}
+               DW_AT_name the_int
+               DW_AT_type :$int_label
+               DW_AT_const_value 23 data1
            }
        }
     }
index a9077eb61a19f35d44567472687d16388f4af3a4..1aa889ae4f5cf346f5b6b2142500bb1b2d9d6ce7 100644 (file)
@@ -51,7 +51,9 @@ proc write_just_debugaltlink {filename dwzname buildid} {
        # Only the DWARF reader checks .gnu_debugaltlink, so make sure
        # there is a bit of DWARF in here.
        cu { label cu_start } {
-           compile_unit {{language @DW_LANG_C}} {
+           compile_unit {
+               DW_AT_language @DW_LANG_C
+           } {
            }
        }
        aranges {} cu_start {
@@ -77,17 +79,19 @@ proc write_dwarf_file {filename buildid {value 99}} {
        }
 
        cu { label cu_start } {
-           compile_unit {{language @DW_LANG_C}} {
+           compile_unit {
+               DW_AT_language @DW_LANG_C
+           } {
                int_label2: base_type {
-                   {name int}
-                   {byte_size 4 sdata}
-                   {encoding @DW_ATE_signed}
+                   DW_AT_name int
+                   DW_AT_byte_size 4 sdata
+                   DW_AT_encoding @DW_ATE_signed
                }
 
                constant {
-                   {name the_int}
-                   {type :$int_label2}
-                   {const_value $value data1}
+                   DW_AT_name the_int
+                   DW_AT_type :$int_label2
+                   DW_AT_const_value $value data1
                }
            }
        }
index 0c486eadd4956ce2b59fb375e54a1c1564a5e1a2..b56805539a995e2d180060718e6ac745a47cadee 100644 (file)
@@ -30,11 +30,13 @@ set asm_file [standard_output_file $srcfile2]
 # one point, this caused gdb crashes.
 Dwarf::assemble $asm_file {
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            constant {
-               {name 0 DW_FORM_GNU_strp_alt}
-               {type 97 DW_FORM_GNU_ref_alt}
-               {const_value 99 data1}
+               DW_AT_name 0 DW_FORM_GNU_strp_alt
+               DW_AT_type 97 DW_FORM_GNU_ref_alt
+               DW_AT_const_value 99 data1
            }
        }
     }
index 09af96c61ff8c7bc31acd0da82812619d0044843..e4248d0de10a6b44305fa581179380544622f30d 100644 (file)
@@ -66,57 +66,57 @@ Dwarf::assemble $asm_file {
        global srcfile
 
        compile_unit {
-           {producer "gcc" }
-            {language @DW_LANG_Fortran90}
-            {name ${srcfile}}
-            {low_pc 0 addr}
-        } {
+           DW_AT_producer "gcc"
+           DW_AT_language @DW_LANG_Fortran90
+           DW_AT_name ${srcfile}
+           DW_AT_low_pc 0 addr
+       } {
            declare_labels array_type_label integer_type_label
 
-            integer_type_label: DW_TAG_base_type {
-                {DW_AT_byte_size $int_size DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      integer}
-            }
+           integer_type_label: DW_TAG_base_type {
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
+           }
 
            array_type_label: DW_TAG_array_type {
-               {DW_AT_type :$integer_type_label}
-               {DW_AT_data_location {
+               DW_AT_type :$integer_type_label
+               DW_AT_data_location {
                    DW_OP_push_object_address
                    DW_OP_deref
-               } SPECIAL_expr}
-               {DW_AT_allocated {
+               } SPECIAL_expr
+               DW_AT_allocated {
                    DW_OP_lit0
-               } SPECIAL_expr}
+               } SPECIAL_expr
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer_type_label}
-                   {DW_AT_lower_bound {
+                   DW_AT_type        :$integer_type_label
+                   DW_AT_lower_bound {
                        DW_OP_skip -3
-                   } SPECIAL_expr}
-                   {DW_AT_upper_bound {
+                   } SPECIAL_expr
+                   DW_AT_upper_bound {
                        DW_OP_skip -3
-                   } SPECIAL_expr}
-                   {DW_AT_byte_stride {
+                   } SPECIAL_expr
+                   DW_AT_byte_stride {
                        DW_OP_skip -3
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
            }
 
            DW_TAG_variable {
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol dyn_object]
-                } SPECIAL_expr}
-               {name "dyn_object"}
-               {type :$array_type_label}
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol dyn_object]
+               }] SPECIAL_expr
+               DW_AT_name "dyn_object"
+               DW_AT_type :$array_type_label
            }
           subprogram {
-              {external 1 flag}
-              {DW_AT_name main}
-              {DW_AT_low_pc $main_start DW_FORM_addr}
-              {DW_AT_high_pc $main_end DW_FORM_addr}
+              DW_AT_external 1 flag
+              DW_AT_name main
+              DW_AT_low_pc $main_start DW_FORM_addr
+              DW_AT_high_pc $main_end DW_FORM_addr
           }
-        }
+       }
     }
 }
 
index f4e02da22116bb6e7d7c2a2cf6f85e90822f3d20..a5cf54df80c02ea1141895b7a9a16a5832e4634a 100644 (file)
@@ -32,35 +32,35 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_language @DW_LANG_Ada95}
-               {DW_AT_name     $srcfile}
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name  $srcfile
        } {
            declare_labels byte array struct
 
            byte: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_unsigned}
-               {DW_AT_name      byte}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_unsigned
+               DW_AT_name       byte
            }
 
            array: DW_TAG_array_type {
-               {DW_AT_name array_type}
-               {DW_AT_type :$byte}
+               DW_AT_name array_type
+               DW_AT_type :$byte
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$byte}
-                   {DW_AT_upper_bound 3 DW_FORM_sdata}
+                   DW_AT_type         :$byte
+                   DW_AT_upper_bound 3 DW_FORM_sdata
                }
            }
 
            struct: DW_TAG_structure_type {
-               {DW_AT_name discriminated}
-               {DW_AT_byte_size 4 DW_FORM_sdata}
+               DW_AT_name discriminated
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                DW_TAG_member {
-                   {DW_AT_name disc}
-                   {DW_AT_type :$byte}
-                   {DW_AT_data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name disc
+                   DW_AT_type :$byte
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
 
                # We know this is always at offset 1 but use an
@@ -68,18 +68,19 @@ Dwarf::assemble $asm_file {
                # DWARF extension.  See
                # https://dwarfstd.org/issues/250501.1.html.
                DW_TAG_member {
-                   {DW_AT_name nums}
-                   {DW_AT_type :$array}
-                   {DW_AT_data_bit_offset {DW_OP_lit8} SPECIAL_expr}
+                   DW_AT_name nums
+                   DW_AT_type :$array
+                   DW_AT_data_bit_offset {DW_OP_lit8} SPECIAL_expr
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name "value"}
-               {DW_AT_type :$struct}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "our_data"]}
-                   SPECIAL_expr}
+               DW_AT_name "value"
+               DW_AT_type :$struct
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "our_data"]
+               }] SPECIAL_expr
            }
        }
     }
index 1e06212db6ff8e33576f27ad0303e8923286ec2b..331cfc2c7e40fb49f553fb4a6aa8f1647fd13325 100644 (file)
@@ -34,83 +34,83 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Ada95}
-                {DW_AT_name     foo.adb}
-                {DW_AT_comp_dir /tmp}
-        } {
-            declare_labels integer_label array_label array_ptr_label \
-                array_typedef_label
-            set ptr_size [get_sizeof "void *" 96]
+       DW_TAG_compile_unit {
+           DW_AT_language @DW_LANG_Ada95
+           DW_AT_name     foo.adb
+           DW_AT_comp_dir /tmp
+       } {
+           declare_labels integer_label array_label array_ptr_label \
+               array_typedef_label
+           set ptr_size [get_sizeof "void *" 96]
            set int_size [get_sizeof "int" 4]
 
-            integer_label: DW_TAG_base_type {
-                {DW_AT_byte_size $int_size DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      integer}
-            }
+           integer_label: DW_TAG_base_type {
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
+           }
 
            array_label: DW_TAG_array_type {
-               {DW_AT_name foo__array_type}
-               {DW_AT_type :$integer_label}
-                {external 1 flag}
+               DW_AT_name foo__array_type
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$integer_label}
-                    {DW_AT_lower_bound {
-                        DW_OP_push_object_address
-                        DW_OP_const1u [expr {2 * $int_size}]
-                        DW_OP_minus
-                        DW_OP_deref_size $int_size
-                    } SPECIAL_expr}
-                    {DW_AT_upper_bound {
-                        DW_OP_push_object_address
+                   DW_AT_type        :$integer_label
+                   DW_AT_lower_bound [subst {
+                       DW_OP_push_object_address
+                       DW_OP_const1u [expr {2 * $int_size}]
+                       DW_OP_minus
+                       DW_OP_deref_size $int_size
+                   }] SPECIAL_expr
+                   DW_AT_upper_bound [subst {
+                       DW_OP_push_object_address
                        DW_OP_const1u $int_size
-                        DW_OP_minus
-                        DW_OP_deref_size $int_size
-                    } SPECIAL_expr}
+                       DW_OP_minus
+                       DW_OP_deref_size $int_size
+                   }] SPECIAL_expr
                }
            }
-            array_ptr_label: DW_TAG_pointer_type {
-                {DW_AT_byte_size $ptr_size DW_FORM_data1}
-                {DW_AT_type :$array_label}
-            }
-            array_typedef_label: DW_TAG_typedef {
-                {DW_AT_name "foo__array_ptr"}
-                {DW_AT_type :$array_ptr_label}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__three_ptr}
-                {DW_AT_type :$array_ptr_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_1_ptr]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__three_ptr_tdef}
-                {DW_AT_type :$array_typedef_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_1_ptr]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__five_ptr}
-                {DW_AT_type :$array_ptr_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_2_ptr]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
-            DW_TAG_variable {
-                {DW_AT_name foo__five_ptr_tdef}
-                {DW_AT_type :$array_typedef_label}
-                {DW_AT_location {
-                    DW_OP_addr [gdb_target_symbol table_2_ptr]
-                } SPECIAL_expr}
-                {external 1 flag}
-            }
+           array_ptr_label: DW_TAG_pointer_type {
+               DW_AT_byte_size $ptr_size DW_FORM_data1
+               DW_AT_type :$array_label
+           }
+           array_typedef_label: DW_TAG_typedef {
+               DW_AT_name "foo__array_ptr"
+               DW_AT_type :$array_ptr_label
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__three_ptr
+               DW_AT_type :$array_ptr_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_1_ptr]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__three_ptr_tdef
+               DW_AT_type :$array_typedef_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_1_ptr]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__five_ptr
+               DW_AT_type :$array_ptr_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_2_ptr]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
+           DW_TAG_variable {
+               DW_AT_name foo__five_ptr_tdef
+               DW_AT_type :$array_typedef_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol table_2_ptr]
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
+           }
        }
     }
 }
index 621b2e715b1eb7a028bc9bdd425b12845edcdc58..96287dd09868d6b766392814a6ff4d3f4c9691fe 100644 (file)
@@ -37,28 +37,28 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name "cu1"}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name "cu1"
        } {
            DW_TAG_variable {
-               {name foo}
-               {type %$int_label}
-               {const_value 1 DW_FORM_sdata}
+               DW_AT_name foo
+               DW_AT_type %$int_label
+               DW_AT_const_value 1 DW_FORM_sdata
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name "cu2"}
-           {ranges ${ranges_label} sec_offset}
-           {low_pc {[lindex $main_func 0]}}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name "cu2"
+           DW_AT_ranges ${ranges_label} sec_offset
+           DW_AT_low_pc [lindex $main_func 0]
        } {
            int_label: base_type {
-               {byte_size 4 udata}
-               {encoding @DW_ATE_signed}
-               {name int}
+               DW_AT_byte_size 4 udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
        }
     }
index 121a35000626b147722712ef8f823bbaea07a16e..f077c0acb2aaf0a8d899c0d883b1c794694dbe09 100644 (file)
@@ -26,41 +26,41 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_C}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+               DW_AT_language @DW_LANG_C
+               DW_AT_name     $srcfile
+               DW_AT_comp_dir /tmp
+       } {
            declare_labels integer_label uinteger_label
 
-            integer_label: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      int}
-            }
+           integer_label: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
+           }
 
-            uinteger_label: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_unsigned}
-               {DW_AT_name      {unsigned int}}
-            }
+           uinteger_label: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_unsigned
+               DW_AT_name      {unsigned int}
+           }
 
            DW_TAG_enumeration_type {
-               {DW_AT_name E}
-               {DW_AT_type :$integer_label}
+               DW_AT_name E
+               DW_AT_type :$integer_label
            } {
                DW_TAG_enumerator {
-                   {DW_AT_name ONE}
-                   {DW_AT_const_value 1 DW_FORM_sdata}
+                   DW_AT_name ONE
+                   DW_AT_const_value 1 DW_FORM_sdata
                }
            }
 
            DW_TAG_enumeration_type {
-               {DW_AT_name EU}
-               {DW_AT_type :$uinteger_label}
+               DW_AT_name EU
+               DW_AT_type :$uinteger_label
            } {
                DW_TAG_enumerator {
-                   {DW_AT_name TWO}
-                   {DW_AT_const_value 2 DW_FORM_sdata}
+                   DW_AT_name TWO
+                   DW_AT_const_value 2 DW_FORM_sdata
                }
            }
        }
@@ -68,34 +68,34 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_language @DW_LANG_C_plus_plus}
-               {DW_AT_name     tmp.c}
-               {DW_AT_comp_dir /tmp}
+               DW_AT_language @DW_LANG_C_plus_plus
+               DW_AT_name      tmp.c
+               DW_AT_comp_dir /tmp
        } {
            declare_labels integer_label forward
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_signed
+               DW_AT_name       int
            }
 
            DW_TAG_enumeration_type {
-               {DW_AT_specification :$forward}
+               DW_AT_specification :$forward
            } {
                DW_TAG_enumerator {
-                   {DW_AT_name val1}
-                   {DW_AT_const_value 1 DW_FORM_sdata}
+                   DW_AT_name val1
+                   DW_AT_const_value 1 DW_FORM_sdata
                }
            }
 
            DW_TAG_namespace {
-               {DW_AT_name ns}
+               DW_AT_name ns
            } {
                forward: DW_TAG_enumeration_type {
-                   {DW_AT_name e}
-                   {DW_AT_type :$integer_label}
-                   {DW_AT_declaration 1 flag}
+                   DW_AT_name e
+                   DW_AT_type :$integer_label
+                   DW_AT_declaration 1 flag
                }
            }
        }
index 4f354cda11b81ab281b108c9badae93292fae95e..640d4d2283be6eb3cab0e196937b85eb70bc4562 100644 (file)
@@ -40,53 +40,53 @@ Dwarf::assemble $asm_file {
        set debug_addr_lbl [debug_addr_label]
 
        compile_unit {
-            {language @DW_LANG_C}
-            {name ${srcfile}}
-           {DW_AT_comp_dir ${objdir}}
-           {DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8}
-        } {
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile}
+           DW_AT_comp_dir ${objdir}
+           DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8
+       } {
            declare_labels int4_type struct_type
 
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            struct_type: DW_TAG_structure_type {
-               {DW_AT_name "foo_t"}
-               {DW_AT_byte_size 12 DW_FORM_sdata}
+               DW_AT_name "foo_t"
+               DW_AT_byte_size 12 DW_FORM_sdata
            } {
                member {
-                   {name "aa"}
-                   {type :$int4_type}
-                   {data_member_location 0 data1}
+                   DW_AT_name "aa"
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 0 data1
                }
                member {
-                   {name "bb"}
-                   {type :$int4_type}
-                   {data_member_location 4 data1}
+                   DW_AT_name "bb"
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 4 data1
                }
                member {
-                   {name "cc"}
-                   {type :$int4_type}
-                   {data_member_location 8 data1}
+                   DW_AT_name "cc"
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 8 data1
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name global_var}
-               {DW_AT_type :$struct_type}
-               {DW_AT_location {
+               DW_AT_name global_var
+               DW_AT_type :$struct_type
+               DW_AT_location [subst {
                    DW_OP_GNU_addr_index [gdb_target_symbol global_var]
-               } SPECIAL_expr}
-               {external 1 flag}
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
            }
 
            subprogram {
-               {external 1 flag}
-               {DW_AT_name main DW_FORM_string}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               DW_AT_name main DW_FORM_string
+               MACRO_AT_func {main}
            }
        }
     }
@@ -94,11 +94,11 @@ Dwarf::assemble $asm_file {
     # The information that will remain in the .o file.
     cu {} {
        compile_unit {
-            {DW_AT_GNU_dwo_name ${binfile}.dwo DW_FORM_strp}
-           {DW_AT_comp_dir ${objdir}}
-           {DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8}
-           {DW_AT_GNU_addr_base $debug_addr_lbl}
-        } {
+           DW_AT_GNU_dwo_name ${binfile}.dwo DW_FORM_strp
+           DW_AT_comp_dir ${objdir}
+           DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8
+           DW_AT_GNU_addr_base $debug_addr_lbl
+       } {
            # Nothing.
        }
     }
index 7072b7e7e3a063ae26a2df4351838b6d00de8e77..5f778e6ccbd32da7692daf34a455a47a8ee8ea4d 100644 (file)
@@ -32,7 +32,7 @@ Dwarf::assemble $main_asm_file {
        dwo_id 0xF00D
     } {
        compile_unit {
-           {DW_AT_dwo_name ${::gdb_test_file_name}.dwo DW_FORM_strp}
+           DW_AT_dwo_name ${::gdb_test_file_name}.dwo DW_FORM_strp
        } {}
     }
 }
@@ -50,18 +50,18 @@ Dwarf::assemble $dwo_asm_file {
            declare_labels int4_type
 
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      0 DW_FORM_strx_id}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      0 DW_FORM_strx_id
            }
 
            DW_TAG_variable {
-               {DW_AT_name global_var}
-               {DW_AT_type :$int4_type}
-               {DW_AT_location {
+               DW_AT_name global_var
+               DW_AT_type :$int4_type
+               DW_AT_location {
                    DW_OP_const1u 12
                    DW_OP_stack_value
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
        }
     }
index 78f279839a7d3bf1b65cf793014e0506245d860e..ff498c91b11dc56db08ce73fbab43a1e87373a2e 100644 (file)
@@ -51,29 +51,29 @@ Dwarf::assemble $asm_file_1 {
        set debug_addr_lbl [debug_addr_label]
 
        compile_unit {
-            {language @DW_LANG_C}
-            {name ${srcfile}}
-           {DW_AT_comp_dir ${objdir}}
-           {DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8}
-        } {
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile}
+           DW_AT_comp_dir ${objdir}
+           DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8
+       } {
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
            }
 
            subprogram {
-               {external 1 flag}
-               {DW_AT_name func DW_FORM_string}
-               {MACRO_AT_func {func}}
-               {DW_AT_type :$int4_type}
+               DW_AT_external 1 flag
+               DW_AT_name func DW_FORM_string
+               MACRO_AT_func {func}
+               DW_AT_type :$int4_type
            } {
                DW_TAG_formal_parameter {
-                   {DW_AT_name arg}
-                   {DW_AT_type :$int4_type}
-                   {DW_AT_location {
+                   DW_AT_name arg
+                   DW_AT_type :$int4_type
+                   DW_AT_location [subst {
                        DW_OP_GNU_addr_index [gdb_target_symbol global_param]
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
            }
        }
@@ -100,12 +100,12 @@ Dwarf::assemble $asm_file_1 {
     # The information that will remain in the .o file.
     cu {} {
        compile_unit {
-            {DW_AT_GNU_dwo_name ${binfile}-1-dw.dwo DW_FORM_strp}
-           {DW_AT_comp_dir ${objdir}}
-           {DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8}
-           {DW_AT_GNU_addr_base $debug_addr_lbl}
-           {stmt_list $lines_table DW_FORM_sec_offset}
-        } {
+           DW_AT_GNU_dwo_name ${binfile}-1-dw.dwo DW_FORM_strp
+           DW_AT_comp_dir ${objdir}
+           DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8
+           DW_AT_GNU_addr_base $debug_addr_lbl
+           DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+       } {
            # Nothing.
        }
     }
@@ -131,24 +131,24 @@ Dwarf::assemble $asm_file_2 {
        set debug_addr_lbl [debug_addr_label]
 
        compile_unit {
-            {language @DW_LANG_C}
-            {name ${srcfile}}
-           {DW_AT_comp_dir ${objdir}}
-           {DW_AT_GNU_dwo_id 0x4567 DW_FORM_data8}
-        } {
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile}
+           DW_AT_comp_dir ${objdir}
+           DW_AT_GNU_dwo_id 0x4567 DW_FORM_data8
+       } {
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
            }
 
            subprogram {
-               {external 1 flag}
-               {DW_AT_name main DW_FORM_string}
-               {MACRO_AT_func {main}}
-               {DW_AT_type :$int4_type}
-               {DW_AT_decl_file 1 data1}
-               {DW_AT_decl_line 29 data1}
+               DW_AT_external 1 flag
+               DW_AT_name main DW_FORM_string
+               MACRO_AT_func {main}
+               DW_AT_type :$int4_type
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line 29 data1
            }
        }
     }
@@ -182,12 +182,12 @@ Dwarf::assemble $asm_file_2 {
     # The information that will remain in the .o file.
     cu {} {
        compile_unit {
-            {DW_AT_GNU_dwo_name ${binfile}-2-dw.dwo DW_FORM_strp}
-           {DW_AT_comp_dir ${objdir}}
-           {DW_AT_GNU_dwo_id 0x4567 DW_FORM_data8}
-           {DW_AT_GNU_addr_base $debug_addr_lbl}
-           {stmt_list $lines_table DW_FORM_sec_offset}
-        } {
+           DW_AT_GNU_dwo_name ${binfile}-2-dw.dwo DW_FORM_strp
+           DW_AT_comp_dir ${objdir}
+           DW_AT_GNU_dwo_id 0x4567 DW_FORM_data8
+           DW_AT_GNU_addr_base $debug_addr_lbl
+           DW_AT_stmt_list $lines_table DW_FORM_sec_offset
+       } {
            # Nothing.
        }
     }
index 5590156198e115240cd87a2c17cc62d93cade525..e605aef8b712c7fbd6c25f25a40930567e5c6324 100644 (file)
@@ -37,53 +37,53 @@ Dwarf::assemble $asm_file {
        set debug_addr_base [debug_addr_label]
 
        compile_unit {
-            {language @DW_LANG_C}
-            {name ${srcfile}}
-           {DW_AT_comp_dir .}
-           {DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8}
-        } {
+           DW_AT_language @DW_LANG_C
+           DW_AT_name ${srcfile}
+           DW_AT_comp_dir .
+           DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8
+       } {
            declare_labels int4_type struct_type
 
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            struct_type: DW_TAG_structure_type {
-               {DW_AT_name "foo_t"}
-               {DW_AT_byte_size 12 DW_FORM_sdata}
+               DW_AT_name "foo_t"
+               DW_AT_byte_size 12 DW_FORM_sdata
            } {
                member {
-                   {name "aa"}
-                   {type :$int4_type}
-                   {data_member_location 0 data1}
+                   DW_AT_name "aa"
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 0 data1
                }
                member {
-                   {name "bb"}
-                   {type :$int4_type}
-                   {data_member_location 4 data1}
+                   DW_AT_name "bb"
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 4 data1
                }
                member {
-                   {name "cc"}
-                   {type :$int4_type}
-                   {data_member_location 8 data1}
+                   DW_AT_name "cc"
+                   DW_AT_type :$int4_type
+                   DW_AT_data_member_location 8 data1
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name global_var}
-               {DW_AT_type :$struct_type}
-               {DW_AT_location {
+               DW_AT_name global_var
+               DW_AT_type :$struct_type
+               DW_AT_location [subst {
                    DW_OP_GNU_addr_index [gdb_target_symbol global_var]
-               } SPECIAL_expr}
-               {external 1 flag}
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
            }
 
            subprogram {
-               {external 1 flag}
-               {DW_AT_name main DW_FORM_string}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               DW_AT_name main DW_FORM_string
+               MACRO_AT_func {main}
            }
        }
     }
@@ -91,11 +91,11 @@ Dwarf::assemble $asm_file {
     # The information that will remain in the .o file.
     cu {} {
        compile_unit {
-            {DW_AT_GNU_dwo_name ${gdb_test_file_name}.dwo DW_FORM_strp}
-           {DW_AT_comp_dir .}
-           {DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8}
-           {DW_AT_GNU_addr_base $debug_addr_base}
-        } {
+           DW_AT_GNU_dwo_name ${gdb_test_file_name}.dwo DW_FORM_strp
+           DW_AT_comp_dir .
+           DW_AT_GNU_dwo_id 0x1234 DW_FORM_data8
+           DW_AT_GNU_addr_base $debug_addr_base
+       } {
            # Nothing.
        }
     }
index 0a02f7c4b9e4cc272d981e7246c9d24bd2c73d84..58cda296c67b8ee5ad50b5d603fce0d54987ea22 100644 (file)
@@ -33,7 +33,7 @@ Dwarf::assemble $main_asm_file {
        dwo_id 0xF00D
     } {
        compile_unit {
-           {DW_AT_dwo_name ${::gdb_test_file_name}.dwo DW_FORM_strp}
+           DW_AT_dwo_name ${::gdb_test_file_name}.dwo DW_FORM_strp
        } {}
     }
 }
@@ -46,9 +46,9 @@ Dwarf::assemble $dwo_asm_file {
     } 0xCAFE "the_type" {
        type_unit {} {
            the_type: base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
            }
        }
     }
@@ -62,18 +62,18 @@ Dwarf::assemble $dwo_asm_file {
            declare_labels int4_type
 
            int4_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
            }
 
            DW_TAG_variable {
-               {DW_AT_name global_var}
-               {DW_AT_type :$int4_type}
-               {DW_AT_location {
+               DW_AT_name global_var
+               DW_AT_type :$int4_type
+               DW_AT_location {
                    DW_OP_const1u 12
                    DW_OP_stack_value
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
        }
     }
index 70c7cc4b17c22de931ac58a2580e15796dc8e2a5..c08183ec385df6e54c173d99b1da931b2646a6c9 100644 (file)
@@ -50,33 +50,33 @@ Dwarf::assemble $asm_file {
            declare_labels int_label sint_label
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size 16 DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_name "__uint128"}
+               DW_AT_byte_size 16 DW_FORM_udata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "__uint128"
            }
 
            sint_label: DW_TAG_base_type {
-               {DW_AT_byte_size 16 DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "__int128"}
+               DW_AT_byte_size 16 DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "__int128"
            }
 
            DW_TAG_variable {
-               {name xxx}
-               {type :$int_label}
-               {const_value $pair DW_FORM_data16}
+               DW_AT_name xxx
+               DW_AT_type :$int_label
+               DW_AT_const_value $pair DW_FORM_data16
            }
 
            DW_TAG_variable {
-               {name yyy}
-               {type :$int_label}
-               {const_value $pair2 DW_FORM_data16}
+               DW_AT_name yyy
+               DW_AT_type :$int_label
+               DW_AT_const_value $pair2 DW_FORM_data16
            }
 
            DW_TAG_variable {
-               {name sss}
-               {type :$sint_label}
-               {const_value $negative DW_FORM_data16}
+               DW_AT_name sss
+               DW_AT_type :$sint_label
+               DW_AT_const_value $negative DW_FORM_data16
            }
        }
     }
index e4a12701a25517bbd2abb105e94ddfca0b701e2e..b751900bf7bf9949493afbe19970ebb52382867f 100644 (file)
@@ -40,92 +40,92 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-                {DW_AT_language @DW_LANG_Fortran90}
-                {DW_AT_name     fortran-var-string.f90}
-                {DW_AT_comp_dir /tmp}
-        } {
+               DW_AT_language @DW_LANG_Fortran90
+               DW_AT_name     fortran-var-string.f90
+               DW_AT_comp_dir /tmp
+       } {
            declare_labels integer_label string_label array_lb_label \
                array_ub_label
 
            DW_TAG_subprogram {
-               {name main}
-               {low_pc $main_helper_start addr}
-               {high_pc $main_helper_len data8}
-               {DW_AT_type :$integer_label}
-               {DW_AT_decl_file 1 data1}
-               {DW_AT_decl_line 1 data1}
+               DW_AT_name main
+               DW_AT_low_pc $main_helper_start addr
+               DW_AT_high_pc $main_helper_len data8
+               DW_AT_type :$integer_label
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line 1 data1
            }
 
            DW_TAG_subprogram {
-               {name test_1_func}
-               {low_pc $main_start addr}
-               {high_pc $main_len data8}
-               {DW_AT_type :$integer_label}
-               {DW_AT_decl_file 1 data1}
-               {DW_AT_decl_line 2 data1}
+               DW_AT_name test_1_func
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_len data8
+               DW_AT_type :$integer_label
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line 2 data1
            } {
                formal_parameter {
-                   {name arg1}
-                   {type :$string_label}
+                   DW_AT_name arg1
+                   DW_AT_type :$string_label
                }
            }
 
            DW_TAG_subprogram {
-               {name test_2_func}
-               {low_pc $main_start addr}
-               {high_pc $main_len data8}
-               {DW_AT_type :$integer_label}
-               {DW_AT_decl_file 1 data1}
-               {DW_AT_decl_line 3 data1}
+               DW_AT_name test_2_func
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_len data8
+               DW_AT_type :$integer_label
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line 3 data1
            } {
                formal_parameter {
-                   {name arg1}
-                   {type :$array_ub_label}
+                   DW_AT_name arg1
+                   DW_AT_type :$array_ub_label
                }
            }
 
            DW_TAG_subprogram {
-               {name test_3_func}
-               {low_pc $main_start addr}
-               {high_pc $main_len data8}
-               {DW_AT_type :$integer_label}
-               {DW_AT_decl_file 1 data1}
-               {DW_AT_decl_line 4 data1}
+               DW_AT_name test_3_func
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_len data8
+               DW_AT_type :$integer_label
+               DW_AT_decl_file 1 data1
+               DW_AT_decl_line 4 data1
            } {
                formal_parameter {
-                   {name arg1}
-                   {type :$array_lb_label}
+                   DW_AT_name arg1
+                   DW_AT_type :$array_lb_label
                }
            }
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            string_label: DW_TAG_string_type {
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
-               {DW_AT_name      .str.arg}
-               {DW_AT_string_length {} DW_FORM_block1}
+               DW_AT_byte_size $int_size DW_FORM_sdata
+               DW_AT_name      .str.arg
+               DW_AT_string_length {} DW_FORM_block1
            }
 
            array_lb_label: DW_TAG_array_type {
-               {DW_AT_ordering 1 data1}
-               {DW_AT_type :$integer_label}
+               DW_AT_ordering 1 data1
+               DW_AT_type :$integer_label
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_lower_bound {} DW_FORM_block1}
-                   {DW_AT_upper_bound 10 DW_FORM_data1}
+                   DW_AT_lower_bound {} DW_FORM_block1
+                   DW_AT_upper_bound 10 DW_FORM_data1
                }
            }
 
            array_ub_label: DW_TAG_array_type {
-               {DW_AT_ordering 1 data1}
-               {DW_AT_type :$integer_label}
+               DW_AT_ordering 1 data1
+               DW_AT_type :$integer_label
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_upper_bound {} DW_FORM_block1}
+                   DW_AT_upper_bound {} DW_FORM_block1
                }
            }
        }
index 26d0af6706b08b86adee1ac0e4a762ed98f5d6de..7d55f7336d2c1a3391f1ddb77e0d8dc51f12d3aa 100644 (file)
@@ -33,40 +33,40 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            # The new indexer has special code to compute the full
            # name of an object that uses a specification that appears
            # later in the DWARF.
            DW_TAG_variable {
-               {DW_AT_specification %$spec}
-               {DW_AT_location {
+               DW_AT_specification %$spec
+               DW_AT_location {
                    DW_OP_const1u 23
                    DW_OP_stack_value
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
        }
     }
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels myint
 
            myint: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      myint}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      myint
            }
 
            DW_TAG_namespace {
-               {DW_AT_name ns}
+               DW_AT_name ns
            } {
                spec: DW_TAG_variable {
-                   {DW_AT_name v}
-                   {DW_AT_type :$myint}
-                   {DW_AT_declaration 1 DW_FORM_flag_present}
+                   DW_AT_name v
+                   DW_AT_type :$myint
+                   DW_AT_declaration 1 DW_FORM_flag_present
                }
            }
        }
index 6c38be8e05e4e04f8c5fce4240d6c111dc7583d7..e534da294197221860e604d1677834bd6fc474f1 100644 (file)
@@ -32,9 +32,9 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
 
        } {
            declare_labels spec myint
@@ -43,26 +43,26 @@ Dwarf::assemble $asm_file {
            # name of an object that uses a specification that appears
            # later in the DWARF.
            DW_TAG_variable {
-               {DW_AT_specification :$spec}
-               {DW_AT_location {
+               DW_AT_specification :$spec
+               DW_AT_location {
                    DW_OP_const1u 23
                    DW_OP_stack_value
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
 
            myint: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      myint}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      myint
            }
 
            DW_TAG_namespace {
-               {DW_AT_name ns}
+               DW_AT_name ns
            } {
                spec: DW_TAG_variable {
-                   {DW_AT_name v}
-                   {DW_AT_type :$myint}
-                   {DW_AT_declaration 1 DW_FORM_flag_present}
+                   DW_AT_name v
+                   DW_AT_type :$myint
+                   DW_AT_declaration 1 DW_FORM_flag_present
                }
            }
        }
index 6857a08af5cd16e7e3920a9d401f598736d56ac9..ad19ce7b4de09369e7a2e884945fab8d51ced4bb 100644 (file)
@@ -46,44 +46,44 @@ Dwarf::assemble $dwarf_asm {
 
     cu { label cu_label addr_size 4 } {
        DW_TAG_compile_unit {
-           {DW_AT_name $srcfile}
-           {DW_AT_stmt_list $stmt_list DW_FORM_sec_offset}
-           {DW_AT_language @DW_LANG_C99}
-           {DW_AT_low_pc __cu_low_pc DW_FORM_addr}
-           {DW_AT_high_pc __cu_high_pc DW_FORM_addr}
+           DW_AT_name $srcfile
+           DW_AT_stmt_list $stmt_list DW_FORM_sec_offset
+           DW_AT_language @DW_LANG_C99
+           DW_AT_low_pc __cu_low_pc DW_FORM_addr
+           DW_AT_high_pc __cu_high_pc DW_FORM_addr
        } {
            DW_TAG_subprogram {
-               {DW_AT_name "_start"}
-               {DW_AT_low_pc __start_low_pc DW_FORM_addr}
-               {DW_AT_high_pc __start_high_pc DW_FORM_addr}
+               DW_AT_name "_start"
+               DW_AT_low_pc __start_low_pc DW_FORM_addr
+               DW_AT_high_pc __start_high_pc DW_FORM_addr
            } {
                DW_TAG_inlined_subroutine {
-                   {DW_AT_abstract_origin :$foo_subprogram}
-                   {DW_AT_low_pc __foo_low_pc DW_FORM_addr}
-                   {DW_AT_high_pc __foo_high_pc DW_FORM_addr}
-                   {DW_AT_call_file 1 DW_FORM_data1}
-                   {DW_AT_call_line 13 DW_FORM_data1}
+                   DW_AT_abstract_origin :$foo_subprogram
+                   DW_AT_low_pc __foo_low_pc DW_FORM_addr
+                   DW_AT_high_pc __foo_high_pc DW_FORM_addr
+                   DW_AT_call_file 1 DW_FORM_data1
+                   DW_AT_call_line 13 DW_FORM_data1
                } {
                    DW_TAG_inlined_subroutine {
-                       {DW_AT_abstract_origin :$bar_subprogram}
-                       {DW_AT_low_pc __bar_low_pc DW_FORM_addr}
-                       {DW_AT_high_pc __bar_high_pc DW_FORM_addr}
-                       {DW_AT_call_file 1 DW_FORM_data1}
-                       {DW_AT_call_line 7 DW_FORM_data1}
+                       DW_AT_abstract_origin :$bar_subprogram
+                       DW_AT_low_pc __bar_low_pc DW_FORM_addr
+                       DW_AT_high_pc __bar_high_pc DW_FORM_addr
+                       DW_AT_call_file 1 DW_FORM_data1
+                       DW_AT_call_line 7 DW_FORM_data1
                    }
                }
            }
 
            foo_subprogram: DW_TAG_subprogram {
-               {DW_AT_name "foo"}
-               {DW_AT_prototyped 1 DW_FORM_flag_present}
-               {DW_AT_inline 0x1 DW_FORM_data1}
+               DW_AT_name "foo"
+               DW_AT_prototyped 1 DW_FORM_flag_present
+               DW_AT_inline 0x1 DW_FORM_data1
            }
 
            bar_subprogram: DW_TAG_subprogram {
-               {DW_AT_name "bar"}
-               {DW_AT_prototyped 1 DW_FORM_flag_present}
-               {DW_AT_inline 0x1 DW_FORM_data1}
+               DW_AT_name "bar"
+               DW_AT_prototyped 1 DW_FORM_flag_present
+               DW_AT_inline 0x1 DW_FORM_data1
            }
        }
     }
index c4496f183d439f5ceccc0fee3a4d29646425746c..be3a648c9366b175b89cd81886ab3b400378564f 100644 (file)
@@ -39,54 +39,54 @@ proc test_1 { name dwarf_version offset_size addr_size ref_addr_size two_cu } {
            is_64 $is_64
        } {
            compile_unit {
-               { producer "GNU C 4.4.3" }
-               { language @DW_LANG_C89 }
-               { name 1.c }
+                DW_AT_producer "GNU C 4.4.3"
+                DW_AT_language @DW_LANG_C89
+                DW_AT_name 1.c
            } {
                declare_labels struct_label variable_label int_label pointer_label
 
                int_label: base_type {
-                   { byte_size 4 DW_FORM_sdata }
-                   { DW_AT_encoding @DW_ATE_signed }
-                   { name int }
+                    DW_AT_byte_size 4 DW_FORM_sdata
+                    DW_AT_encoding @DW_ATE_signed
+                    DW_AT_name int
                }
 
                struct_label: structure_type {
-                   { name s }
-                   { byte_size 4 sdata }
+                    DW_AT_name s
+                    DW_AT_byte_size 4 sdata
                } {
                    member {
-                       { name f }
-                       { type :$int_label }
-                       { data_member_location 0 data1 }
+                        DW_AT_name f
+                        DW_AT_type :$int_label
+                        DW_AT_data_member_location 0 data1
                    }
                }
 
                pointer_label: pointer_type {
-                   { byte_size $Dwarf::_cu_addr_size sdata }
-                   { type  :$struct_label }
+                    DW_AT_byte_size $Dwarf::_cu_addr_size sdata
+                    DW_AT_type  :$struct_label
                }
 
                variable_label: DW_TAG_variable {
-                   { name v }
-                   location {
+                    DW_AT_name v
+                    DW_AT_location {
                        DW_OP_implicit_value 0x1 0x1 0x1 0x1
-                   } SPECIAL_expr}
-                   { type :$struct_label "DW_FORM_ref$ref_addr_size" }
+                   } SPECIAL_expr
+                    DW_AT_type :$struct_label "DW_FORM_ref$ref_addr_size"
                }
 
                if { !$two_cu } {
                    subprogram {
-                       {MACRO_AT_func {main}}
-                       { type :$int_label }
-                       { external 1 flag }
+                       MACRO_AT_func {main}
+                        DW_AT_type :$int_label
+                        DW_AT_external 1 flag
                    } {
                        DW_TAG_variable {
-                           { name p }
-                           { location {
+                            DW_AT_name p
+                           DW_AT_location [subst {
                                GNU_implicit_pointer $variable_label 0
-                           } SPECIAL_expr }
-                           { type :$pointer_label "DW_FORM_ref$ref_addr_size" }
+                           }] SPECIAL_expr
+                            DW_AT_type :$pointer_label "DW_FORM_ref$ref_addr_size"
                        }
                    }
                }
@@ -100,21 +100,21 @@ proc test_1 { name dwarf_version offset_size addr_size ref_addr_size two_cu } {
                is_64 $is_64
            } {
                compile_unit {
-                   { producer "GNU C 4.4.3" }
-                   { language @DW_LANG_C89 }
-                   { name 1.c }
+                    DW_AT_producer "GNU C 4.4.3"
+                    DW_AT_language @DW_LANG_C89
+                    DW_AT_name 1.c
                } {
                    subprogram {
-                       { MACRO_AT_func {main} }
-                       { type %$int_label }
-                       { external 1 flag }
+                        MACRO_AT_func {main}
+                        DW_AT_type %$int_label
+                        DW_AT_external 1 flag
                    } {
                        DW_TAG_variable {
-                           { name p }
-                           { location {
+                            DW_AT_name p
+                           DW_AT_location [subst {
                                GNU_implicit_pointer $variable_label 0
-                           } SPECIAL_expr }
-                           { type %$pointer_label }
+                           }] SPECIAL_expr
+                            DW_AT_type %$pointer_label
                        }
                    }
                }
index 79fcf61ca15ebcf91102e05d4ed87c202f280ce8..7feb983908469e343aa1fb3bcdd513f204e2ce58 100644 (file)
@@ -25,51 +25,51 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu { version 3 addr_size 4 } {
        compile_unit {
-           {producer "GNU C 4.4.3"}
-           {language @DW_LANG_C89}
-           {name 1.c}
+           DW_AT_producer "GNU C 4.4.3"
+           DW_AT_language @DW_LANG_C89
+           DW_AT_name 1.c
        } {
            declare_labels int_label struct_label pointer_label variable_label
 
            int_label: base_type {
-               {byte_size 4 sdata}
-               {encoding @DW_ATE_signed}
-               {name int}
+               DW_AT_byte_size 4 sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
 
            struct_label: structure_type {
-               {name s}
-               {byte_size 4 sdata}
+               DW_AT_name s
+               DW_AT_byte_size 4 sdata
            } {
                member {
-                   {name f}
-                   {type :$int_label}
-                   {data_member_location 0 data1}
+                   DW_AT_name f
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location 0 data1
                }
            }
 
            subprogram {
-               {MACRO_AT_func { main }}
-               {type :$int_label}
-               {external 1 flag}
+               MACRO_AT_func { main }
+               DW_AT_type :$int_label
+               DW_AT_external 1 flag
            } {
                pointer_label: pointer_type {
-                   {byte_size 4 sdata}
-                   {type :$struct_label}
+                   DW_AT_byte_size 4 sdata
+                   DW_AT_type :$struct_label
                }
 
                variable_label: DW_TAG_variable {
-                   {name v}
-                   {location {} DW_FORM_block1}
-                   {type :$struct_label}
+                   DW_AT_name v
+                   DW_AT_location {} DW_FORM_block1
+                   DW_AT_type :$struct_label
                }
 
                DW_TAG_variable {
-                   {name p}
-                   {location {
+                   DW_AT_name p
+                   DW_AT_location [subst {
                        GNU_implicit_pointer $variable_label 0
-                   } SPECIAL_expr}
-                   {type :$pointer_label}
+                   }] SPECIAL_expr
+                   DW_AT_type :$pointer_label
                }
            }
        }
index f3d47a27bd051e10f0e885fd8883c2882a526770..8e735ca278459439e9c28fc29824c0c2d157ae7f 100644 (file)
@@ -33,51 +33,51 @@ Dwarf::assemble $asm_file {
            declare_labels var_label ptr_label
 
            byte_label: base_type {
-               {name byte}
-               {encoding @DW_ATE_signed}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name byte
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            size_type_label: base_type {
-               {name sizetype}
-               {encoding @DW_ATE_unsigned}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name sizetype
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            array_label: array_type {
-               {type :$byte_label}
+               DW_AT_type :$byte_label
            } {
                subrange_type {
-                   {type :$size_type_label}
-                   {upper_bound 7 DW_FORM_data1}
+                   DW_AT_type :$size_type_label
+                   DW_AT_upper_bound 7 DW_FORM_data1
                }
            }
 
            var_label: DW_TAG_variable {
-               {name b}
-               {type :$array_label}
-               {const_value rstuvwxy DW_FORM_block1}
+               DW_AT_name b
+               DW_AT_type :$array_label
+               DW_AT_const_value rstuvwxy DW_FORM_block1
            }
 
            ptr_label: pointer_type {
-               {byte_size 4 DW_FORM_sdata}
-               {type :$byte_label}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_type :$byte_label
            }
 
            DW_TAG_variable {
-               {name c}
-               {type :$ptr_label}
-               {location {
+               DW_AT_name c
+               DW_AT_type :$ptr_label
+               DW_AT_location [subst {
                    GNU_implicit_pointer $var_label 0
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {name d}
-               {type :$ptr_label}
-               {location {
+               DW_AT_name d
+               DW_AT_type :$ptr_label
+               DW_AT_location [subst {
                    GNU_implicit_pointer $var_label 2
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
        }
     }
index 96544838cef5f8e1541722806357c0fa807e8be9..58c5e6666964f278fb007901573579af3294f8fa 100644 (file)
@@ -36,48 +36,48 @@ Dwarf::assemble $asm_file {
            declare_labels var_label
 
            struct_label: structure_type {
-               {name S}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name S
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                member {
-                   {name a}
-                   {type :$short_type_label}
-                   {data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name a
+                   DW_AT_type :$short_type_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
                member {
-                   {name b}
-                   {type :$char_type_label}
-                   {data_member_location 2 DW_FORM_sdata}
+                   DW_AT_name b
+                   DW_AT_type :$char_type_label
+                   DW_AT_data_member_location 2 DW_FORM_sdata
                }
                member {
-                   {name c}
-                   {type :$char_type_label}
-                   {data_member_location 3 DW_FORM_sdata}
+                   DW_AT_name c
+                   DW_AT_type :$char_type_label
+                   DW_AT_data_member_location 3 DW_FORM_sdata
                }
            }
 
            short_type_label: base_type {
-               {name "short int"}
-               {encoding @DW_ATE_signed}
-               {byte_size 2 DW_FORM_sdata}
+               DW_AT_name "short int"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 2 DW_FORM_sdata
            }
 
            char_type_label: base_type {
-               {name "signed char"}
-               {encoding @DW_ATE_signed}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name "signed char"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            # See comment above to understand the pointer size.
            ptr_label: pointer_type {
-               {byte_size 2 DW_FORM_sdata}
-               {type :$char_type_label}
+               DW_AT_byte_size 2 DW_FORM_sdata
+               DW_AT_type :$char_type_label
            }
 
            var_label: DW_TAG_variable {
-               {name s}
-               {type :$struct_label}
-               {location {
+               DW_AT_name s
+               DW_AT_type :$struct_label
+               DW_AT_location {
                    const2u 0x5678
                    stack_value
                    piece 2
@@ -87,15 +87,15 @@ Dwarf::assemble $asm_file {
                    const1u 3
                    stack_value
                    piece 1
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {name p}
-               {type :$ptr_label}
-               {location {
+               DW_AT_name p
+               DW_AT_type :$ptr_label
+               DW_AT_location [subst {
                    GNU_implicit_pointer $var_label 2
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
        }
     }
index 4f7bb4b0d2257f3e8435bd4141c96a58b2f286b9..1236537c73e4d66a82e01894c45e3034288071ce 100644 (file)
@@ -51,7 +51,7 @@ Dwarf::assemble ${asm_file} {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels int_label sizetype_label array_label variable_label ref_label
            set int_size [get_sizeof "int" -1]
@@ -61,48 +61,52 @@ Dwarf::assemble ${asm_file} {
            set addr_size [get_sizeof "void *" -1]
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size ${int_size} DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "int"}
+               DW_AT_byte_size ${int_size} DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            sizetype_label: DW_TAG_base_type {
-               {DW_AT_byte_size ${int_size} DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_name "sizetype"}
+               DW_AT_byte_size ${int_size} DW_FORM_udata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "sizetype"
            }
 
            array_label: DW_TAG_array_type {
-                   {DW_AT_type :${int_label}}
+                   DW_AT_type :${int_label}
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type :${sizetype_label}}
-                   {DW_AT_lower_bound 0 DW_FORM_udata}
-                   {DW_AT_upper_bound ${upper_bound} DW_FORM_udata}
+                   DW_AT_type :${sizetype_label}
+                   DW_AT_lower_bound 0 DW_FORM_udata
+                   DW_AT_upper_bound ${upper_bound} DW_FORM_udata
                }
            }
 
            ref_label: DW_TAG_reference_type {
-               {DW_AT_byte_size ${addr_size} DW_FORM_udata}
-               {DW_AT_type :${array_label}}
+               DW_AT_byte_size ${addr_size} DW_FORM_udata
+               DW_AT_type :${array_label}
            }
 
            variable_label: DW_TAG_variable {
-               {DW_AT_name "array"}
-               {DW_AT_type :${array_label}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "array"]} SPECIAL_expr}
+               DW_AT_name "array"
+               DW_AT_type :${array_label}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "array"]
+               }] SPECIAL_expr
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func { "main" }}
-               {DW_AT_type :${int_label}}
-               {DW_AT_external 1 DW_FORM_flag}
+               MACRO_AT_func { "main" }
+               DW_AT_type :${int_label}
+               DW_AT_external 1 DW_FORM_flag
            } {
                DW_TAG_variable {
-                   {DW_AT_name "ref"}
-                   {DW_AT_type :${ref_label}}
-                   {DW_AT_location {DW_OP_GNU_implicit_pointer ${variable_label} 0} SPECIAL_expr}
+                   DW_AT_name "ref"
+                   DW_AT_type :${ref_label}
+                   DW_AT_location [subst {
+                       DW_OP_GNU_implicit_pointer ${variable_label} 0
+                   }] SPECIAL_expr
                }
            }
        }
index 57ccfcd72626a853007c7b1c2d205944cd68f70b..ec19eedd4436a902546176f22b0be06f61a18749 100644 (file)
@@ -45,7 +45,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
 Dwarf::assemble ${asm_file} {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels int_label const_label variable_label ref_label
            set int_size [get_sizeof "int" -1]
@@ -55,35 +55,37 @@ Dwarf::assemble ${asm_file} {
            set var_value 42
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size ${int_size} DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "int"}
+               DW_AT_byte_size ${int_size} DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            ref_label: DW_TAG_reference_type {
-               {DW_AT_byte_size ${addr_size} DW_FORM_udata}
-               {DW_AT_type :${int_label}}
+               DW_AT_byte_size ${addr_size} DW_FORM_udata
+               DW_AT_type :${int_label}
            }
 
            const_label: DW_TAG_const_type {
-               {DW_AT_type :${ref_label}}
+               DW_AT_type :${ref_label}
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func { "main" }}
-               {DW_AT_type :${int_label}}
-               {DW_AT_external 1 DW_FORM_flag}
+               MACRO_AT_func { "main" }
+               DW_AT_type :${int_label}
+               DW_AT_external 1 DW_FORM_flag
            } {
                variable_label: DW_TAG_variable {
-                   {DW_AT_name "var"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_const_value ${var_value} DW_FORM_udata}
+                   DW_AT_name "var"
+                   DW_AT_type :${int_label}
+                   DW_AT_const_value ${var_value} DW_FORM_udata
                }
 
                DW_TAG_variable {
-                   {DW_AT_name "ref"}
-                   {DW_AT_type :${const_label}}
-                   {DW_AT_location {DW_OP_GNU_implicit_pointer ${variable_label} 0} SPECIAL_expr}
+                   DW_AT_name "ref"
+                   DW_AT_type :${const_label}
+                   DW_AT_location [subst {
+                       DW_OP_GNU_implicit_pointer ${variable_label} 0
+                   }] SPECIAL_expr
                }
            }
        }
index 5d9e679cc22314e3c20e8200f215d7c0b0fbceee..cb885ef6ad029a46374be7f18079669e7aed9361 100644 (file)
@@ -47,7 +47,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
 Dwarf::assemble ${asm_file} {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels int_label variable_label ref_label
            set int_size [get_sizeof "int" -1]
@@ -56,32 +56,36 @@ Dwarf::assemble ${asm_file} {
            set addr_size [get_sizeof "void *" -1]
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size ${int_size} DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "int"}
+               DW_AT_byte_size ${int_size} DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            ref_label: DW_TAG_reference_type {
-               {DW_AT_byte_size ${addr_size} DW_FORM_udata}
-               {DW_AT_type :${int_label}}
+               DW_AT_byte_size ${addr_size} DW_FORM_udata
+               DW_AT_type :${int_label}
            }
 
            variable_label: DW_TAG_variable {
-               {DW_AT_name "global_var"}
-               {DW_AT_type :${int_label}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "global_var"]} SPECIAL_expr}
+               DW_AT_name "global_var"
+               DW_AT_type :${int_label}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "global_var"]
+               }] SPECIAL_expr
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func { "main" }}
-               {DW_AT_type :${int_label}}
-               {DW_AT_external 1 DW_FORM_flag}
+               MACRO_AT_func { "main" }
+               DW_AT_type :${int_label}
+               DW_AT_external 1 DW_FORM_flag
            } {
                DW_TAG_variable {
-                   {DW_AT_name "ref"}
-                   {DW_AT_type :${ref_label}}
-                   {DW_AT_location {DW_OP_GNU_implicit_pointer ${variable_label} 0} SPECIAL_expr}
+                   DW_AT_name "ref"
+                   DW_AT_type :${ref_label}
+                   DW_AT_location [subst {
+                       DW_OP_GNU_implicit_pointer ${variable_label} 0
+                   }] SPECIAL_expr
                }
            }
        }
index 1add48582d69a07c6d3a6c2019685d0ab87a1ee2..9dc3b1b0964679d7f211fec667df503ec238e3fc 100644 (file)
@@ -47,7 +47,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}]
 Dwarf::assemble ${asm_file} {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels int_label struct_label variable_label ref_label
            set int_size [get_sizeof "int" -1]
@@ -61,62 +61,68 @@ Dwarf::assemble ${asm_file} {
            set c_offset 8
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size ${int_size} DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "int"}
+               DW_AT_byte_size ${int_size} DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            struct_label: DW_TAG_structure_type {
-               {DW_AT_name "S"}
-               {DW_AT_byte_size ${S_size} DW_FORM_udata}
+               DW_AT_name "S"
+               DW_AT_byte_size ${S_size} DW_FORM_udata
            } {
                DW_TAG_member {
-                   {DW_AT_name "a"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_data_member_location 0 DW_FORM_udata}
+                   DW_AT_name "a"
+                   DW_AT_type :${int_label}
+                   DW_AT_data_member_location 0 DW_FORM_udata
                }
 
                DW_TAG_member {
-                   {DW_AT_name "b"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_data_member_location ${b_offset} DW_FORM_udata}
+                   DW_AT_name "b"
+                   DW_AT_type :${int_label}
+                   DW_AT_data_member_location ${b_offset} DW_FORM_udata
                }
 
                DW_TAG_member {
-                   {DW_AT_name "c"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_data_member_location ${c_offset} DW_FORM_udata}
+                   DW_AT_name "c"
+                   DW_AT_type :${int_label}
+                   DW_AT_data_member_location ${c_offset} DW_FORM_udata
                }
            }
 
            ref_label: DW_TAG_reference_type {
-               {DW_AT_byte_size ${addr_size} DW_FORM_udata}
-               {DW_AT_type :${struct_label}}
+               DW_AT_byte_size ${addr_size} DW_FORM_udata
+               DW_AT_type :${struct_label}
            }
 
            variable_label: DW_TAG_variable {
-               {DW_AT_name "s1"}
-               {DW_AT_type :${struct_label}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "s1"]} SPECIAL_expr}
+               DW_AT_name "s1"
+               DW_AT_type :${struct_label}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "s1"]
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name "s2"}
-               {DW_AT_type :${struct_label}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "s2"]} SPECIAL_expr}
+               DW_AT_name "s2"
+               DW_AT_type :${struct_label}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "s2"]
+               }] SPECIAL_expr
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func { "main" }}
-               {DW_AT_type :${int_label}}
-               {DW_AT_external 1 DW_FORM_flag}
+               MACRO_AT_func { "main" }
+               DW_AT_type :${int_label}
+               DW_AT_external 1 DW_FORM_flag
            } {
                DW_TAG_variable {
-                   {DW_AT_name "ref"}
-                   {DW_AT_type :${ref_label}}
-                   {DW_AT_location {DW_OP_GNU_implicit_pointer ${variable_label} 0} SPECIAL_expr}
+                   DW_AT_name "ref"
+                   DW_AT_type :${ref_label}
+                   DW_AT_location [subst {
+                       DW_OP_GNU_implicit_pointer ${variable_label} 0
+                   }] SPECIAL_expr
                }
            }
        }
index 2517a2a984d60ee6e6442735d9fa1fe9915efd0a..7141d6b7bd855ac5e4705e12d6b1f83ff93eeda2 100644 (file)
@@ -40,40 +40,40 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        cu_label: partial_unit {
-           {language @DW_LANG_C}
-           {name "imported_unit.c"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "imported_unit.c"
        } {
            int_label: base_type {
-               {byte_size $int_size sdata}
-               {encoding @DW_ATE_signed}
-               {name int}
+               DW_AT_byte_size $int_size sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
 
            aaa_label: DW_TAG_variable {
-               {name aaa}
-               {type :$int_label}
-               {const_value 1 DW_FORM_sdata}
+               DW_AT_name aaa
+               DW_AT_type :$int_label
+               DW_AT_const_value 1 DW_FORM_sdata
            }
 
            main_label: subprogram {
-               {name main}
-               {type :$int_label}
-               {external 1 flag}
+               DW_AT_name main
+               DW_AT_type :$int_label
+               DW_AT_external 1 flag
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "<artificial>"
        } {
            DW_TAG_variable {
-               {abstract_origin %$aaa_label}
+               DW_AT_abstract_origin %$aaa_label
            }
            subprogram {
-               {abstract_origin %$main_label}
-               {MACRO_AT_range {main}}
+               DW_AT_abstract_origin %$main_label
+               MACRO_AT_range {main}
            }
        }
     }
index 65c346649c13e20f5a51ecde8f8c1380089d1631..de1195a1205c48d256b81c51ff770454c51be906 100644 (file)
@@ -38,34 +38,34 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @$lang}
-           {name "<artificial>"}
+           DW_AT_language @$lang
+           DW_AT_name "<artificial>"
        } {
            imported_unit {
-               {import %$cu_label}
+               DW_AT_import %$cu_label
            }
        }
     }
 
     cu {} {
        cu_label: compile_unit {
-           {producer "gcc"}
-           {language @$lang}
-           {name ${srcfile}}
-           {comp_dir "/tmp"}
-           {low_pc 0 addr}
-           {stmt_list ${lines_label} DW_FORM_sec_offset}
+           DW_AT_producer "gcc"
+           DW_AT_language @$lang
+           DW_AT_name ${srcfile}
+           DW_AT_comp_dir "/tmp"
+           DW_AT_low_pc 0 addr
+           DW_AT_stmt_list ${lines_label} DW_FORM_sec_offset
        } {
            callee_subprog_label: subprogram {
-               {external 1 flag}
-               {name callee}
-               {inline 3 data1}
+               DW_AT_external 1 flag
+               DW_AT_name callee
+               DW_AT_inline 3 data1
            }
            subprogram {
-               {external 1 flag}
-               {name func}
-               {low_pc $func_start addr}
-               {high_pc "$func_start + $func_len" addr}
+               DW_AT_external 1 flag
+               DW_AT_name func
+               DW_AT_low_pc $func_start addr
+               DW_AT_high_pc "$func_start + $func_len" addr
            } {
            }
        }
index 521ccc3a8c070f28bd229cdaeb7b86c3353729f0..4ccda52cc62f07e8619dcc7e11bfe93627eea70c 100644 (file)
@@ -22,52 +22,52 @@ Dwarf::assemble $asm_file {
     # imported CU 1: inty unsigned
     cu {} {
        cu_label: compile_unit {
-           {language @DW_LANG_C}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "<artificial>"
        } {
            int_label: base_type {
-               {byte_size $int_size sdata}
-               {encoding @DW_ATE_unsigned}
-               {name {unsigned int}}
+               DW_AT_byte_size $int_size sdata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name {unsigned int}
+           }
+           DW_TAG_typedef {
+               DW_AT_name inty
+               DW_AT_type :$int_label
            }
-            DW_TAG_typedef {
-                {DW_AT_name inty}
-                {DW_AT_type :$int_label}
-            }
        }
     }
 
     # imported CU 2: inty signed
     cu {} {
        cu2_label: compile_unit {
-           {language @DW_LANG_C}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "<artificial>"
        } {
            int2_label: base_type {
-               {byte_size $int_size sdata}
-               {encoding @DW_ATE_signed}
-               {name {int}}
+               DW_AT_byte_size $int_size sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name {int}
+           }
+           DW_TAG_typedef {
+               DW_AT_name inty
+               DW_AT_type :$int2_label
            }
-            DW_TAG_typedef {
-                {DW_AT_name inty}
-                {DW_AT_type :$int2_label}
-            }
        }
     }
 
     # main CU
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "<artificial>"
        } {
            imported_unit {
-               {import %$cu2_label}
+               DW_AT_import %$cu2_label
            }
 
            subprogram {
-               {MACRO_AT_func {main}}
-               {external 1 flag}
+               MACRO_AT_func {main}
+               DW_AT_external 1 flag
            }
        }
     }
@@ -75,16 +75,16 @@ Dwarf::assemble $asm_file {
     # foo CU
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "<artificial>"
        } {
            imported_unit {
-               {import %$cu_label}
+               DW_AT_import %$cu_label
            }
 
            subprogram {
-               {MACRO_AT_func {foo}}
-               {external 1 flag}
+               MACRO_AT_func {foo}
+               DW_AT_external 1 flag
            }
        }
     }
index cdcb8108fd10384087e65901ffcb56674ba07897..12dc69ee125705ad6b6be148a8849d4afde3ec54 100644 (file)
@@ -37,31 +37,31 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        cu_label: partial_unit {
-           {language @DW_LANG_C}
-           {name "imported_unit.c"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "imported_unit.c"
        } {
            int_label: base_type {
-               {byte_size $int_size sdata}
-               {encoding @DW_ATE_signed}
-               {name int}
+               DW_AT_byte_size $int_size sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
 
            main_label: subprogram {
-               {name main}
-               {type :$int_label}
-               {external 1 flag}
+               DW_AT_name main
+               DW_AT_type :$int_label
+               DW_AT_external 1 flag
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name "<artificial>"
        } {
            subprogram {
-               {abstract_origin %$main_label}
-               {MACRO_AT_range {main}}
+               DW_AT_abstract_origin %$main_label
+               MACRO_AT_range {main}
            }
        }
     }
index e5df67ea4b11353e48d1c8bf90e51202e7d058bb..2c17f2d455e2d130689aea79ce3b6ba86a911d8a 100644 (file)
@@ -52,27 +52,27 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name "<artificial>"
        } {
            imported_unit {
-               {import %$cu_label}
+               DW_AT_import %$cu_label
            }
            subprogram {
-               {abstract_origin %$main_label}
-               {MACRO_AT_range {main}}
+               DW_AT_abstract_origin %$main_label
+               MACRO_AT_range {main}
            } {
                subprogram {
-                   {abstract_origin %$doit_label}
-                   {MACRO_AT_range {doit}}
+                   DW_AT_abstract_origin %$doit_label
+                   MACRO_AT_range {doit}
                } {
                    formal_parameter {
-                       {abstract_origin %$doit_self_label}
+                       DW_AT_abstract_origin %$doit_self_label
                    }
                }
                DW_TAG_variable {
-                   {abstract_origin %$foo_label}
-                   {location 4 data1}
+                   DW_AT_abstract_origin %$foo_label
+                   DW_AT_location 4 data1
                }
            }
        }
@@ -80,43 +80,43 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        cu_label: compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name "imported_unit.c"}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name "imported_unit.c"
        } {
            int_label: base_type {
-               {byte_size $int_size sdata}
-               {encoding @DW_ATE_signed}
-               {name int}
+               DW_AT_byte_size $int_size sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name int
            }
 
            main_label: subprogram {
-               {name main}
-               {type :$int_label}
-               {external 1 flag}
+               DW_AT_name main
+               DW_AT_type :$int_label
+               DW_AT_external 1 flag
            } {
                Foo_label: class_type {
-                   {name Foo}
-                   {byte_size 1 sdata}
+                   DW_AT_name Foo
+                   DW_AT_byte_size 1 sdata
                } {
                    doit_label: subprogram {
-                       {name doit}
-                       {type :$int_label}
-                       {accessibility 1 DW_FORM_data1}
+                       DW_AT_name doit
+                       DW_AT_type :$int_label
+                       DW_AT_accessibility 1 DW_FORM_data1
                    } {
                        doit_self_label: formal_parameter {
-                           {name this}
-                           {artificial 1 DW_FORM_flag_present}
-                           {type :$Foo_pointer_type}
+                           DW_AT_name this
+                           DW_AT_artificial 1 DW_FORM_flag_present
+                           DW_AT_type :$Foo_pointer_type
                        }
                    }
                    Foo_pointer_type: pointer_type {
-                       {byte_size $addr_size sdata}
-                       {type :$Foo_label}
+                       DW_AT_byte_size $addr_size sdata
+                       DW_AT_type :$Foo_label
                    }
                }
                foo_label: DW_TAG_variable {
-                   {name foo}
-                   {type :$Foo_label}
+                   DW_AT_name foo
+                   DW_AT_type :$Foo_label
                }
            }
        }
index 76e20b6587cf1582a017d93252a60b93d807f42e..59c96690004532beee5bd074ce085c5024346951 100644 (file)
@@ -32,31 +32,31 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_name $srcfile}
-               {DW_AT_comp_dir /tmp}
+               DW_AT_name $srcfile
+               DW_AT_comp_dir /tmp
        } {
            declare_labels int_type_label
 
            # int
            int_type_label: base_type {
-               {name "int"}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name "int"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func { main }}
-               {DW_AT_external 1 flag}
+               MACRO_AT_func { main }
+               DW_AT_external 1 flag
            } {
                # A variable completely optimized out.
                DW_TAG_variable {
-                   {name "opt_out"}
-                   {type :$int_type_label}
+                   DW_AT_name "opt_out"
+                   DW_AT_type :$int_type_label
                }
                DW_TAG_variable {
-                   {name const_bytes}
-                   {type :$int_type_label}
-                   {const_value "\x01\x01\x01\x01" DW_FORM_block1}
+                   DW_AT_name const_bytes
+                   DW_AT_type :$int_type_label
+                   DW_AT_const_value "\x01\x01\x01\x01" DW_FORM_block1
                }
            }
        }
index b26650cef20c67e37c5a580e7dddbea7ccaf5dcd..723666292abbe5cf16850ded10e938da90e53949 100644 (file)
@@ -38,21 +38,21 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        Db: compile_unit {
-           {language @DW_LANG_C99}
-           {name "<artificial>"}
+           DW_AT_language @DW_LANG_C99
+           DW_AT_name "<artificial>"
        } {
            D72f8: subprogram {
-               {abstract_origin %$D272519}
-               {low_pc 0xb9e20 addr}
-               {high_pc 0x1f5 data4}
+               DW_AT_abstract_origin %$D272519
+               DW_AT_low_pc 0xb9e20 addr
+               DW_AT_high_pc 0x1f5 data4
            } {
                D736e: inlined_subroutine {
-                   {abstract_origin %$D26b227}
-                   {low_pc 0xb9efc addr}
-                   {high_pc 0xc data4}
+                   DW_AT_abstract_origin %$D26b227
+                   DW_AT_low_pc 0xb9efc addr
+                   DW_AT_high_pc 0xc data4
                } {
                    formal_parameter {
-                       {abstract_origin %$D274c42}
+                       DW_AT_abstract_origin %$D274c42
                    }
                }
            }
@@ -61,53 +61,53 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        D266465: compile_unit {
-           {language @DW_LANG_C99}
+           DW_AT_language @DW_LANG_C99
        } {
            D266477: typedef {
-               {name "size_t"}
-               {type :$D266483}
+               DW_AT_name "size_t"
+               DW_AT_type :$D266483
            }
 
            D266483: base_type {
-               {byte_size 8 sdata}
-               {encoding @DW_ATE_unsigned}
+               DW_AT_byte_size 8 sdata
+               DW_AT_encoding @DW_ATE_unsigned
            }
 
            D266496: pointer_type {
-               {byte_size 8 sdata}
+               DW_AT_byte_size 8 sdata
            }
 
            D266498: restrict_type {
-               {type :$D266496}
+               DW_AT_type :$D266496
            }
 
            D266ad3: pointer_type {
-               {byte_size 8 sdata}
-               {type :$D266ade}
+               DW_AT_byte_size 8 sdata
+               DW_AT_type :$D266ade
            }
 
            D266ad9: restrict_type {
-               {type :$D266ad3}
+               DW_AT_type :$D266ad3
            }
 
            D266ade: const_type {}
 
            D26b227: subprogram {
-               {external 1 flag}
-               {name "memcpy"}
-               {type :$D266496}
+               DW_AT_external 1 flag
+               DW_AT_name "memcpy"
+               DW_AT_type :$D266496
            } {
                D26b237: formal_parameter {
-                   {name "__dest"}
-                   {type :$D266498}
+                   DW_AT_name "__dest"
+                   DW_AT_type :$D266498
                }
                formal_parameter {
-                   {name "__src"}
-                   {type :$D266ad9}
+                   DW_AT_name "__src"
+                   DW_AT_type :$D266ad9
                }
                formal_parameter {
-                   {name "__len"}
-                   {type :$D266477}
+                   DW_AT_name "__len"
+                   DW_AT_type :$D266477
                }
            }
        }
@@ -115,85 +115,85 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        D26d8b1: compile_unit {
-           {language @DW_LANG_C99}
+           DW_AT_language @DW_LANG_C99
        } {
            D26d8c3: typedef {
-               {name "size_t"}
-               {type :$D26d8cf}
+               DW_AT_name "size_t"
+               DW_AT_type :$D26d8cf
            }
 
            D26d8cf: base_type {
-               {byte_size 8 sdata}
-               {encoding @DW_ATE_unsigned}
-               {name "long unsigned int"}
+               DW_AT_byte_size 8 sdata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "long unsigned int"
            }
 
            D26d944: pointer_type {
-               {byte_size 8 sdata}
+               DW_AT_byte_size 8 sdata
            }
 
            D26d946: restrict_type {
-               {type :$D26d944}
+               DW_AT_type :$D26d944
            }
 
            D26e103: structure_type {
-               {name "__object"}
-               {byte_size 12 sdata}
+               DW_AT_name "__object"
+               DW_AT_byte_size 12 sdata
            } {
                member {
-                   {name "__ob_next"}
-                   {type :$D26e145}
-                   {data_member_location 0 sdata}
+                   DW_AT_name "__ob_next"
+                   DW_AT_type :$D26e145
+                   DW_AT_data_member_location 0 sdata
                }
            }
 
            D26e145: pointer_type {
-               {byte_size 8 sdata}
-               {type :$D26e103}
+               DW_AT_byte_size 8 sdata
+               DW_AT_type :$D26e103
            }
 
            D26e415: typedef {
-               {name "PyObject"}
-               {type :$D26e103}
+               DW_AT_name "PyObject"
+               DW_AT_type :$D26e103
            }
 
            D26e48c: pointer_type {
-               {byte_size 8 sdata}
-               {type :$D26e415}
+               DW_AT_byte_size 8 sdata
+               DW_AT_type :$D26e415
            }
 
            D26df00: pointer_type {
-               {byte_size 8 sdata}
-               {type :$D26df0b}
+               DW_AT_byte_size 8 sdata
+               DW_AT_type :$D26df0b
            }
 
            D26df06: restrict_type {
-               {type :$D26df00}
+               DW_AT_type :$D26df00
            }
 
            D26df0b: const_type {}
 
            D272519: subprogram {
-               {name "bytes_repeat"}
-               {type :$D26e48c}
+               DW_AT_name "bytes_repeat"
+               DW_AT_type :$D26e48c
            }
 
            D274c1a: subprogram {
-               {external 1 flag}
-               {name "memcpy"}
-               {type :$D26d944}
+               DW_AT_external 1 flag
+               DW_AT_name "memcpy"
+               DW_AT_type :$D26d944
            } {
                formal_parameter {
-                   {name "__dest"}
-                   {type :$D26d946}
+                   DW_AT_name "__dest"
+                   DW_AT_type :$D26d946
                }
                formal_parameter {
-                   {name "__src"}
-                   {type :$D26df06}
+                   DW_AT_name "__src"
+                   DW_AT_type :$D26df06
                }
                D274c42: formal_parameter {
-                   {name "__len"}
-                   {type :$D26d8c3}
+                   DW_AT_name "__len"
+                   DW_AT_type :$D26d8c3
                }
            }
        }
index ff1d69ae2263b59b8901060925c8858a2e5067ad..ec77c2d244cab1d8582e14505703ca55ae9df2af 100644 (file)
@@ -33,153 +33,162 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
 Dwarf::assemble ${asm_file} {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels i7_type u1_type u17_type u31_type \
                u31_1_type u32_0_type u0_0_type be30_1_type just_bit_type
 
            i7_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_endianity @DW_END_little}
-               {DW_AT_name "i7"}
-               {DW_AT_byte_size 2 DW_FORM_udata}
-               {DW_AT_bit_size 7 DW_FORM_implicit_const}
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_endianity @DW_END_little
+               DW_AT_name "i7"
+               DW_AT_byte_size 2 DW_FORM_udata
+               DW_AT_bit_size 7 DW_FORM_implicit_const
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_i16_m1"}
-               {DW_AT_type :${i7_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "i16_m1"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_i16_m1"
+               DW_AT_type :${i7_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "i16_m1"]
+               }] SPECIAL_expr
            }
 
            u1_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_boolean}
-               {DW_AT_endianity @DW_END_little}
-               {DW_AT_name "u1"}
-               {DW_AT_byte_size 2 DW_FORM_udata}
-               {DW_AT_bit_size 1 DW_FORM_udata}
-               {DW_AT_data_bit_offset 2 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_boolean
+               DW_AT_endianity @DW_END_little
+               DW_AT_name "u1"
+               DW_AT_byte_size 2 DW_FORM_udata
+               DW_AT_bit_size 1 DW_FORM_udata
+               DW_AT_data_bit_offset 2 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_u16_1"}
-               {DW_AT_type :${u1_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "u16_1"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_u16_1"
+               DW_AT_type :${u1_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "u16_1"]
+               }] SPECIAL_expr
            }
 
            u17_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_endianity @DW_END_little}
-               {DW_AT_name "u17"}
-               {DW_AT_byte_size 4 DW_FORM_udata}
-               {DW_AT_bit_size 17 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_endianity @DW_END_little
+               DW_AT_name "u17"
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_bit_size 17 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_u32_m2"}
-               {DW_AT_type :${u17_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "u32_m2"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_u32_m2"
+               DW_AT_type :${u17_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "u32_m2"]
+               }] SPECIAL_expr
            }
 
            u31_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_endianity @DW_END_little}
-               {DW_AT_name "u31"}
-               {DW_AT_byte_size 4 DW_FORM_udata}
-               {DW_AT_bit_size 31 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_endianity @DW_END_little
+               DW_AT_name "u31"
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_bit_size 31 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_u32_1"}
-               {DW_AT_type :${u31_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "u32_1"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_u32_1"
+               DW_AT_type :${u31_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "u32_1"]
+               }] SPECIAL_expr
            }
 
            u31_1_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_endianity @DW_END_little}
-               {DW_AT_name "u31_1"}
-               {DW_AT_byte_size 4 DW_FORM_udata}
-               {DW_AT_bit_size 31 DW_FORM_udata}
-               {DW_AT_data_bit_offset 1 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_endianity @DW_END_little
+               DW_AT_name "u31_1"
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_bit_size 31 DW_FORM_udata
+               DW_AT_data_bit_offset 1 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_u32_1_off"}
-               {DW_AT_type :${u31_1_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "u32_1_off"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_u32_1_off"
+               DW_AT_type :${u31_1_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "u32_1_off"]
+               }] SPECIAL_expr
            }
 
            be30_1_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_endianity @DW_END_big}
-               {DW_AT_name "be30_1"}
-               {DW_AT_byte_size 4 DW_FORM_udata}
-               {DW_AT_bit_size 30 DW_FORM_udata}
-               {DW_AT_data_bit_offset 1 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_endianity @DW_END_big
+               DW_AT_name "be30_1"
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_bit_size 30 DW_FORM_udata
+               DW_AT_data_bit_offset 1 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_be30_1_off"}
-               {DW_AT_type :${be30_1_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "be30_1_off"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_be30_1_off"
+               DW_AT_type :${be30_1_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "be30_1_off"]
+               }] SPECIAL_expr
            }
 
            u32_0_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_endianity @DW_END_little}
-               {DW_AT_name "u32_0"}
-               {DW_AT_byte_size 4 DW_FORM_udata}
-               {DW_AT_bit_size 0 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_endianity @DW_END_little
+               DW_AT_name "u32_0"
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_bit_size 0 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_u32_0"}
-               {DW_AT_type :${u32_0_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "u32_0"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_u32_0"
+               DW_AT_type :${u32_0_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "u32_0"]
+               }] SPECIAL_expr
            }
 
            u0_0_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_endianity @DW_END_little}
-               {DW_AT_name "u0_0"}
-               {DW_AT_byte_size 0 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_endianity @DW_END_little
+               DW_AT_name "u0_0"
+               DW_AT_byte_size 0 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_u0_0"}
-               {DW_AT_type :${u0_0_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "u32_0"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_u0_0"
+               DW_AT_type :${u0_0_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "u32_0"]
+               }] SPECIAL_expr
            }
 
            just_bit_type: DW_TAG_base_type {
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_name "just_bit_type"}
-               {DW_AT_bit_size 3 DW_FORM_udata}
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "just_bit_type"
+               DW_AT_bit_size 3 DW_FORM_udata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "v_just_bit"}
-               {DW_AT_type :${just_bit_type}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "just_bit_0"]}
-                   SPECIAL_expr}
+               DW_AT_name "v_just_bit"
+               DW_AT_type :${just_bit_type}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "just_bit_0"]
+               }] SPECIAL_expr
            }
        }
     }
index 6e10b6c6883b49fd5ebcca972b9183c067807e13..fb4bf3a356d95c422850f6fe6ebb0a1cb5d37202 100644 (file)
@@ -53,27 +53,27 @@ foreach_with_prefix is_64 {false true} {
            DW_TAG_compile_unit {
            } {
                int_type1: DW_TAG_base_type {
-                   {DW_AT_byte_size 4 DW_FORM_data1}
-                   {DW_AT_encoding @DW_ATE_signed}
-                   {DW_AT_name "int"}
+                   DW_AT_byte_size 4 DW_FORM_data1
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_name "int"
                }
 
                DW_TAG_variable {
-                   {DW_AT_name "foo"}
-                   {DW_AT_location $foo_location_list DW_FORM_sec_offset}
-                   {DW_AT_type :$int_type1}
+                   DW_AT_name "foo"
+                   DW_AT_location $foo_location_list DW_FORM_sec_offset
+                   DW_AT_type :$int_type1
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func1"}
-                   {DW_AT_low_pc $func1_addr}
-                   {DW_AT_high_pc $func1_len DW_FORM_udata}
+                   DW_AT_name "func1"
+                   DW_AT_low_pc $func1_addr
+                   DW_AT_high_pc $func1_len DW_FORM_udata
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func2"}
-                   {DW_AT_low_pc $func2_addr}
-                   {DW_AT_high_pc $func2_len DW_FORM_udata}
+                   DW_AT_name "func2"
+                   DW_AT_low_pc $func2_addr
+                   DW_AT_high_pc $func2_len DW_FORM_udata
                }
            }
        }
index 766568020838a5f7d89eeed0c8d1a44022aa0b12..2a8b45737897fc5311ce8ddae6a56a7a57a01cb0 100644 (file)
@@ -154,38 +154,38 @@ Dwarf::assemble ${asm_file} {
 
     cu { label cu_label } {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
-           {name ${::srcfile}}
-           {stmt_list $L DW_FORM_sec_offset}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name ${::srcfile}
+           DW_AT_stmt_list $L DW_FORM_sec_offset
         } {
            declare_labels int_label class_A_label class_B_label \
                           B_ptr_label
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size ${::long_size} DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "int"}
+               DW_AT_byte_size ${::long_size} DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            class_A_label: DW_TAG_class_type {
-               {DW_AT_name "A"}
-               {DW_AT_byte_size ${::struct_A_size} DW_FORM_sdata}
+               DW_AT_name "A"
+               DW_AT_byte_size ${::struct_A_size} DW_FORM_sdata
            } {
                DW_TAG_member {
-                   {DW_AT_name "a"}
-                   {DW_AT_type :$int_label}
-                   {DW_AT_data_member_location ${::A_a} DW_FORM_udata}
+                   DW_AT_name "a"
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location ${::A_a} DW_FORM_udata
                }
                DW_TAG_member {
-                   {DW_AT_name "x"}
-                   {DW_AT_type :$int_label}
-                   {DW_AT_data_member_location ${::A_x} DW_FORM_udata}
+                   DW_AT_name "x"
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location ${::A_x} DW_FORM_udata
                }
            }
 
            class_B_label: DW_TAG_class_type {
-               {DW_AT_name "B"}
-               {DW_AT_byte_size ${::struct_B_size} DW_FORM_sdata}
+               DW_AT_name "B"
+               DW_AT_byte_size ${::struct_B_size} DW_FORM_sdata
            } {
                # While there are easier / better ways to specify an
                # offset used by DW_AT_data_member_location than that
@@ -201,45 +201,47 @@ Dwarf::assemble ${asm_file} {
                # by decode_locdesc(); this is why those opcodes were
                # chosen.
                DW_TAG_inheritance {
-                   {DW_AT_type :$class_A_label}
-                   {DW_AT_data_member_location {
+                   DW_AT_type :$class_A_label
+                   DW_AT_data_member_location [subst {
                        DW_OP_constu ${::B_a}
                        DW_OP_plus
                        DW_OP_pick 0
-                       DW_OP_drop} SPECIAL_expr}
-                   {DW_AT_accessibility 1 DW_FORM_data1}
+                       DW_OP_drop}] SPECIAL_expr
+                   DW_AT_accessibility 1 DW_FORM_data1
                }
                DW_TAG_member {
-                   {DW_AT_name "b"}
-                   {DW_AT_type :$int_label}
-                   {DW_AT_data_member_location ${::B_b} DW_FORM_udata}
+                   DW_AT_name "b"
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location ${::B_b} DW_FORM_udata
                }
                DW_TAG_member {
-                   {DW_AT_name "x2"}
-                   {DW_AT_type :$int_label}
-                   {DW_AT_data_member_location ${::B_x2} DW_FORM_udata}
+                   DW_AT_name "x2"
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location ${::B_x2} DW_FORM_udata
                }
            }
 
            B_ptr_label: DW_TAG_pointer_type {
-               {DW_AT_type :$class_B_label}
-               {DW_AT_byte_size ${::addr_size} DW_FORM_sdata}
+               DW_AT_type :$class_B_label
+               DW_AT_byte_size ${::addr_size} DW_FORM_sdata
            }
 
            DW_TAG_variable {
-               {DW_AT_name "g_A"}
-               {DW_AT_type :$class_A_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "g_A"]} \
-                                SPECIAL_expr}
+               DW_AT_name "g_A"
+               DW_AT_type :$class_A_label
+               DW_AT_external 1 flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "g_A"]
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name "g_B"}
-               {DW_AT_type :$class_B_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "g_B"]} \
-                                SPECIAL_expr}
+               DW_AT_name "g_B"
+               DW_AT_type :$class_B_label
+               DW_AT_external 1 flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "g_B"]
+               }] SPECIAL_expr
            }
 
            # We can't use MACRO_AT for the definitions of foo and bar
@@ -247,23 +249,23 @@ Dwarf::assemble ${asm_file} {
            # flags.  Therefore, we list the name, low_pc, and high_pc
            # explicitly.
            DW_TAG_subprogram {
-               {DW_AT_name foo}
-               {DW_AT_low_pc $foo_start DW_FORM_addr}
-               {DW_AT_high_pc $foo_end DW_FORM_addr}
-               {DW_AT_type :${B_ptr_label}}
-               {DW_AT_external 1 flag}
+               DW_AT_name foo
+               DW_AT_low_pc $foo_start DW_FORM_addr
+               DW_AT_high_pc $foo_end DW_FORM_addr
+               DW_AT_type :${B_ptr_label}
+               DW_AT_external 1 flag
            }
 
            DW_TAG_subprogram {
-               {DW_AT_name bar}
-               {DW_AT_low_pc $bar_start DW_FORM_addr}
-               {DW_AT_high_pc $bar_end DW_FORM_addr}
-               {DW_AT_type :${B_ptr_label}}
-               {DW_AT_external 1 flag}
+               DW_AT_name bar
+               DW_AT_low_pc $bar_start DW_FORM_addr
+               DW_AT_high_pc $bar_end DW_FORM_addr
+               DW_AT_type :${B_ptr_label}
+               DW_AT_external 1 flag
            } {
                DW_TAG_formal_parameter {
-                   {DW_AT_name v}
-                   {DW_AT_type :${B_ptr_label}}
+                   DW_AT_name v
+                   DW_AT_type :${B_ptr_label}
                }
            }
        }
index b0c9d7d4ea22a994fca112f2e1850d8ee7f45941..021129d0391dd82b11fe28647e4d10cc6850b199 100644 (file)
@@ -57,30 +57,30 @@ foreach_with_prefix is_64 {false true} {
            declare_labels int_type
 
            DW_TAG_compile_unit {
-               {DW_AT_loclists_base cu_table DW_FORM_sec_offset}
+               DW_AT_loclists_base cu_table DW_FORM_sec_offset
            } {
                int_type: DW_TAG_base_type {
-                   {DW_AT_byte_size 4 DW_FORM_data1}
-                   {DW_AT_encoding @DW_ATE_signed}
-                   {DW_AT_name "int"}
+                   DW_AT_byte_size 4 DW_FORM_data1
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_name "int"
                }
 
                DW_TAG_variable {
-                   {DW_AT_name "foo"}
-                   {DW_AT_location 1 DW_FORM_loclistx}
-                   {DW_AT_type :$int_type}
+                   DW_AT_name "foo"
+                   DW_AT_location 1 DW_FORM_loclistx
+                   DW_AT_type :$int_type
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func1"}
-                   {DW_AT_low_pc $func1_addr}
-                   {DW_AT_high_pc $func1_len DW_FORM_udata}
+                   DW_AT_name "func1"
+                   DW_AT_low_pc $func1_addr
+                   DW_AT_high_pc $func1_len DW_FORM_udata
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func2"}
-                   {DW_AT_low_pc $func2_addr}
-                   {DW_AT_high_pc $func2_len DW_FORM_udata}
+                   DW_AT_name "func2"
+                   DW_AT_low_pc $func2_addr
+                   DW_AT_high_pc $func2_len DW_FORM_udata
                }
            }
        }
index 38512cda628cd282206bff1b0ad7511b5c3ede82..e39ca19b126f41708344fc1e972d8158fa4888be 100644 (file)
@@ -66,27 +66,27 @@ foreach_with_prefix is_64 {false true} {
            DW_TAG_compile_unit {
            } {
                int_type1: DW_TAG_base_type {
-                   {DW_AT_byte_size 4 DW_FORM_data1}
-                   {DW_AT_encoding @DW_ATE_signed}
-                   {DW_AT_name "int"}
+                   DW_AT_byte_size 4 DW_FORM_data1
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_name "int"
                }
 
                DW_TAG_variable {
-                   {DW_AT_name "foo"}
-                   {DW_AT_location $foo_location_list DW_FORM_sec_offset}
-                   {DW_AT_type :$int_type1}
+                   DW_AT_name "foo"
+                   DW_AT_location $foo_location_list DW_FORM_sec_offset
+                   DW_AT_type :$int_type1
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func1"}
-                   {DW_AT_low_pc $func1_addr}
-                   {DW_AT_high_pc $func1_len DW_FORM_udata}
+                   DW_AT_name "func1"
+                   DW_AT_low_pc $func1_addr
+                   DW_AT_high_pc $func1_len DW_FORM_udata
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func2"}
-                   {DW_AT_low_pc $func2_addr}
-                   {DW_AT_high_pc $func2_len DW_FORM_udata}
+                   DW_AT_name "func2"
+                   DW_AT_low_pc $func2_addr
+                   DW_AT_high_pc $func2_len DW_FORM_udata
                }
            }
        }
@@ -100,30 +100,30 @@ foreach_with_prefix is_64 {false true} {
            is_64 $is_64
        } {
            DW_TAG_compile_unit {
-               {DW_AT_loclists_base cu2_table DW_FORM_sec_offset}
+               DW_AT_loclists_base cu2_table DW_FORM_sec_offset
            } {
                int_type2: DW_TAG_base_type {
-                   {DW_AT_byte_size 4 DW_FORM_data1}
-                   {DW_AT_encoding @DW_ATE_signed}
-                   {DW_AT_name "int"}
+                   DW_AT_byte_size 4 DW_FORM_data1
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_name "int"
                }
 
                DW_TAG_variable {
-                   {DW_AT_name "bar"}
-                   {DW_AT_location $bar_location_list DW_FORM_sec_offset}
-                   {DW_AT_type :$int_type2}
+                   DW_AT_name "bar"
+                   DW_AT_location $bar_location_list DW_FORM_sec_offset
+                   DW_AT_type :$int_type2
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func3"}
-                   {DW_AT_low_pc $func3_addr}
-                   {DW_AT_high_pc $func3_len DW_FORM_udata}
+                   DW_AT_name "func3"
+                   DW_AT_low_pc $func3_addr
+                   DW_AT_high_pc $func3_len DW_FORM_udata
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func4"}
-                   {DW_AT_low_pc $func4_addr}
-                   {DW_AT_high_pc $func4_len DW_FORM_udata}
+                   DW_AT_name "func4"
+                   DW_AT_low_pc $func4_addr
+                   DW_AT_high_pc $func4_len DW_FORM_udata
                }
            }
        }
@@ -138,27 +138,27 @@ foreach_with_prefix is_64 {false true} {
            DW_TAG_compile_unit {
            } {
                int_type3: DW_TAG_base_type {
-                   {DW_AT_byte_size 4 DW_FORM_data1}
-                   {DW_AT_encoding @DW_ATE_signed}
-                   {DW_AT_name "int"}
+                   DW_AT_byte_size 4 DW_FORM_data1
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_name "int"
                }
 
                DW_TAG_variable {
-                   {DW_AT_name "baz"}
-                   {DW_AT_location $baz_location_list DW_FORM_sec_offset}
-                   {DW_AT_type :$int_type3}
+                   DW_AT_name "baz"
+                   DW_AT_location $baz_location_list DW_FORM_sec_offset
+                   DW_AT_type :$int_type3
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func5"}
-                   {DW_AT_low_pc $func5_addr}
-                   {DW_AT_high_pc $func5_len DW_FORM_udata}
+                   DW_AT_name "func5"
+                   DW_AT_low_pc $func5_addr
+                   DW_AT_high_pc $func5_len DW_FORM_udata
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func6"}
-                   {DW_AT_low_pc $func6_addr}
-                   {DW_AT_high_pc $func6_len DW_FORM_udata}
+                   DW_AT_name "func6"
+                   DW_AT_low_pc $func6_addr
+                   DW_AT_high_pc $func6_len DW_FORM_udata
                }
            }
        }
index 2569896470e2032c70ccf9bcad86ece655924634..876a8b24fd0812ec6339b0fd8528ca2f5a631bb8 100644 (file)
@@ -48,30 +48,30 @@ foreach_with_prefix is_64 {false true} {
            declare_labels int_type
 
            DW_TAG_compile_unit {
-               {DW_AT_loclists_base cu_table DW_FORM_sec_offset}
+               DW_AT_loclists_base cu_table DW_FORM_sec_offset
            } {
                int_type: DW_TAG_base_type {
-                   {DW_AT_byte_size 4 DW_FORM_data1}
-                   {DW_AT_encoding @DW_ATE_signed}
-                   {DW_AT_name "int"}
+                   DW_AT_byte_size 4 DW_FORM_data1
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_name "int"
                }
 
                DW_TAG_variable {
-                   {DW_AT_name "foo"}
-                   {DW_AT_location 1 DW_FORM_loclistx}
-                   {DW_AT_type :$int_type}
+                   DW_AT_name "foo"
+                   DW_AT_location 1 DW_FORM_loclistx
+                   DW_AT_type :$int_type
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func1"}
-                   {DW_AT_low_pc $func1_addr}
-                   {DW_AT_high_pc $func1_len DW_FORM_udata}
+                   DW_AT_name "func1"
+                   DW_AT_low_pc $func1_addr
+                   DW_AT_high_pc $func1_len DW_FORM_udata
                }
 
                DW_TAG_subprogram {
-                   {DW_AT_name "func2"}
-                   {DW_AT_low_pc $func2_addr}
-                   {DW_AT_high_pc $func2_len DW_FORM_udata}
+                   DW_AT_name "func2"
+                   DW_AT_low_pc $func2_addr
+                   DW_AT_high_pc $func2_len DW_FORM_udata
                }
            }
        }
index 7b0b27aee152dc2f3f4a2e9cd141e394975618a5..17e18c0b33d5e8b96bf6659ef53ec7ee5cac949b 100644 (file)
@@ -36,20 +36,20 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_name $::srcfile}
-           {DW_AT_macros $cu_macro1 DW_FORM_sec_offset}
-           {DW_AT_stmt_list $L DW_FORM_sec_offset}
+           DW_AT_name $::srcfile
+           DW_AT_macros $cu_macro1 DW_FORM_sec_offset
+           DW_AT_stmt_list $L DW_FORM_sec_offset
        } {
            declare_labels int_type
 
            int_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name int
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
-               {type :$int_type}
+               MACRO_AT_func {main}
+               DW_AT_type :$int_type
            }
        }
     }
index 6254286d56f62c6b109f4697d1bbd479c3cc6edd..b71d55d650534c3394d245ca4708889c9c0b3cd4 100644 (file)
@@ -64,24 +64,24 @@ proc do_test { test_name lines_version DW_AT_name main_file_idx directories
 
                cu {} {
                    DW_TAG_compile_unit {
-                           {DW_AT_producer "My C Compiler"}
-                           {DW_AT_language @DW_LANG_C11}
-                           {DW_AT_name $::DW_AT_name}
-                           {DW_AT_comp_dir $comp_dir}
-                           {DW_AT_stmt_list $Llines DW_FORM_sec_offset}
-                           {DW_AT_macros $cu_macros DW_FORM_sec_offset}
+                           DW_AT_producer "My C Compiler"
+                           DW_AT_language @DW_LANG_C11
+                           DW_AT_name $::DW_AT_name
+                           DW_AT_comp_dir $comp_dir
+                           DW_AT_stmt_list $Llines DW_FORM_sec_offset
+                           DW_AT_macros $cu_macros DW_FORM_sec_offset
                    } {
                        declare_labels int_type
 
                        int_type: DW_TAG_base_type {
-                           {DW_AT_byte_size 4 DW_FORM_sdata}
-                           {DW_AT_encoding  @DW_ATE_signed}
-                           {DW_AT_name int}
+                           DW_AT_byte_size 4 DW_FORM_sdata
+                           DW_AT_encoding  @DW_ATE_signed
+                           DW_AT_name int
                        }
 
                        DW_TAG_subprogram {
-                           {MACRO_AT_func {main}}
-                           {type :$int_type}
+                           MACRO_AT_func {main}
+                           DW_AT_type :$int_type
                        }
                    }
                }
index 467cf20b426a3aa7894b4f6ddca1adcb5a629b0f..02003167c5ae73f50cf5a687cfb385a26914bf80 100644 (file)
@@ -31,22 +31,22 @@ Dwarf::assemble $asm_file {
        # so choose a language that isn't C and that gdb is unlikely
        # to implement.
        DW_TAG_compile_unit {
-               {DW_AT_language @DW_LANG_PLI}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+               DW_AT_language @DW_LANG_PLI
+               DW_AT_name     $srcfile
+               DW_AT_comp_dir /tmp
+       } {
            declare_labels type
 
-            type: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      int}
-            }
+           type: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
+           }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func {mymain}}
-               {type :$type}
-               {DW_AT_main_subprogram 1 flag}
+               MACRO_AT_func {mymain}
+               DW_AT_type :$type
+               DW_AT_main_subprogram 1 flag
            } {
            }
        }
index 7482edb1ccd8412b6ee12ea111c78a417d203b27..7817fbfb0617002632633fdd1327f174b0c74c6b 100644 (file)
@@ -26,21 +26,21 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_language @DW_LANG_C}
-               {DW_AT_name     $srcfile}
-               {DW_AT_comp_dir /tmp}
+               DW_AT_language @DW_LANG_C
+               DW_AT_name      $srcfile
+               DW_AT_comp_dir /tmp
        } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_signed
+               DW_AT_name       int
            }
 
            DW_TAG_enumeration_type {
-               {DW_AT_name mega_enum}
-               {DW_AT_type :$integer_label}
+               DW_AT_name mega_enum
+               DW_AT_type :$integer_label
            } {
                # In the past gdb used a 'short' for the field count.
                # But this fails if there are too many fields.  If the
@@ -48,8 +48,8 @@ Dwarf::assemble $asm_file {
                # so use a number that's just big enough.
                for {set i 0} {$i < 65538} {incr i} {
                    DW_TAG_enumerator {
-                       {DW_AT_name DEI_$i}
-                       {DW_AT_const_value $i DW_FORM_sdata}
+                       DW_AT_name DEI_$i
+                       DW_AT_const_value $i DW_FORM_sdata
                    }
                }
            }
index 867527ce69eaf7d703e27f1144bc81b00b923d8a..828166f2770ba2598207bb6e40930ce2612a938d 100644 (file)
@@ -28,48 +28,50 @@ Dwarf::assemble $asm_file {
     declare_labels ptr_label subr_label memptr_label
 
     cu {} {
-       compile_unit {{language @DW_LANG_C_plus_plus}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C_plus_plus
+       } {
            int_label: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            float_label: base_type {
-               {name float}
-               {encoding @DW_ATE_float}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name float
+               DW_AT_encoding @DW_ATE_float
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            struct_label: structure_type {
-               {name S}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name S
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            ptr_label: pointer_type {
-               {type :$struct_label}
+               DW_AT_type :$struct_label
            }
 
            subr_label: subroutine_type {
-               {type :$int_label}
+               DW_AT_type :$int_label
            } {
                formal_parameter {
-                   {type :$ptr_label}
-                   {artificial 1 DW_FORM_flag_present}
+                   DW_AT_type :$ptr_label
+                   DW_AT_artificial 1 DW_FORM_flag_present
                }
                formal_parameter {
-                   {type :$float_label}
+                   DW_AT_type :$float_label
                }
            }
 
            memptr_label: ptr_to_member_type {
-               {type :$subr_label}
-               {containing_type :$struct_label}
+               DW_AT_type :$subr_label
+               DW_AT_containing_type :$struct_label
            }
 
            typedef {
-               {name the_typedef}
-               {type :$memptr_label}
+               DW_AT_name the_typedef
+               DW_AT_type :$memptr_label
            }
        }
     }
index 835686ee010db8129334ffabc8d426d95597d135..977a0165f8866f01c7d9608154816c7a3867f45c 100644 (file)
@@ -38,19 +38,19 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name missing-line-table.c}
-           {stmt_list $Llines DW_FORM_sec_offset}
-           {DW_AT_low_pc $::foo_start DW_FORM_addr}
-           {DW_AT_high_pc $::main_end DW_FORM_addr}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name missing-line-table.c
+           DW_AT_stmt_list $Llines DW_FORM_sec_offset
+           DW_AT_low_pc $::foo_start DW_FORM_addr
+           DW_AT_high_pc $::main_end DW_FORM_addr
        } {
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {main}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {main}
            }
            subprogram {
-               {external 1 flag}
-               {MACRO_AT_func {foo}}
+               DW_AT_external 1 flag
+               MACRO_AT_func {foo}
            }
        }
     }
index 947f02462be196010a0132b5f079cfe95bcc67f5..a3eaae90af1e876a3c436c2226b924fe03b5fcf0 100644 (file)
@@ -30,8 +30,8 @@ Dwarf::assemble $asm_file {
 
            # This signature is intentionally wrong.
            typedef_label: typedef {
-               {name foo}
-               {type 0xee22334455667788 ref_sig8 }
+               DW_AT_name foo
+               DW_AT_type 0xee22334455667788 ref_sig8
            }
        }
     }
@@ -39,9 +39,9 @@ Dwarf::assemble $asm_file {
     tu {} 0x1122334455667788 the_type {
        type_unit {} {
            the_type: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 sdata
            }
        }
     }
index 108c9c73022f4c9eadc66ef7fa346c83c88dee95..ee6992b397aaa4209f9d51b6e2646318cc90af0e 100644 (file)
@@ -40,112 +40,112 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
        } {
            declare_labels int float template_var1 template_var2 template_var3
 
            int: DW_TAG_base_type {
-               {DW_AT_name "int"}
-               {DW_AT_byte_size 4 DW_FORM_data1}
-               {DW_AT_encoding @DW_ATE_signed}
+               DW_AT_name "int"
+               DW_AT_byte_size 4 DW_FORM_data1
+               DW_AT_encoding @DW_ATE_signed
            }
 
            float: base_type {
-               {DW_AT_name float}
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding @DW_ATE_float}
+               DW_AT_name float
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_float
            }
 
            DW_TAG_subprogram {
-               {DW_AT_name "main"}
-               {DW_AT_low_pc $::main_start DW_FORM_addr}
-               {DW_AT_high_pc $::main_end DW_FORM_addr}
-               {DW_AT_type :$int}
-               {DW_AT_external 1 DW_FORM_flag}
+               DW_AT_name "main"
+               DW_AT_low_pc $::main_start DW_FORM_addr
+               DW_AT_high_pc $::main_end DW_FORM_addr
+               DW_AT_type :$int
+               DW_AT_external 1 DW_FORM_flag
            } {
                DW_TAG_variable {
-                   {DW_AT_name "var1"}
-                   {DW_AT_type :$template_var1}
+                   DW_AT_name "var1"
+                   DW_AT_type :$template_var1
                }
                DW_TAG_variable {
-                   {DW_AT_name "var2"}
-                   {DW_AT_type :$template_var2}
+                   DW_AT_name "var2"
+                   DW_AT_type :$template_var2
                }
                DW_TAG_variable {
-                   {DW_AT_name "var3"}
-                   {DW_AT_type :$template_var3}
+                   DW_AT_name "var3"
+                   DW_AT_type :$template_var3
                }
            }
 
            # A variable whose type is a template instantiation with two
            # template parameters, one unnamed.
            template_var1: DW_TAG_structure_type {
-               {DW_AT_name "template_var1<int, float>"}
+               DW_AT_name "template_var1<int, float>"
            } {
                DW_TAG_member {
-                   {DW_AT_name "me"}
-                   {DW_AT_type :$int}
+                   DW_AT_name "me"
+                   DW_AT_type :$int
                }
                DW_TAG_member {
-                   {DW_AT_name "me2"}
-                   {DW_AT_type :$float}
+                   DW_AT_name "me2"
+                   DW_AT_type :$float
                }
                DW_TAG_template_type_param {
-                   {DW_AT_type :$int}
+                   DW_AT_type :$int
                }
                DW_TAG_template_type_param {
-                   {DW_AT_name "second"}
-                   {DW_AT_type :$float}
+                   DW_AT_name "second"
+                   DW_AT_type :$float
                }
            }
 
            # A variable whose type is a template instantiation with two
            # template parameters, both unnamed.
            template_var2: DW_TAG_class_type {
-               {DW_AT_name "template_var2<int, float>"}
+               DW_AT_name "template_var2<int, float>"
            } {
                DW_TAG_member {
-                   {DW_AT_name "me"}
-                   {DW_AT_type :$int}
+                   DW_AT_name "me"
+                   DW_AT_type :$int
                }
                DW_TAG_member {
-                   {DW_AT_name "me2"}
-                   {DW_AT_type :$float}
+                   DW_AT_name "me2"
+                   DW_AT_type :$float
                }
                DW_TAG_template_type_param {
-                   {DW_AT_type :$int}
+                   DW_AT_type :$int
                }
                DW_TAG_template_type_param {
-                   {DW_AT_type :$float}
+                   DW_AT_type :$float
                }
            }
 
            # A variable whose type is a template instantiation with four
            # template arguments, two types, two values, all unnamed.
            template_var3: DW_TAG_structure_type {
-               {DW_AT_name "template_var3<0, int, 11, float>"}
+               DW_AT_name "template_var3<0, int, 11, float>"
            } {
                DW_TAG_member {
-                   {DW_AT_name "me"}
-                   {DW_AT_type :$int}
+                   DW_AT_name "me"
+                   DW_AT_type :$int
                }
                DW_TAG_member {
-                   {DW_AT_name "me2"}
-                   {DW_AT_type :$float}
+                   DW_AT_name "me2"
+                   DW_AT_type :$float
                }
                DW_TAG_template_value_param {
-                   {DW_AT_type :$int}
-                   {DW_AT_const_value 0 DW_FORM_sdata}
+                   DW_AT_type :$int
+                   DW_AT_const_value 0 DW_FORM_sdata
                }
                DW_TAG_template_type_param {
-                   {DW_AT_type :$int}
+                   DW_AT_type :$int
                }
                DW_TAG_template_value_param {
-                   {DW_AT_type :$int}
-                   {DW_AT_const_value 11 DW_FORM_sdata}
+                   DW_AT_type :$int
+                   DW_AT_const_value 11 DW_FORM_sdata
                }
                DW_TAG_template_type_param {
-                   {DW_AT_type :$float}
+                   DW_AT_type :$float
                }
            }
        }
index 91997f7cc834f64142c43c1632fa9138996742ef..68a555267ea483cd4aaa33cbd58dcb2d07aeea2e 100644 (file)
@@ -44,48 +44,52 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_producer "GNU C 8.1"}
-                {DW_AT_language @DW_LANG_C}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+               DW_AT_producer "GNU C 8.1"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name     $srcfile
+               DW_AT_comp_dir /tmp
+       } {
            declare_labels main_type int_type ptr_type
 
            main_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
            }
 
            int_type: DW_TAG_base_type {
-               {DW_AT_byte_size 0 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
+               DW_AT_byte_size 0 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
            }
 
            ptr_type: DW_TAG_pointer_type {
-               {DW_AT_type :$int_type}
+               DW_AT_type :$int_type
            }
 
-            DW_TAG_subprogram {
-                {MACRO_AT_func func}
-                {type :$int_type}
+           DW_TAG_subprogram {
+               MACRO_AT_func func
+               DW_AT_type :$int_type
            }
-            DW_TAG_subprogram {
-                {MACRO_AT_func main}
-                {type :$main_type}
+           DW_TAG_subprogram {
+               MACRO_AT_func main
+               DW_AT_type :$main_type
            }
 
            DW_TAG_variable {
-               {DW_AT_name "var_a"}
-               {DW_AT_type :$main_type}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_a"]} SPECIAL_expr}
+               DW_AT_name "var_a"
+               DW_AT_type :$main_type
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "var_a"]
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name "var_ptr"}
-               {DW_AT_type :$ptr_type}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_ptr"]} SPECIAL_expr}
+               DW_AT_name "var_ptr"
+               DW_AT_type :$ptr_type
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "var_ptr"]
+               }] SPECIAL_expr
            }
        }
     }
index 3458f7c9ff082feb317a8cbeb200962ce3c3f82c..4fdf98572e7c010972f053ab0217ca56d7f3dfb5 100644 (file)
@@ -35,40 +35,40 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        D45d9: compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name "SerialPortUtils.cpp"}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name "SerialPortUtils.cpp"
        } {
            D5079: base_type {
-               {byte_size 1 sdata}
-               {encoding @DW_ATE_unsigned}
-               {name "char"}
+               DW_AT_byte_size 1 sdata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "char"
            }
 
            D5080: const_type {
-               {type :$D5079}
+               DW_AT_type :$D5079
            }
 
            D50a9: pointer_type {
-               {byte_size 4 sdata}
-               {type :$D5080}
+               DW_AT_byte_size 4 sdata
+               DW_AT_type :$D5080
            }
 
            D50af: const_type {
-               {type :$D50a9}
+               DW_AT_type :$D50a9
            }
 
            D5ab2: subprogram {
-               {external 1 flag}
-               {linkage_name "_Z18SerialSyncWriteStrPKc"}
+               DW_AT_external 1 flag
+               DW_AT_linkage_name "_Z18SerialSyncWriteStrPKc"
            } {
                D5ac2: formal_parameter {
-                   {name "msg"}
-                   {type :$D50af}
+                   DW_AT_name "msg"
+                   DW_AT_type :$D50af
                }
                D5ace: lexical_block {} {
                    D5acf: DW_TAG_variable {
-                       {name "p"}
-                       {type :$D50a9}
+                       DW_AT_name "p"
+                       DW_AT_type :$D50a9
                    }
                }
            }
@@ -77,34 +77,34 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        D2135f: compile_unit {
-           {language @DW_LANG_C_plus_plus}
-           {name "Main.cpp"}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name "Main.cpp"
        } {
            D2216a: base_type {
-               {byte_size 1 sdata}
-               {encoding @DW_ATE_unsigned_char}
-               {name "char"}
+               DW_AT_byte_size 1 sdata
+               DW_AT_encoding @DW_ATE_unsigned_char
+               DW_AT_name "char"
            }
 
            D22171: const_type {
-               {type :$D2216a}
+               DW_AT_type :$D2216a
            }
 
            D226c4: pointer_type {
-               {byte_size 4 sdata}
-               {type :$D22171}
+               DW_AT_byte_size 4 sdata
+               DW_AT_type :$D22171
            }
 
            D226ca: const_type {
-               {type :$D226c4}
+               DW_AT_type :$D226c4
            }
 
            D245da: subprogram {
-               {name "PrintPanicMsg"}
+               DW_AT_name "PrintPanicMsg"
            } {
                D245e6: formal_parameter {
-                   {name "msg"}
-                   {type :$D226ca}
+                   DW_AT_name "msg"
+                   DW_AT_type :$D226ca
                }
            }
        }
@@ -112,28 +112,28 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        D41c21: compile_unit {
-           {language @DW_LANG_C99}
-           {name "<artificial>"}
+          DW_AT_language @DW_LANG_C99
+          DW_AT_name "<artificial>"
        } {
-           D42025: subprogram {
-               {abstract_origin %$D245da}
-               {low_pc 0x80b60 addr}
-               {high_pc 0x6c data4}
-           } {
+          D42025: subprogram {
+              DW_AT_abstract_origin %$D245da
+              DW_AT_low_pc 0x80b60 addr
+              DW_AT_high_pc 0x6c data4
+          } {
               D42038: formal_parameter {
-                  {abstract_origin %$D245e6}
+                  DW_AT_abstract_origin %$D245e6
               }
 
               D42045: inlined_subroutine {
-                   {abstract_origin %$D5ab2}
-                   {low_pc 0x8060 addr}
-                   {high_pc 0xc data4}
-               } {
-                   D420b5: formal_parameter {
-                       {abstract_origin %$D5ac2}
-                   }
-               }
-           }
+                  DW_AT_abstract_origin %$D5ab2
+                  DW_AT_low_pc 0x8060 addr
+                  DW_AT_high_pc 0xc data4
+              } {
+                  D420b5: formal_parameter {
+                      DW_AT_abstract_origin %$D5ac2
+                  }
+              }
+          }
        }
     }
 }
index 1610b7cea08dbd49efc16c18e7472a8d2cf90f06..6d42fb727b8f50dc396d94413fe79ef9c57bd420 100644 (file)
@@ -27,25 +27,25 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_D}
-           {DW_AT_name $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_D
+           DW_AT_name  $srcfile
+           DW_AT_comp_dir /tmp
        } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_signed
+               DW_AT_name       int
            }
 
            DW_TAG_enumeration_type {
-               {DW_AT_type :$integer_label}
-               {DW_AT_enum_class 1 DW_FORM_flag}
+               DW_AT_type :$integer_label
+               DW_AT_enum_class 1 DW_FORM_flag
            } {
                DW_TAG_enumerator {
-                   {DW_AT_name VALUE}
-                   {DW_AT_const_value 17 DW_FORM_sdata}
+                   DW_AT_name VALUE
+                   DW_AT_const_value 17 DW_FORM_sdata
                }
            }
        }
index 365204f26c6dc6f5146efdba6457428e64046b7d..48f272e53579e2f8fea89c4127a08e127dacfdb7 100644 (file)
@@ -31,33 +31,35 @@ set asm_file [standard_output_file ${srcfile2}]
 Dwarf::assemble ${asm_file} {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C99}
-           {DW_AT_producer "GNU C++17 11.1.0 -mtune=generic -march=x86-64 -g3 -O0"}
-           {name ${::srcfile}}
+           DW_AT_language @DW_LANG_C99
+           DW_AT_producer "GNU C++17 11.1.0 -mtune=generic -march=x86-64 -g3 -O0"
+           DW_AT_name ${::srcfile}
        } {
            declare_labels int_label struct_label
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name "int"}
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name "int"
            }
 
            struct_label: DW_TAG_structure_type {
-               {DW_AT_name "the_struct"}
-               {DW_AT_byte_size 4 DW_FORM_udata}
+               DW_AT_name "the_struct"
+               DW_AT_byte_size 4 DW_FORM_udata
            } {
                DW_TAG_member {
-                   {DW_AT_name "field"}
-                   {DW_AT_type :$int_label}
-                   {DW_AT_data_member_location -1 DW_FORM_sdata}
+                   DW_AT_name "field"
+                   DW_AT_type :$int_label
+                   DW_AT_data_member_location -1 DW_FORM_sdata
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name "s"}
-               {DW_AT_type :$struct_label}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "s"]} SPECIAL_expr}
+               DW_AT_name "s"
+               DW_AT_type :$struct_label
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "s"]
+               }] SPECIAL_expr
            }
        }
     }
index 4aef19a2e5c20200334ab378e824229de07984bd..93c3deac2b22ad204420fa15d1f11decb6708736 100644 (file)
@@ -31,165 +31,165 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {DW_AT_name $srcfile}
+           DW_AT_name $srcfile
        } {
            declare_labels int_type_label char_type_label \
                struct_s_label struct_t_label array_a9_label \
                char_ptr_label implicit_a_label stack_b_label
 
            int_type_label: base_type {
-               {name "int"}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name "int"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
            char_type_label: base_type {
-               {name "char"}
-               {encoding @DW_ATE_unsigned}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name "char"
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
            char_ptr_label: pointer_type {
-               {type :$char_type_label}
+               DW_AT_type :$char_type_label
            }
 
            struct_s_label: structure_type {
-               {name s}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name s
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                member {
-                   {name a}
-                   {type :$int_type_label}
-                   {data_member_location 0 DW_FORM_udata}
-                   {bit_size 8 DW_FORM_udata}
+                   DW_AT_name a
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_member_location 0 DW_FORM_udata
+                   DW_AT_bit_size 8 DW_FORM_udata
                }
                member {
-                   {name b}
-                   {type :$int_type_label}
-                   {data_bit_offset 8 DW_FORM_udata}
-                   {bit_size 24 DW_FORM_udata}
+                   DW_AT_name b
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_bit_offset 8 DW_FORM_udata
+                   DW_AT_bit_size 24 DW_FORM_udata
                }
            }
 
            struct_t_label: structure_type {
-               {name t}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name t
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                member {
-                   {name a}
-                   {type :$int_type_label}
-                   {data_member_location 0 DW_FORM_udata}
-                   {bit_size 9 DW_FORM_udata}
+                   DW_AT_name a
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_member_location 0 DW_FORM_udata
+                   DW_AT_bit_size 9 DW_FORM_udata
                }
                member {
-                   {name b}
-                   {type :$int_type_label}
-                   {data_bit_offset 9 DW_FORM_udata}
-                   {bit_size 23 DW_FORM_udata}
+                   DW_AT_name b
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_bit_offset 9 DW_FORM_udata
+                   DW_AT_bit_size 23 DW_FORM_udata
                }
            }
 
            array_a9_label: array_type {
-               {type :$char_type_label}
+               DW_AT_type :$char_type_label
            } {
                subrange_type {
-                   {type :$int_type_label}
-                   {upper_bound 8 DW_FORM_udata}
+                   DW_AT_type :$int_type_label
+                   DW_AT_upper_bound 8 DW_FORM_udata
                }
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
-               {DW_AT_external 1 flag}
+               MACRO_AT_func {main}
+               DW_AT_external 1 flag
            } {
                # Simple variable without location.
                DW_TAG_variable {
-                   {name undef_int}
-                   {type :$int_type_label}
+                   DW_AT_name undef_int
+                   DW_AT_type :$int_type_label
                }
                # Struct variable without location.
                DW_TAG_variable {
-                   {name undef_s}
-                   {type :$struct_s_label}
+                   DW_AT_name undef_s
+                   DW_AT_type :$struct_s_label
                }
                # Composite location: byte-aligned pieces.
                DW_TAG_variable {
-                   {name def_s}
-                   {type :$struct_s_label}
-                   {location {
+                   DW_AT_name def_s
+                   DW_AT_type :$struct_s_label
+                   DW_AT_location {
                        const1u 0
                        stack_value
                        bit_piece 8 0
                        const1s -1
                        stack_value
                        bit_piece 24 0
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                # Composite location: non-byte-aligned pieces.
                DW_TAG_variable {
-                   {name def_t}
-                   {type :$struct_t_label}
-                   {location {
+                   DW_AT_name def_t
+                   DW_AT_type :$struct_t_label
+                   DW_AT_location {
                        const2s -184
                        stack_value
                        bit_piece 9 0
                        const4u 1752286
                        stack_value
                        bit_piece 23 0
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                # Composite location with some empty pieces.
                DW_TAG_variable {
-                   {name part_def_a}
-                   {type :$array_a9_label}
-                   {location {
+                   DW_AT_name part_def_a
+                   DW_AT_type :$array_a9_label
+                   DW_AT_location {
                        piece 3
                        const4u 0xf1927314
                        stack_value
                        piece 4
                        piece 2
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                # Implicit location: immediate value.
                DW_TAG_variable {
-                   {name def_implicit_s}
-                   {type :$struct_s_label}
-                   {location {
+                   DW_AT_name def_implicit_s
+                   DW_AT_type :$struct_s_label
+                   DW_AT_location {
                        implicit_value 0x12 0x34 0x56 0x78
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                # Implicit location: immediate value for whole array, with
                # excess bytes.
                implicit_a_label: DW_TAG_variable {
-                   {name def_implicit_a}
-                   {type :$array_a9_label}
-                   {location {
+                   DW_AT_name def_implicit_a
+                   DW_AT_type :$array_a9_label
+                   DW_AT_location {
                        implicit_value 0x1 0x12 0x23 0x34 0x45 \
                            0x56 0x67 0x78 0x89 0x9a 0xab
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                # Implicit pointer into immediate value.
                DW_TAG_variable {
-                   {name implicit_a_ptr}
-                   {type :$char_ptr_label}
-                   {location {
+                   DW_AT_name implicit_a_ptr
+                   DW_AT_type :$char_ptr_label
+                   DW_AT_location [subst {
                        implicit_pointer $implicit_a_label 5
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
                # Stack-value location.
                stack_b_label: DW_TAG_variable {
-                   {name def_stack_b}
-                   {type :$struct_t_label}
-                   {location {
+                   DW_AT_name def_stack_b
+                   DW_AT_type :$struct_t_label
+                   DW_AT_location {
                        const4u 0x1a2b3c4d
                        stack_value
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                # Implicit pointer into stack value.
                DW_TAG_variable {
-                   {name implicit_b_ptr}
-                   {type :$char_ptr_label}
-                   {location {
+                   DW_AT_name implicit_b_ptr
+                   DW_AT_type :$char_ptr_label
+                   DW_AT_location [subst {
                        implicit_pointer $stack_b_label 1
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
            }
        }
index 2cc833886530daa2757a3defbe61470c69e9b0f7..0d5943c5818188d60e25d4487909999bd883b28a 100644 (file)
@@ -26,8 +26,8 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {low_pc 0x104320 DW_FORM_addr}
-           {high_pc 0x1045ed DW_FORM_addr}
+           DW_AT_low_pc 0x104320 DW_FORM_addr
+           DW_AT_high_pc 0x1045ed DW_FORM_addr
        } {
        }
     }
index 757212b3f2f64b8f72eef19940b6e82f30d95762..b4d275c9a368324ca3dd979cb61f091eb9c66c03 100644 (file)
@@ -44,37 +44,37 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name opaque_before}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name opaque_before
        } {
            imported_unit {
-               {import $partial_unit_with_opaque ref_addr}
+               DW_AT_import $partial_unit_with_opaque ref_addr
            }
 
            imported_unit {
-               {import $partial_unit_defining_a ref_addr}
+               DW_AT_import $partial_unit_defining_a ref_addr
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name opaque_after}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name opaque_after
        } {
            imported_unit {
-               {import $partial_unit_defining_b ref_addr}
+               DW_AT_import $partial_unit_defining_b ref_addr
            }
 
            imported_unit {
-               {import $partial_unit_with_opaque ref_addr}
+               DW_AT_import $partial_unit_with_opaque ref_addr
            }
        }
     }
 
     cu {} {
        partial_unit_with_opaque: partial_unit {
-           {name "partial_unit_with_opaque"}
+           DW_AT_name "partial_unit_with_opaque"
        } {
            # Normally gdb doesn't add opaque types to the symbol table
            # but there are times when it will, and in order to exercise
@@ -82,89 +82,89 @@ Dwarf::assemble $asm_file {
            # By giving it a size of 1 we achieve this.
 
            opaque_struct_a_label: structure_type {
-               {name struct_a}
-               {declaration 1 flag}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name struct_a
+               DW_AT_declaration 1 flag
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            opaque_struct_b_label: structure_type {
-               {name struct_b}
-               {declaration 1 flag}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name struct_b
+               DW_AT_declaration 1 flag
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            DW_TAG_variable {
-               {name variable_a}
-               {type :$opaque_struct_a_label}
-               {external 1 flag}
-               {declaration 1 flag}
+               DW_AT_name variable_a
+               DW_AT_type :$opaque_struct_a_label
+               DW_AT_external 1 flag
+               DW_AT_declaration 1 flag
            }
 
            DW_TAG_variable {
-               {name variable_b}
-               {type :$opaque_struct_b_label}
-               {external 1 flag}
-               {declaration 1 flag}
+               DW_AT_name variable_b
+               DW_AT_type :$opaque_struct_b_label
+               DW_AT_external 1 flag
+               DW_AT_declaration 1 flag
            }
        }
     }
 
     cu {} {
        partial_unit_defining_a: partial_unit {
-           {name "partial_unit_defining_a"}
+           DW_AT_name "partial_unit_defining_a"
        } {
            char_type1_label: base_type {
-               {name "signed char"}
-               {encoding @DW_ATE_signed}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name "signed char"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            struct_a_label: structure_type {
-               {name struct_a}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name struct_a
+               DW_AT_byte_size 1 DW_FORM_sdata
            } {
                member {
-                   {name xyz}
-                   {type :$char_type1_label}
-                   {data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name xyz
+                   DW_AT_type :$char_type1_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
            }
 
            DW_TAG_variable {
-               {name variable_a}
-               {type :$struct_a_label}
-               {external 1 flag}
-               {linkage_name variable_a}
+               DW_AT_name variable_a
+               DW_AT_type :$struct_a_label
+               DW_AT_external 1 flag
+               DW_AT_linkage_name variable_a
            }
        }
     }
 
     cu {} {
        partial_unit_defining_b: partial_unit {
-           {name "partial_unit_defining_b"}
+           DW_AT_name "partial_unit_defining_b"
        } {
            char_type2_label: base_type {
-               {name "signed char"}
-               {encoding @DW_ATE_signed}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name "signed char"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            struct_b_label: structure_type {
-               {name struct_b}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name struct_b
+               DW_AT_byte_size 1 DW_FORM_sdata
            } {
                member {
-                   {name xyz}
-                   {type :$char_type2_label}
-                   {data_member_location 0 DW_FORM_sdata}
+                   DW_AT_name xyz
+                   DW_AT_type :$char_type2_label
+                   DW_AT_data_member_location 0 DW_FORM_sdata
                }
            }
 
            DW_TAG_variable {
-               {name variable_b}
-               {type :$struct_b_label}
-               {external 1 flag}
-               {linkage_name variable_b}
+               DW_AT_name variable_b
+               DW_AT_type :$struct_b_label
+               DW_AT_external 1 flag
+               DW_AT_linkage_name variable_b
            }
        }
     }
@@ -173,11 +173,11 @@ Dwarf::assemble $asm_file {
     # so keep this separate.
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name main}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name main
        } {
            subprogram {
-               {MACRO_AT_func { main }}
+               MACRO_AT_func { main }
            }
        }
     }
index e5334f2355d8c5579bf2000ae2006b010e86b226..8c60d031e821b68180c2b5cd583403731cb34c13 100644 (file)
@@ -30,57 +30,57 @@ Dwarf::assemble $asm_file {
            declare_labels i64_type i32_type i64_array i32_array
 
            i64_type: base_type {
-               {name "int64_t"}
-               {encoding @DW_ATE_signed}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name "int64_t"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 8 DW_FORM_sdata
            }
 
            i32_type: base_type {
-               {name "int32_t"}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name "int32_t"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            i64_array: DW_TAG_array_type {
-               {DW_AT_name array_type}
-               {DW_AT_type :$i64_type}
+               DW_AT_name array_type
+               DW_AT_type :$i64_type
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$i64_type}
-                   {DW_AT_lower_bound 0 DW_FORM_data1}
-                   {DW_AT_upper_bound 3 DW_FORM_data1}
+                   DW_AT_type        :$i64_type
+                   DW_AT_lower_bound 0 DW_FORM_data1
+                   DW_AT_upper_bound 3 DW_FORM_data1
                }
            }
 
            i32_array: DW_TAG_array_type {
-               {DW_AT_name array_type}
-               {DW_AT_type :$i32_type}
+               DW_AT_name array_type
+               DW_AT_type :$i32_type
            } {
                DW_TAG_subrange_type {
-                   {DW_AT_type        :$i32_type}
-                   {DW_AT_lower_bound 0 DW_FORM_data1}
-                   {DW_AT_upper_bound 3 DW_FORM_data1}
+                   DW_AT_type        :$i32_type
+                   DW_AT_lower_bound 0 DW_FORM_data1
+                   DW_AT_upper_bound 3 DW_FORM_data1
                }
            }
 
            DW_TAG_variable {
-               {name i64_noptr}
-               {type :$i64_array}
-               {location {
+               DW_AT_name i64_noptr
+               DW_AT_type :$i64_array
+               DW_AT_location [subst {
                    DW_OP_constu $::c64
                    DW_OP_stack_value
                    DW_OP_piece 8
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {name i32_noptr}
-               {type :$i32_array}
-               {location {
+               DW_AT_name i32_noptr
+               DW_AT_type :$i32_array
+               DW_AT_location [subst {
                    DW_OP_constu $::c32
                    DW_OP_stack_value
                    DW_OP_piece 4
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            }
        }
     }
index 0545b352f058b284dda7eef52cb2d33103077e94..d6cb4c12705cd291f371f7fccb89e9c9cb5f6df7 100644 (file)
@@ -49,14 +49,14 @@ foreach_with_prefix is_64 {false true} {
            is_64 $is_64
        } {
            DW_TAG_compile_unit {
-               {DW_AT_ranges 1 DW_FORM_rnglistx}
-               {DW_AT_rnglists_base cu_table DW_FORM_sec_offset}
+               DW_AT_ranges 1 DW_FORM_rnglistx
+               DW_AT_rnglists_base cu_table DW_FORM_sec_offset
            } {
                # This tests a DW_AT_ranges attribute of form DW_FORM_rnglistx on a
                # function, which was buggy at some point.
                DW_TAG_subprogram {
-                   {DW_AT_name "foo"}
-                   {DW_AT_ranges 2 DW_FORM_rnglistx}
+                   DW_AT_name "foo"
+                   DW_AT_ranges 2 DW_FORM_rnglistx
                }
            }
        }
index 7c65dcd776802620279a16d72415de4a9eb8dff0..5b12ae4b6cc0b77e2e0afa57c67962bcf4d24d5a 100644 (file)
@@ -43,11 +43,11 @@ foreach_with_prefix is_64 {false true} {
            is_64 $is_64
        } {
            DW_TAG_compile_unit {
-               {DW_AT_ranges $cu1_range_list DW_FORM_sec_offset}
+               DW_AT_ranges $cu1_range_list DW_FORM_sec_offset
            } {
                DW_TAG_subprogram {
-                   {DW_AT_name "foo"}
-                   {DW_AT_ranges $foo_range_list DW_FORM_sec_offset}
+                   DW_AT_name "foo"
+                   DW_AT_ranges $foo_range_list DW_FORM_sec_offset
                }
            }
        }
@@ -61,12 +61,12 @@ foreach_with_prefix is_64 {false true} {
            is_64 $is_64
        } {
            DW_TAG_compile_unit {
-               {DW_AT_ranges $cu2_range_list DW_FORM_sec_offset}
-               {DW_AT_rnglists_base cu2_table DW_FORM_sec_offset}
+               DW_AT_ranges $cu2_range_list DW_FORM_sec_offset
+               DW_AT_rnglists_base cu2_table DW_FORM_sec_offset
            } {
                DW_TAG_subprogram {
-                   {DW_AT_name "bar"}
-                   {DW_AT_ranges $bar_range_list DW_FORM_sec_offset}
+                   DW_AT_name "bar"
+                   DW_AT_ranges $bar_range_list DW_FORM_sec_offset
                }
            }
        }
@@ -79,11 +79,11 @@ foreach_with_prefix is_64 {false true} {
            is_64 $is_64
        } {
            DW_TAG_compile_unit {
-               {DW_AT_ranges $cu3_range_list DW_FORM_sec_offset}
+               DW_AT_ranges $cu3_range_list DW_FORM_sec_offset
            } {
                DW_TAG_subprogram {
-                   {DW_AT_name "baz"}
-                   {DW_AT_ranges $baz_range_list DW_FORM_sec_offset}
+                   DW_AT_name "baz"
+                   DW_AT_ranges $baz_range_list DW_FORM_sec_offset
                }
            }
        }
index 89d4a16eb1be0958df2f8966d72247f4764ddb86..87e710efd5c46ecd746f681f6176e9055ef29295 100644 (file)
@@ -30,64 +30,64 @@ Dwarf::assemble $asm_file {
 
     cu { addr_size 4 } {
        compile_unit {
-           {name file1.txt}
-           {language @DW_LANG_Rust}
+           DW_AT_name file1.txt
+           DW_AT_language @DW_LANG_Rust
        } {
            uinteger_label: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_unsigned}
-               {DW_AT_name      {unsigned integer}}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding   @DW_ATE_unsigned
+               DW_AT_name       {unsigned integer}
            }
 
            one_label: structure_type {
-               {name One}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name One
+               DW_AT_byte_size 1 DW_FORM_sdata
            } {
                member {
-                   {name __0}
-                   {type :$uinteger_label}
-                   {data_member_location 0 data1}
+                   DW_AT_name __0
+                   DW_AT_type :$uinteger_label
+                   DW_AT_data_member_location 0 data1
                }
            }
 
            two_label: structure_type {
-               {name Two}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name Two
+               DW_AT_byte_size 1 DW_FORM_sdata
            } {
                member {
-                   {name __0}
-                   {type :$uinteger_label}
-                   {data_member_location 0 data1}
+                   DW_AT_name __0
+                   DW_AT_type :$uinteger_label
+                   DW_AT_data_member_location 0 data1
                }
            }
 
            simple_label: structure_type {
-               {name Simple}
-               {byte_size 2 DW_FORM_sdata}
+               DW_AT_name Simple
+               DW_AT_byte_size 2 DW_FORM_sdata
            } {
                variant_part {
-                   {discr :$discr_1_label DW_FORM_ref4}
+                   DW_AT_discr :$discr_1_label DW_FORM_ref4
                } {
                    discr_1_label: member {
-                       {type :$uinteger_label}
-                       {data_member_location 0 data1}
-                       {artificial 1 DW_FORM_flag_present}
+                       DW_AT_type :$uinteger_label
+                       DW_AT_data_member_location 0 data1
+                       DW_AT_artificial 1 DW_FORM_flag_present
                    }
 
                    variant {
-                       {discr_value 65 udata}
+                       DW_AT_discr_value 65 udata
                    } {
                        member {
-                           {type :$one_label}
-                           {data_member_location 1 data1}
+                           DW_AT_type :$one_label
+                           DW_AT_data_member_location 1 data1
                        }
                    }
 
                    variant {
                    } {
                        member {
-                           {type :$two_label}
-                           {data_member_location 1 data1}
+                           DW_AT_type :$two_label
+                           DW_AT_data_member_location 1 data1
                        }
                    }
                }
@@ -96,14 +96,14 @@ Dwarf::assemble $asm_file {
            # In PR rust/31005, a constant Rust enum value could not
            # be correctly resolved.
            DW_TAG_variable {
-               {name constant_variable}
-               {const_value 0x4141 udata}
-               {type :$simple_label}
+               DW_AT_name constant_variable
+               DW_AT_const_value 0x4141 udata
+               DW_AT_type :$simple_label
            }
            DW_TAG_variable {
-               {name constant_variable2}
-               {const_value "AA" DW_FORM_block1}
-               {type :$simple_label}
+               DW_AT_name constant_variable2
+               DW_AT_const_value "AA" DW_FORM_block1
+               DW_AT_type :$simple_label
            }
        }
     }
index 213662341e04149dd86080bad95b81c60e2cb04c..3d6c8531635f72617a023897b9573815f14225e8 100644 (file)
@@ -26,12 +26,14 @@ standard_testfile main.c .S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       compile_unit {{language @DW_LANG_C_plus_plus}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C_plus_plus
+       } {
            # Check handling of self-referencing DIE.
            declare_labels c1
            c1: class_type {
-               {name class1}
-               {specification :$c1}
+               DW_AT_name class1
+               DW_AT_specification :$c1
            }
 
            # Check handling of self-referencing child DIE.  Regression test
@@ -39,11 +41,11 @@ Dwarf::assemble $asm_file {
            declare_labels f1 abstract_f1 f1_l
            abstract_f1: subprogram {}
            f1: subprogram {
-               {MACRO_AT_func {main}}
-               {abstract_origin :$abstract_f1}
+               MACRO_AT_func {main}
+               DW_AT_abstract_origin :$abstract_f1
            } {
                f1_l: label {
-                   {abstract_origin :$f1_l}
+                   DW_AT_abstract_origin :$f1_l
                }
            }
        }
index 51c6cef94618b7b5fa8d49b1beecfdfff19bcc22..439b2b24a9f4a4c05d2af25508c041b788227845 100644 (file)
@@ -50,17 +50,19 @@ proc run_test { buildid } {
        build_id $buildid
 
        cu { label cu_start } {
-           compile_unit {{language @DW_LANG_C}} {
+           compile_unit {
+               DW_AT_language @DW_LANG_C
+           } {
                int_label2: base_type {
-                   {name int}
-                   {byte_size 4 sdata}
-                   {encoding @DW_ATE_signed}
+                   DW_AT_name int
+                   DW_AT_byte_size 4 sdata
+                   DW_AT_encoding @DW_ATE_signed
                }
 
                constant {
-                   {name the_int}
-                   {type :$int_label2}
-                   {const_value 99 data1}
+                   DW_AT_name the_int
+                   DW_AT_type :$int_label2
+                   DW_AT_const_value 99 data1
                }
            }
        }
index c9bf490e5ca5ce20d57e40ed1982e4116f9f1896..64d5b55fa1c12c5ddf6d61bcda715b8b16788df0 100644 (file)
@@ -30,90 +30,90 @@ Dwarf::assemble $asm_file {
            declare_labels int_label ushort_label struct_label struct_label_2
 
            int_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_name "myint"}
+               DW_AT_byte_size 4 DW_FORM_udata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "myint"
            }
            ushort_label: DW_TAG_base_type {
-               {DW_AT_byte_size 2 DW_FORM_udata}
-               {DW_AT_encoding @DW_ATE_unsigned}
-               {DW_AT_name "myushort"}
+               DW_AT_byte_size 2 DW_FORM_udata
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_name "myushort"
            }
 
            struct_label: DW_TAG_structure_type {
-               {DW_AT_name "S"}
-               {DW_AT_byte_size 8 DW_FORM_udata}
+               DW_AT_name "S"
+               DW_AT_byte_size 8 DW_FORM_udata
            } {
                DW_TAG_member {
-                   {DW_AT_name "a"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_data_member_location 0 DW_FORM_udata}
+                   DW_AT_name "a"
+                   DW_AT_type :${int_label}
+                   DW_AT_data_member_location 0 DW_FORM_udata
                }
 
                DW_TAG_member {
-                   {DW_AT_name "b"}
-                   {DW_AT_type :${ushort_label}}
-                   {DW_AT_data_member_location 4 DW_FORM_udata}
+                   DW_AT_name "b"
+                   DW_AT_type :${ushort_label}
+                   DW_AT_data_member_location 4 DW_FORM_udata
                }
            }
 
            struct_label_2: DW_TAG_structure_type {
-               {DW_AT_name "S_2"}
-               {DW_AT_byte_size 6 DW_FORM_udata}
+               DW_AT_name "S_2"
+               DW_AT_byte_size 6 DW_FORM_udata
            } {
                DW_TAG_member {
-                   {DW_AT_name "a"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_data_member_location 0 DW_FORM_udata}
+                   DW_AT_name "a"
+                   DW_AT_type :${int_label}
+                   DW_AT_data_member_location 0 DW_FORM_udata
                }
 
                DW_TAG_member {
-                   {DW_AT_name "b"}
-                   {DW_AT_type :${ushort_label}}
-                   {DW_AT_data_member_location 4 DW_FORM_udata}
+                   DW_AT_name "b"
+                   DW_AT_type :${ushort_label}
+                   DW_AT_data_member_location 4 DW_FORM_udata
                }
            }
 
            DW_TAG_variable {
-               {DW_AT_name "s1"}
-               {DW_AT_type :${struct_label}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {
+               DW_AT_name "s1"
+               DW_AT_type :${struct_label}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location {
                    DW_OP_constu 1
                    DW_OP_stack_value
                    DW_OP_piece 4
                    DW_OP_constu 0
                    DW_OP_stack_value
                    DW_OP_piece 2
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name "s2"}
-               {DW_AT_type :${struct_label}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {
+               DW_AT_name "s2"
+               DW_AT_type :${struct_label}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location {
                    DW_OP_constu 1
                    DW_OP_stack_value
                    DW_OP_piece 4
                    DW_OP_constu 0
                    DW_OP_stack_value
                    DW_OP_piece 8
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name "s3"}
-               {DW_AT_type :${struct_label_2}}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {
+               DW_AT_name "s3"
+               DW_AT_type :${struct_label_2}
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location {
                    DW_OP_constu 0
                    DW_OP_stack_value
                    DW_OP_piece 4
                    DW_OP_constu 1
                    DW_OP_stack_value
                    DW_OP_piece 2
-               } SPECIAL_expr}
+               } SPECIAL_expr
            }
        }
     }
index 6be8283985712f2188e607cf29311495cc59d7a1..8b139fae9bce4e596740918831abf460750ceb4d 100644 (file)
@@ -28,21 +28,19 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {
-               language @DW_LANG_C
-           }
+           DW_AT_language @DW_LANG_C
        } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
            }
 
            DW_TAG_variable {
-               {name var}
-               {type :$integer_label}
+               DW_AT_name var
+               DW_AT_type :$integer_label
            }
        }
     }
index e04c50082f7b6dbc7c3840272685050aa484f92e..9fa1a2b1c0ded4593274ca3687ddfd2a63491f07 100644 (file)
@@ -25,18 +25,20 @@ standard_testfile main.c -dw.S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       compile_unit {{language @DW_LANG_C_plus_plus}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C_plus_plus
+       } {
            structure_type {
-               {name S}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name S
+               DW_AT_byte_size 1 DW_FORM_sdata
            } {
                subprogram {
-                   {low_pc 0x1000 addr}
-                   {high_pc 0x2000 addr}
-                   {name ~S}
-                   {external 1 flag}
-                   {virtuality @DW_VIRTUALITY_virtual}
-                   {vtable_elem_location {const1u 1} SPECIAL_expr}
+                   DW_AT_low_pc 0x1000 addr
+                   DW_AT_high_pc 0x2000 addr
+                   DW_AT_name ~S
+                   DW_AT_external 1 flag
+                   DW_AT_virtuality @DW_VIRTUALITY_virtual
+                   DW_AT_vtable_elem_location {const1u 1} SPECIAL_expr
                }
            }
        }
index e3892162cc01eb103f39313090270e7bf6509ca9..bc857a7e378d128870a79b7d8e27fcdfe51a231b 100644 (file)
@@ -30,9 +30,9 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
-           {DW_AT_name     $srcfile}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C_plus_plus
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
 
        } {
            declare_labels origin
@@ -42,14 +42,14 @@ Dwarf::assemble $asm_file {
            # which meant that if a method referred back to them via a
            # specification, it would get the wrong name.
            DW_TAG_structure_type {
-               {DW_AT_byte_size 8 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name the_type}
-               {DW_AT_declaration 1 DW_FORM_flag_present}
+               DW_AT_byte_size 8 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name the_type
+               DW_AT_declaration 1 DW_FORM_flag_present
            } {
                origin: DW_TAG_subprogram {
-                   {DW_AT_name "method"}
-                   {DW_AT_declaration 1 DW_FORM_flag_present}
+                   DW_AT_name "method"
+                   DW_AT_declaration 1 DW_FORM_flag_present
                }
            }
 
@@ -57,8 +57,8 @@ Dwarf::assemble $asm_file {
            # range that is valid in the program, so we use the main
            # function's range.
            DW_TAG_subprogram {
-               {DW_AT_specification :$origin}
-               {MACRO_AT_range main}
+               DW_AT_specification :$origin
+               MACRO_AT_range main
            }
        }
     }
index 02a492d3a81c58467c70c0b31552126e53b15f5c..a52726301746497b5455781cf790f631cda2129d 100644 (file)
@@ -34,18 +34,18 @@ Dwarf::assemble $asm_file {
            declare_labels int_type
 
            the_type_i: structure_type {
-               {name s}
-               {byte_size 4 sdata}
+               DW_AT_name s
+               DW_AT_byte_size 4 sdata
            } {
                member {
-                   {name i}
-                   {type :$int_type}
+                   DW_AT_name i
+                   DW_AT_type :$int_type
                }
            }
            int_type: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 sdata
            }
        }
     }
@@ -55,18 +55,18 @@ Dwarf::assemble $asm_file {
            declare_labels int_type
 
            the_type_j: structure_type {
-               {name s}
-               {byte_size 4 sdata}
+               DW_AT_name s
+               DW_AT_byte_size 4 sdata
            } {
                member {
-                   {name j}
-                   {type :$int_type}
+                   DW_AT_name j
+                   DW_AT_type :$int_type
                }
            }
            int_type: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 sdata
            }
        }
     }
@@ -88,32 +88,32 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name main.c}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name main.c
        } {
            structure_type {
-               {name s}
-               {signature 0x0000000000000001 ref_sig8}
-               {declaration 1 flag}
+               DW_AT_name s
+               DW_AT_signature 0x0000000000000001 ref_sig8
+               DW_AT_declaration 1 flag
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
+               MACRO_AT_func {main}
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     foo.c}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     foo.c
        } {
            structure_type {
-               {name s}
-               {signature 0x0000000000000002 ref_sig8}
-               {declaration 1 flag}
+               DW_AT_name s
+               DW_AT_signature 0x0000000000000002 ref_sig8
+               DW_AT_declaration 1 flag
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {foo}}
+               MACRO_AT_func {foo}
            }
        }
     }
index 98613270e08a48c7063a374241959c7a87c89f62..7e159998f0c69995114a48270ed1fb0c2a34a4e8 100644 (file)
@@ -24,32 +24,32 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name main.c}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name main.c
        } {
            structure_type {
-               {name s}
-               {signature 0x0000000000000001 ref_sig8}
-               {declaration 1 flag}
+               DW_AT_name s
+               DW_AT_signature 0x0000000000000001 ref_sig8
+               DW_AT_declaration 1 flag
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
+               MACRO_AT_func {main}
            }
        }
     }
 
     cu {} {
        compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name     foo.c}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     foo.c
        } {
            structure_type {
-               {name s}
-               {signature 0x0000000000000002 ref_sig8}
-               {declaration 1 flag}
+               DW_AT_name s
+               DW_AT_signature 0x0000000000000002 ref_sig8
+               DW_AT_declaration 1 flag
            }
            DW_TAG_subprogram {
-               {MACRO_AT_func {foo}}
+               MACRO_AT_func {foo}
            }
        }
     }
@@ -59,18 +59,18 @@ Dwarf::assemble $asm_file {
            declare_labels int_type
 
            the_type_i: structure_type {
-               {name s}
-               {byte_size 4 sdata}
+               DW_AT_name s
+               DW_AT_byte_size 4 sdata
            } {
                member {
-                   {name i}
-                   {type :$int_type}
+                   DW_AT_name i
+                   DW_AT_type :$int_type
                }
            }
            int_type: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 sdata
            }
        }
     }
@@ -80,18 +80,18 @@ Dwarf::assemble $asm_file {
            declare_labels int_type
 
            the_type_j: structure_type {
-               {name s}
-               {byte_size 4 sdata}
+               DW_AT_name s
+               DW_AT_byte_size 4 sdata
            } {
                member {
-                   {name j}
-                   {type :$int_type}
+                   DW_AT_name j
+                   DW_AT_type :$int_type
                }
            }
            int_type: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 sdata
            }
        }
     }
index 9df5774bba5460966d84948d13e0c8b0034cb0f5..339cb492fa63a4cc6108313a7e1fa6e7c1d06b7d 100644 (file)
@@ -26,43 +26,45 @@ standard_testfile main.c -dw.S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            declare_labels integer_label enum_label subrange_label
 
-            integer_label: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      integer}
-            }
+           integer_label: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      integer
+           }
 
            enum_label: DW_TAG_enumeration_type {
-               {DW_AT_name E}
-               {DW_AT_type :$integer_label}
+               DW_AT_name E
+               DW_AT_type :$integer_label
            } {
                DW_TAG_enumerator {
-                   {DW_AT_name ONE}
-                   {DW_AT_const_value 1 DW_FORM_sdata}
+                   DW_AT_name ONE
+                   DW_AT_const_value 1 DW_FORM_sdata
                }
                DW_TAG_enumerator {
-                   {DW_AT_name TWO}
-                   {DW_AT_const_value 2 DW_FORM_sdata}
+                   DW_AT_name TWO
+                   DW_AT_const_value 2 DW_FORM_sdata
                }
                DW_TAG_enumerator {
-                   {DW_AT_name THREE}
-                   {DW_AT_const_value 3 DW_FORM_sdata}
+                   DW_AT_name THREE
+                   DW_AT_const_value 3 DW_FORM_sdata
                }
            }
 
            subrange_label: DW_TAG_subrange_type {
-               {lower_bound 1 DW_FORM_sdata}
-               {upper_bound 2 DW_FORM_sdata}
-               {type :$enum_label}
+               DW_AT_lower_bound 1 DW_FORM_sdata
+               DW_AT_upper_bound 2 DW_FORM_sdata
+               DW_AT_type :$enum_label
            }
 
            DW_TAG_variable {
-               {name rangeval}
-               {type :$subrange_label}
-               {const_value 2 DW_FORM_udata}
+               DW_AT_name rangeval
+               DW_AT_type :$subrange_label
+               DW_AT_const_value 2 DW_FORM_udata
            }
        }
     }
index 2cc747248844aac3fc143adcffdf8b44fc103317..3e0326fc8e2714b76107c8425d6fe31ea3691ff6 100644 (file)
@@ -25,35 +25,37 @@ standard_testfile method-ptr.cc -dw.S
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
-       compile_unit {{language @DW_LANG_Pascal83}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_Pascal83
+       } {
            declare_labels byte_label typedef_label array_label
 
            # A subrange's underlying type that is a typedef.
            byte_label: base_type {
-               {name byte}
-               {encoding @DW_ATE_unsigned}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name byte
+               DW_AT_encoding @DW_ATE_unsigned
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            typedef_label: typedef {
-               {name byte_typedef}
-               {type :$byte_label}
+               DW_AT_name byte_typedef
+               DW_AT_type :$byte_label
            }
 
            array_label: array_type {
-               {type :$byte_label}
+               DW_AT_type :$byte_label
            } {
                subrange_type {
-                   {lower_bound 0 DW_FORM_sdata}
-                   {upper_bound 191 DW_FORM_sdata}
-                   {byte_stride 2 DW_FORM_sdata}
-                   {type :$typedef_label}
+                   DW_AT_lower_bound 0 DW_FORM_sdata
+                   DW_AT_upper_bound 191 DW_FORM_sdata
+                   DW_AT_byte_stride 2 DW_FORM_sdata
+                   DW_AT_type :$typedef_label
                }
            }
 
            typedef {
-               {name TByteArray}
-               {type :$array_label}
+               DW_AT_name TByteArray
+               DW_AT_type :$array_label
            }
 
            # This subrange's underlying type is signed, but the bounds are
@@ -61,21 +63,21 @@ Dwarf::assemble $asm_file {
            declare_labels signed_byte_label subrange_with_buggy_negative_bounds_label
 
            signed_byte_label: base_type {
-               {name signed_byte}
-               {encoding @DW_ATE_signed}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name signed_byte
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            # The bounds mean -16 to -12.
            subrange_with_buggy_negative_bounds_label: subrange_type {
-               {lower_bound 0xf0 DW_FORM_udata}
-               {upper_bound 0xf4 DW_FORM_udata}
-               {type :$signed_byte_label}
+               DW_AT_lower_bound 0xf0 DW_FORM_udata
+               DW_AT_upper_bound 0xf4 DW_FORM_udata
+               DW_AT_type :$signed_byte_label
            }
 
            DW_TAG_variable {
-               {name subrange_with_buggy_negative_bounds_variable}
-               {type :$subrange_with_buggy_negative_bounds_label}
+               DW_AT_name subrange_with_buggy_negative_bounds_variable
+               DW_AT_type :$subrange_with_buggy_negative_bounds_label
            }
 
            # This subrange's base type is 16-bytes long (although the bounds fit in
@@ -83,19 +85,19 @@ Dwarf::assemble $asm_file {
            declare_labels a_16_byte_integer_label a_16_byte_subrange_label
 
            a_16_byte_integer_label: base_type {
-               {byte_size 16 udata}
-               {encoding @DW_ATE_signed}
+               DW_AT_byte_size 16 udata
+               DW_AT_encoding @DW_ATE_signed
            }
 
            a_16_byte_subrange_label: subrange_type {
-               {lower_bound -9223372036854775808 DW_FORM_sdata}
-               {upper_bound 9223372036854775807 DW_FORM_sdata}
-               {type :$a_16_byte_integer_label}
+               DW_AT_lower_bound -9223372036854775808 DW_FORM_sdata
+               DW_AT_upper_bound 9223372036854775807 DW_FORM_sdata
+               DW_AT_type :$a_16_byte_integer_label
            }
 
            DW_TAG_variable {
-               {name a_16_byte_subrange_variable}
-               {type :$a_16_byte_subrange_label}
+               DW_AT_name a_16_byte_subrange_variable
+               DW_AT_type :$a_16_byte_subrange_label
            }
        }
     }
index e69d9b433a2016ee63ecbce2e3e43b0e2cfe056d..6efd4589930815b15a65232f2a46afd06c3aa9fd 100644 (file)
@@ -63,23 +63,23 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_name symbol_needs_eval.c}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_name symbol_needs_eval.c
+           DW_AT_comp_dir /tmp
        } {
            declare_labels int_type_label
 
            # define int type
            int_type_label: DW_TAG_base_type {
-               {DW_AT_name "int"}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
+               DW_AT_name "int"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size $int_size DW_FORM_sdata
            }
 
            # define artificial variable a
            DW_TAG_variable {
-               {DW_AT_name a}
-               {DW_AT_type :$int_type_label}
-               {DW_AT_location {
+               DW_AT_name a
+               DW_AT_type :$int_type_label
+               DW_AT_location [subst {
                    DW_OP_addr $exec_mask_var
                    DW_OP_deref_size $int_size
 
@@ -91,8 +91,8 @@ Dwarf::assemble $asm_file {
                    DW_OP_skip 3
                    DW_OP_bregx $dwarf_regnum 0
                    DW_OP_stack_value
-               } SPECIAL_expr}
-               {external 1 flag}
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
            }
        }
     }
index a6773d59ad1936ab6f69c421453681930f1e6327..61a40eb56b90b52a61f50cb540b7a627e3928e6d 100644 (file)
@@ -63,40 +63,40 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_name symbol_needs_eval.c}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_name symbol_needs_eval.c
+           DW_AT_comp_dir /tmp
        } {
            declare_labels int_type_label
 
            # define int type
            int_type_label: DW_TAG_base_type {
-               {DW_AT_name "int"}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_byte_size $int_size DW_FORM_sdata}
+               DW_AT_name "int"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size $int_size DW_FORM_sdata
            }
 
            # add info for variable exec_mask
            DW_TAG_variable {
-               {DW_AT_name exec_mask}
-               {DW_AT_type :$int_type_label}
-               {DW_AT_location {
+               DW_AT_name exec_mask
+               DW_AT_type :$int_type_label
+               DW_AT_location [subst {
                    DW_OP_addr $exec_mask_var
-               } SPECIAL_expr}
-               {external 1 flag}
+               }] SPECIAL_expr
+               DW_AT_external 1 flag
            }
 
            # add info for subprogram main
            DW_TAG_subprogram {
-               {MACRO_AT_func { main }}
-               {DW_AT_frame_base {
+               MACRO_AT_func { main }
+               DW_AT_frame_base [subst {
                    DW_OP_regx $dwarf_regnum
-               } SPECIAL_expr}
+               }] SPECIAL_expr
            } {
                # define artificial variable a
                DW_TAG_variable {
-                   {DW_AT_name a}
-                   {DW_AT_type :$int_type_label}
-                   {DW_AT_location {
+                   DW_AT_name a
+                   DW_AT_type :$int_type_label
+                   DW_AT_location [subst {
                        DW_OP_lit1
                        DW_OP_addr $exec_mask_var
                        DW_OP_deref_size $int_size
@@ -112,8 +112,8 @@ Dwarf::assemble $asm_file {
                        # conditional jump to DW_OP_drop
                        DW_OP_bra -9
                        DW_OP_stack_value
-                   } SPECIAL_expr}
-                   {external 1 flag}
+                   }] SPECIAL_expr
+                   DW_AT_external 1 flag
                }
            }
        }
index 1734a779d8be6b7ab3efd94db6732386446b49c0..2826ba790ef5076aab80baf0092231ba0fbac435 100644 (file)
@@ -26,46 +26,46 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_producer "ACME Compiler Company"}
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name symtab-producer-dw.c}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_producer "ACME Compiler Company"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name symtab-producer-dw.c
+           DW_AT_comp_dir /tmp
         } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name integer
            }
 
            DW_TAG_variable {
-               {DW_AT_name with_producer}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_const_value 42 DW_FORM_sdata}
+               DW_AT_name with_producer
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_const_value 42 DW_FORM_sdata
            }
        }
     }
     cu {} {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C}
-           {DW_AT_name symtab-producer2-dw.c}
-           {DW_AT_comp_dir /tmp}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name symtab-producer2-dw.c
+           DW_AT_comp_dir /tmp
         } {
            declare_labels integer_label
 
            integer_label: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding @DW_ATE_signed}
-               {DW_AT_name integer}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_name integer
            }
 
            DW_TAG_variable {
-               {DW_AT_name without_producer}
-               {DW_AT_type :$integer_label}
-               {DW_AT_external 1 flag}
-               {DW_AT_const_value 43 DW_FORM_sdata}
+               DW_AT_name without_producer
+               DW_AT_type :$integer_label
+               DW_AT_external 1 flag
+               DW_AT_const_value 43 DW_FORM_sdata
            }
        }
     }
index 60b49a5bbc88f932635a5a9de84c97c1d11f707f..52d9b32a593e2f990745c62f56c1b5c5892a7605 100644 (file)
@@ -35,19 +35,19 @@ Dwarf::assemble $asm_file {
 
     cu { label cu_start } {
        DW_TAG_compile_unit {
-           {DW_AT_language @DW_LANG_C_plus_plus}
+           DW_AT_language @DW_LANG_C_plus_plus
         } {
            declare_labels templated_subprogram int
 
            int: DW_TAG_base_type {
-               {DW_AT_name "int"}
-               {DW_AT_byte_size 4 DW_FORM_data1}
-               {DW_AT_encoding @DW_ATE_signed}
+               DW_AT_name "int"
+               DW_AT_byte_size 4 DW_FORM_data1
+               DW_AT_encoding @DW_ATE_signed
            }
 
            # The templated subprogram.
            templated_subprogram: DW_TAG_subprogram {
-               {DW_AT_name "apply"}
+               DW_AT_name "apply"
            }
 
            # The template specialization.
@@ -55,12 +55,12 @@ Dwarf::assemble $asm_file {
            # The low and high PC are phony: we just need an address range that
            # is valid in the program, so we use the main function's range.
            DW_TAG_subprogram {
-               {DW_AT_specification :$templated_subprogram}
-               {MACRO_AT_range main}
+               DW_AT_specification :$templated_subprogram
+               MACRO_AT_range main
            } {
                DW_TAG_template_type_param {
-                 {DW_AT_name "T"}
-                 {DW_AT_type :$int DW_FORM_ref4}
+                 DW_AT_name "T"
+                 DW_AT_type :$int DW_FORM_ref4
                }
            }
        }
index e59286d0d33ee430174be3bd417001705aa519e7..a96c1acb332b84e7e25fa58a09311e0eb5b63a90 100644 (file)
@@ -31,29 +31,29 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_producer "GNU C 8.1"}
-                {DW_AT_language @DW_LANG_C}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+           DW_AT_producer "GNU C 8.1"
+           DW_AT_language @DW_LANG_C
+           DW_AT_name     $srcfile
+           DW_AT_comp_dir /tmp
+       } {
            declare_labels main_type void_typedef
 
            main_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
            }
 
            void_typedef: DW_TAG_typedef {
-               {name foo}
+               DW_AT_name foo
            }
 
-            DW_TAG_subprogram {
-                {MACRO_AT_func {func}}
-                {type :$void_typedef}
+           DW_TAG_subprogram {
+               MACRO_AT_func {func}
+               DW_AT_type :$void_typedef
            }
-            DW_TAG_subprogram {
-                {MACRO_AT_func {main}}
-                {type :$main_type}
+           DW_TAG_subprogram {
+               MACRO_AT_func {main}
+               DW_AT_type :$main_type
            }
        }
     }
index 3380f8d1ce2a666511cf2530795c6b728f665d9f..9ab9bf581f71561c3e7c469574e7a3923c55c7e5 100644 (file)
@@ -34,19 +34,19 @@ Dwarf::assemble $asm_file {
     # both 32- and 64-bit machines.
     cu { addr_size 4 } {
        compile_unit {
-           {name file1.txt}
-           {language @DW_LANG_Rust}
+           DW_AT_name file1.txt
+           DW_AT_language @DW_LANG_Rust
        } {
-            char_label: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding @DW_ATE_UTF}
-                {DW_AT_name char}
-            }
+           char_label: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_UTF
+               DW_AT_name char
+           }
 
            DW_TAG_variable {
-               {name cvalue}
-               {type :$char_label}
-               {const_value 97 DW_FORM_udata}
+               DW_AT_name cvalue
+               DW_AT_type :$char_label
+               DW_AT_const_value 97 DW_FORM_udata
            }
        }
     }
index 347d27676565dd4e78a883066c9e2a04660d06d6..6889cc203e0f82baa923ee4c8713bece0f027905 100644 (file)
@@ -54,8 +54,8 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_name $srcfile}
-               {DW_AT_comp_dir /tmp}
+           DW_AT_name $srcfile
+           DW_AT_comp_dir /tmp
        } {
            declare_labels char_type_label
            declare_labels int_type_label short_type_label
@@ -64,131 +64,131 @@ Dwarf::assemble $asm_file {
 
            # char
            char_type_label: base_type {
-               {name "char"}
-               {encoding @DW_ATE_unsigned_char}
-               {byte_size 1 DW_FORM_sdata}
+               DW_AT_name "char"
+               DW_AT_encoding @DW_ATE_unsigned_char
+               DW_AT_byte_size 1 DW_FORM_sdata
            }
 
            # int
            int_type_label: base_type {
-               {name "int"}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name "int"
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            # char [8]
            array_a8_label: array_type {
-               {type :$char_type_label}
+               DW_AT_type :$char_type_label
            } {
                subrange_type {
-                   {type :$int_type_label}
-                   {upper_bound 7 DW_FORM_udata}
+                   DW_AT_type :$int_type_label
+                   DW_AT_upper_bound 7 DW_FORM_udata
                }
            }
 
            # struct s { char a, b, c, d; };
            struct_s_label: structure_type {
-               {name "s"}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name "s"
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                member {
-                   {name "a"}
-                   {type :$char_type_label}
-                   {data_member_location 0 DW_FORM_udata}
+                   DW_AT_name "a"
+                   DW_AT_type :$char_type_label
+                   DW_AT_data_member_location 0 DW_FORM_udata
                }
                member {
-                   {name "b"}
-                   {type :$char_type_label}
-                   {data_member_location 1 DW_FORM_udata}
+                   DW_AT_name "b"
+                   DW_AT_type :$char_type_label
+                   DW_AT_data_member_location 1 DW_FORM_udata
                }
                member {
-                   {name "c"}
-                   {type :$char_type_label}
-                   {data_member_location 2 DW_FORM_udata}
+                   DW_AT_name "c"
+                   DW_AT_type :$char_type_label
+                   DW_AT_data_member_location 2 DW_FORM_udata
                }
                member {
-                   {name "d"}
-                   {type :$char_type_label}
-                   {data_member_location 3 DW_FORM_udata}
+                   DW_AT_name "d"
+                   DW_AT_type :$char_type_label
+                   DW_AT_data_member_location 3 DW_FORM_udata
                }
            }
 
            # struct t { int u, x:9, y:13, z:10; };
            struct_t_label: structure_type {
-               {name "t"}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name "t"
+               DW_AT_byte_size 8 DW_FORM_sdata
            } {
                member {
-                   {name "u"}
-                   {type :$int_type_label}
+                   DW_AT_name "u"
+                   DW_AT_type :$int_type_label
                }
                member {
-                   {name "x"}
-                   {type :$int_type_label}
-                   {data_member_location 4 DW_FORM_udata}
-                   {bit_size 9 DW_FORM_udata}
+                   DW_AT_name "x"
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_member_location 4 DW_FORM_udata
+                   DW_AT_bit_size 9 DW_FORM_udata
                }
                member {
-                   {name "y"}
-                   {type :$int_type_label}
-                   {data_bit_offset 41 DW_FORM_udata}
-                   {bit_size 13 DW_FORM_udata}
+                   DW_AT_name "y"
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_bit_offset 41 DW_FORM_udata
+                   DW_AT_bit_size 13 DW_FORM_udata
                }
                member {
-                   {name "z"}
-                   {type :$int_type_label}
-                   {data_bit_offset 54 DW_FORM_udata}
-                   {bit_size 10 DW_FORM_udata}
+                   DW_AT_name "z"
+                   DW_AT_type :$int_type_label
+                   DW_AT_data_bit_offset 54 DW_FORM_udata
+                   DW_AT_bit_size 10 DW_FORM_udata
                }
            }
 
            # struct st { struct s s; struct t t; };
            struct_st_label: structure_type {
-               {name "st"}
-               {byte_size 12 DW_FORM_udata}
+               DW_AT_name "st"
+               DW_AT_byte_size 12 DW_FORM_udata
            } {
                member {
-                   {name "s"}
-                   {type :$struct_s_label}
+                   DW_AT_name "s"
+                   DW_AT_type :$struct_s_label
                }
                member {
-                   {name "t"}
-                   {type :$struct_t_label}
-                   {data_member_location 4 DW_FORM_udata}
+                   DW_AT_name "t"
+                   DW_AT_type :$struct_t_label
+                   DW_AT_data_member_location 4 DW_FORM_udata
                }
            }
 
            DW_TAG_subprogram {
-               {MACRO_AT_func { main }}
-               {DW_AT_external 1 flag}
+               MACRO_AT_func { main }
+               DW_AT_external 1 flag
            } {
                # Simple memory location.
                DW_TAG_variable {
-                   {name "a"}
-                   {type :$array_a8_label}
-                   {location {
+                   DW_AT_name "a"
+                   DW_AT_type :$array_a8_label
+                   DW_AT_location [subst {
                        addr $buf_var
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
                # Memory pieces: two bytes from &buf[2], and two bytes
                # from &buf[0].
                DW_TAG_variable {
-                   {name "s1"}
-                   {type :$struct_s_label}
-                   {location {
+                   DW_AT_name "s1"
+                   DW_AT_type :$struct_s_label
+                   DW_AT_location [subst {
                        addr $buf_var
                        plus_uconst 2
                        piece 2
                        addr $buf_var
                        piece 2
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
                # Register- and memory pieces: one byte each from r0,
                # &buf[4], r1, and &buf[5].
                DW_TAG_variable {
-                   {name "s2"}
-                   {type :$struct_s_label}
-                   {location {
+                   DW_AT_name "s2"
+                   DW_AT_type :$struct_s_label
+                   DW_AT_location [subst {
                        regx [lindex $dwarf_regnum 0]
                        piece 1
                        addr "$buf_var + 4"
@@ -197,41 +197,41 @@ Dwarf::assemble $asm_file {
                        piece 1
                        addr "$buf_var + 5"
                        piece 1
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
                # Memory pieces for bitfield access: 8 bytes optimized
                # out, 3 bytes from &buf[3], and 1 byte from &buf[1].
                DW_TAG_variable {
-                   {name "st1"}
-                   {type :$struct_st_label}
-                   {location {
+                   DW_AT_name "st1"
+                   DW_AT_type :$struct_st_label
+                   DW_AT_location [subst {
                        piece 8
                        addr "$buf_var + 3"
                        piece 3
                        addr "$buf_var + 1"
                        piece 1
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
                # Register pieces for bitfield access: 4 bytes optimized
                # out, 3 bytes from r0, and 1 byte from r1.
                DW_TAG_variable {
-                   {name "t2"}
-                   {type :$struct_t_label}
-                   {location {
+                   DW_AT_name "t2"
+                   DW_AT_type :$struct_t_label
+                   DW_AT_location [subst {
                        piece 4
                        regx [lindex $dwarf_regnum 0]
                        piece 3
                        regx [lindex $dwarf_regnum 1]
                        piece 1
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
                # One piece per bitfield, using piece offsets: 32 bits of
                # an implicit value, 9 bits of a stack value, 13 bits of
                # r0, and 10 bits of buf.
                DW_TAG_variable {
-                   {name "t3"}
-                   {type :$struct_t_label}
-                   {location {
+                   DW_AT_name "t3"
+                   DW_AT_type :$struct_t_label
+                   DW_AT_location [subst {
                        implicit_value 0x12 0x34 0x56 0x78 0x9a
                        bit_piece 32 4
                        const2s -280
@@ -241,7 +241,7 @@ Dwarf::assemble $asm_file {
                        bit_piece 13 14
                        addr $buf_var
                        bit_piece 10 42
-                   } SPECIAL_expr}
+                   }] SPECIAL_expr
                }
            }
        }
index ce504f26316c1da3ea87695d461d1379b54d8c17..93abcbd7fa32cfda1edef09bb50d103b2388efba 100644 (file)
@@ -36,125 +36,125 @@ Dwarf::assemble $asm_file {
     # both 32- and 64-bit machines.
     cu { addr_size 4 } {
        compile_unit {
-           {name file1.txt}
-           {language @DW_LANG_Rust}
+           DW_AT_name file1.txt
+           DW_AT_language @DW_LANG_Rust
        } {
-            uinteger_label: DW_TAG_base_type {
-                {DW_AT_byte_size 4 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_unsigned}
-                {DW_AT_name      {unsigned integer}}
-            }
-
-            int8_label: DW_TAG_base_type {
-                {DW_AT_byte_size 1 DW_FORM_sdata}
-                {DW_AT_encoding  @DW_ATE_signed}
-                {DW_AT_name      i8}
-            }
+           uinteger_label: DW_TAG_base_type {
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_unsigned
+               DW_AT_name      {unsigned integer}
+           }
+
+           int8_label: DW_TAG_base_type {
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      i8
+           }
 
            float_label: base_type {
-               {name float}
-               {encoding @DW_ATE_float}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name float
+               DW_AT_encoding @DW_ATE_float
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            one_label: structure_type {
-               {name One}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name One
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                member {
-                   {name __0}
-                   {type :$uinteger_label}
-                   {data_member_location 0 data1}
+                   DW_AT_name __0
+                   DW_AT_type :$uinteger_label
+                   DW_AT_data_member_location 0 data1
                }
            }
 
            two_label: structure_type {
-               {name Two}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name Two
+               DW_AT_byte_size 4 DW_FORM_sdata
            } {
                member {
-                   {name __0}
-                   {type :$float_label}
-                   {data_member_location 0 data1}
+                   DW_AT_name __0
+                   DW_AT_type :$float_label
+                   DW_AT_data_member_location 0 data1
                }
            }
 
            structure_type {
-               {name Simple}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name Simple
+               DW_AT_byte_size 8 DW_FORM_sdata
            } {
                variant_part {
-                   {discr :$discr_1_label DW_FORM_ref4}
+                   DW_AT_discr :$discr_1_label DW_FORM_ref4
                } {
                    discr_1_label: member {
-                       {type :$uinteger_label}
-                       {data_member_location 0 data1}
-                       {artificial 1 DW_FORM_flag_present}
+                       DW_AT_type :$uinteger_label
+                       DW_AT_data_member_location 0 data1
+                       DW_AT_artificial 1 DW_FORM_flag_present
                    }
 
                    variant {
-                       {discr_value 23 udata}
+                       DW_AT_discr_value 23 udata
                    } {
                        member {
-                           {type :$one_label}
-                           {data_member_location 4 data1}
+                           DW_AT_type :$one_label
+                           DW_AT_data_member_location 4 data1
                        }
                    }
 
                    variant {
-                       {discr_value 1 udata}
+                       DW_AT_discr_value 1 udata
                    } {
                        member {
-                           {type :$two_label}
-                           {data_member_location 4 data1}
+                           DW_AT_type :$two_label
+                           DW_AT_data_member_location 4 data1
                        }
                    }
                }
            }
 
            structure_type {
-               {name Defaulted}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name Defaulted
+               DW_AT_byte_size 8 DW_FORM_sdata
            } {
                variant_part {
-                   {discr :$discr_2_label DW_FORM_ref4}
+                   DW_AT_discr :$discr_2_label DW_FORM_ref4
                } {
                    discr_2_label: member {
-                       {type :$uinteger_label}
-                       {data_member_location 0 data1}
-                       {artificial 1 DW_FORM_flag_present}
+                       DW_AT_type :$uinteger_label
+                       DW_AT_data_member_location 0 data1
+                       DW_AT_artificial 1 DW_FORM_flag_present
                    }
 
                    variant {
                    } {
                        member {
-                           {type :$one_label}
-                           {data_member_location 4 data1}
+                           DW_AT_type :$one_label
+                           DW_AT_data_member_location 4 data1
                        }
                    }
 
                    variant {
-                       {discr_value 1 udata}
+                       DW_AT_discr_value 1 udata
                    } {
                        member {
-                           {type :$two_label}
-                           {data_member_location 4 data1}
+                           DW_AT_type :$two_label
+                           DW_AT_data_member_location 4 data1
                        }
                    }
                }
            }
 
            structure_type {
-               {name Univariant}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name Univariant
+               DW_AT_byte_size 8 DW_FORM_sdata
            } {
                variant_part {
                } {
                    variant {
                    } {
                        member {
-                           {type :$one_label}
-                           {data_member_location 4 data1}
+                           DW_AT_type :$one_label
+                           DW_AT_data_member_location 4 data1
                        }
                    }
                }
@@ -163,24 +163,24 @@ Dwarf::assemble $asm_file {
            # Rust won't emit a negative discriminant like this, but
            # we want to test the code path anyway.
            structure_type {
-               {name Negative}
-               {byte_size 8 DW_FORM_sdata}
+               DW_AT_name Negative
+               DW_AT_byte_size 8 DW_FORM_sdata
            } {
                variant_part {
-                   {discr :$discr_3_label DW_FORM_ref4}
+                   DW_AT_discr :$discr_3_label DW_FORM_ref4
                } {
                    discr_3_label: member {
-                       {type :$int8_label}
-                       {data_member_location 0 data1}
-                       {artificial 1 DW_FORM_flag_present}
+                       DW_AT_type :$int8_label
+                       DW_AT_data_member_location 0 data1
+                       DW_AT_artificial 1 DW_FORM_flag_present
                    }
 
                    variant {
-                       {discr_value -1 sdata}
+                       DW_AT_discr_value -1 sdata
                    } {
                        member {
-                           {type :$one_label}
-                           {data_member_location 4 data1}
+                           DW_AT_type :$one_label
+                           DW_AT_data_member_location 4 data1
                        }
                    }
 
@@ -190,8 +190,8 @@ Dwarf::assemble $asm_file {
                    variant {
                    } {
                        member {
-                           {type :$two_label}
-                           {data_member_location 4 data1}
+                           DW_AT_type :$two_label
+                           DW_AT_data_member_location 4 data1
                        }
                    }
                }
index 6846ecb2326358460a483673319b9ac2900ad8d8..8f132bbf0ba6c68f277adbd3ebfbdecdbdabfa99 100644 (file)
@@ -50,7 +50,7 @@ proc setup_exec { arg_bad } {
 
        cu {} {
            DW_TAG_compile_unit {
-               {DW_AT_language @DW_LANG_C_plus_plus}
+               DW_AT_language @DW_LANG_C_plus_plus
            } {
                declare_labels int_label ptr_label struct_label var_a_label \
                    var_b_label var_c_label var_p_label var_bad_label \
@@ -61,179 +61,193 @@ proc setup_exec { arg_bad } {
 
 
                int_label: DW_TAG_base_type {
-                   {DW_AT_byte_size ${int_size} DW_FORM_udata}
-                   {DW_AT_encoding @DW_ATE_signed}
-                   {DW_AT_name "int"}
+                   DW_AT_byte_size ${int_size} DW_FORM_udata
+                   DW_AT_encoding @DW_ATE_signed
+                   DW_AT_name "int"
                }
 
                ptr_label: DW_TAG_pointer_type {
-                   {DW_AT_type :$int_label}
+                   DW_AT_type :$int_label
                }
 
                var_a_label: DW_TAG_variable {
-                   {DW_AT_name "var_a"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_a"]} SPECIAL_expr}
+                   DW_AT_name "var_a"
+                   DW_AT_type :${int_label}
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_location [subst {
+                       DW_OP_addr [gdb_target_symbol "var_a"]
+                   }] SPECIAL_expr
                }
 
                var_a_abstract_label: DW_TAG_variable {
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
+                   DW_AT_type :${int_label}
+                   DW_AT_external 1 DW_FORM_flag
                }
 
                var_b_label: DW_TAG_variable {
-                   {DW_AT_name "var_b"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_b"]} SPECIAL_expr}
+                   DW_AT_name "var_b"
+                   DW_AT_type :${int_label}
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_location [subst {
+                       DW_OP_addr [gdb_target_symbol "var_b"]
+                   }] SPECIAL_expr
                }
 
                var_c_label: DW_TAG_variable {
-                   {DW_AT_name "var_c"}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_const_value 53 DW_FORM_sdata}
+                   DW_AT_name "var_c"
+                   DW_AT_type :${int_label}
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_const_value 53 DW_FORM_sdata
                }
 
                var_p_label: DW_TAG_variable {
-                   {DW_AT_name "var_p"}
-                   {DW_AT_type :${ptr_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_p"]} SPECIAL_expr}
+                   DW_AT_name "var_p"
+                   DW_AT_type :${ptr_label}
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_location [subst {
+                       DW_OP_addr [gdb_target_symbol "var_p"]
+                   }] SPECIAL_expr
                }
 
                if { $bad } {
                    var_bad_label: DW_TAG_variable {
-                       {DW_AT_name "var_bad"}
-                       {DW_AT_type :${int_label}}
-                       {DW_AT_external 1 DW_FORM_flag}
+                       DW_AT_name "var_bad"
+                       DW_AT_type :${int_label}
+                       DW_AT_external 1 DW_FORM_flag
                    }
                }
 
                struct_label: DW_TAG_structure_type {
-                   {DW_AT_byte_size 8*$int_size DW_FORM_sdata}
+                   DW_AT_byte_size 8*$int_size DW_FORM_sdata
                } {
                    DW_TAG_member {
-                       {DW_AT_name "a"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 0*$int_size DW_FORM_udata}
+                       DW_AT_name "a"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 0*$int_size DW_FORM_udata
                    }
                    DW_TAG_member {
-                       {DW_AT_name "b"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 1*$int_size DW_FORM_udata}
+                       DW_AT_name "b"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 1*$int_size DW_FORM_udata
                    }
                    DW_TAG_member {
-                       {DW_AT_name "c"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 2*$int_size DW_FORM_udata}
+                       DW_AT_name "c"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 2*$int_size DW_FORM_udata
                    }
                    DW_TAG_member {
-                       {DW_AT_name "d"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 3*$int_size DW_FORM_udata}
+                       DW_AT_name "d"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 3*$int_size DW_FORM_udata
                    }
                    DW_TAG_member {
-                       {DW_AT_name "e"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 4*$int_size DW_FORM_udata}
+                       DW_AT_name "e"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 4*$int_size DW_FORM_udata
                    }
                    DW_TAG_member {
-                       {DW_AT_name "f"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 5*$int_size DW_FORM_udata}
+                       DW_AT_name "f"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 5*$int_size DW_FORM_udata
                    }
                    DW_TAG_member {
-                       {DW_AT_name "g"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 6*$int_size DW_FORM_udata}
+                       DW_AT_name "g"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 6*$int_size DW_FORM_udata
                    }
                    DW_TAG_member {
-                       {DW_AT_name "h"}
-                       {DW_AT_type :$int_label}
-                       {DW_AT_data_member_location 7*$int_size DW_FORM_udata}
+                       DW_AT_name "h"
+                       DW_AT_type :$int_label
+                       DW_AT_data_member_location 7*$int_size DW_FORM_udata
                    }
                }
 
                var_s_label: DW_TAG_variable {
-                   {DW_AT_name "var_s"}
-                   {DW_AT_type :${struct_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_s"]} SPECIAL_expr}
+                   DW_AT_name "var_s"
+                   DW_AT_type :${struct_label}
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_location [subst {
+                       DW_OP_addr [gdb_target_symbol "var_s"]
+                   }] SPECIAL_expr
                }
 
                var_untyped_label: DW_TAG_variable {
-                   {DW_AT_name "var_untyped"}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_b"]} SPECIAL_expr}
+                   DW_AT_name "var_untyped"
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_location [subst {
+                       DW_OP_addr [gdb_target_symbol "var_b"]
+                   }] SPECIAL_expr
                }
 
                int_array_label: DW_TAG_array_type {
-                   {DW_AT_type :${int_label}}
+                   DW_AT_type :${int_label}
                } {
                    DW_TAG_subrange_type {}
                }
                varval3_decl_label: DW_TAG_variable {
-                   {DW_AT_name "varval3"}
-                   {DW_AT_type :${int_array_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_declaration 1 DW_FORM_flag}
+                   DW_AT_name "varval3"
+                   DW_AT_type :${int_array_label}
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_declaration 1 DW_FORM_flag
                }
                int_array_of_1_label: DW_TAG_array_type {
-                   {DW_AT_type :${int_label}}
+                   DW_AT_type :${int_label}
                } {
                    DW_TAG_subrange_type {
-                       {DW_AT_type        :$int_label}
-                       {DW_AT_upper_bound 0 DW_FORM_data1}
+                       DW_AT_type        :$int_label
+                       DW_AT_upper_bound 0 DW_FORM_data1
                    }
                }
                varval3_def_label: DW_TAG_variable {
-                   {DW_AT_name "varval3"}
-                   {DW_AT_external 1 DW_FORM_flag}
-                   {DW_AT_type :${int_array_of_1_label}}
-                   {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_a"]} SPECIAL_expr}
+                   DW_AT_name "varval3"
+                   DW_AT_external 1 DW_FORM_flag
+                   DW_AT_type :${int_array_of_1_label}
+                   DW_AT_location [subst {
+                       DW_OP_addr [gdb_target_symbol "var_a"]
+                   }] SPECIAL_expr
                }
 
                DW_TAG_subprogram {
-                   {MACRO_AT_func { "main" }}
-                   {DW_AT_type :${int_label}}
-                   {DW_AT_external 1 DW_FORM_flag}
+                   MACRO_AT_func { "main" }
+                   DW_AT_type :${int_label}
+                   DW_AT_external 1 DW_FORM_flag
                } {
                    varval_label: DW_TAG_variable {
-                       {DW_AT_name "varval"}
-                       {DW_AT_type :${int_label}}
-                       {DW_AT_location {
+                       DW_AT_name "varval"
+                       DW_AT_type :${int_label}
+                       DW_AT_location [subst {
                            DW_OP_GNU_variable_value ${var_a_label}
                            DW_OP_const1s 0
                            DW_OP_or
                            DW_OP_stack_value
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                    varval2_label: DW_TAG_variable {
-                       {DW_AT_name "varval2"}
-                       {DW_AT_type :${int_label}}
-                       {DW_AT_location {
+                       DW_AT_name "varval2"
+                       DW_AT_type :${int_label}
+                       DW_AT_location [subst {
                            DW_OP_GNU_variable_value ${var_a_abstract_label}
                            DW_OP_stack_value
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                    var_a_concrete_label: DW_TAG_variable {
-                       {DW_AT_abstract_origin :${var_a_abstract_label}}
-                       {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_a"]} SPECIAL_expr}
+                       DW_AT_abstract_origin :${var_a_abstract_label}
+                       DW_AT_location [subst {
+                           DW_OP_addr [gdb_target_symbol "var_a"]
+                       }] SPECIAL_expr
                    }
                    DW_TAG_variable {
-                       {DW_AT_name "constval"}
-                       {DW_AT_type :${int_label}}
-                       {DW_AT_location {
+                       DW_AT_name "constval"
+                       DW_AT_type :${int_label}
+                       DW_AT_location [subst {
                            DW_OP_GNU_variable_value ${var_c_label}
                            DW_OP_stack_value
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                    DW_TAG_variable {
-                       {DW_AT_name "mixedval"}
-                       {DW_AT_type :${int_label}}
-                       {DW_AT_location {
+                       DW_AT_name "mixedval"
+                       DW_AT_type :${int_label}
+                       DW_AT_location [subst {
                            DW_OP_GNU_variable_value ${var_c_label}
                            DW_OP_GNU_variable_value ${var_b_label}
                            DW_OP_div
@@ -244,55 +258,55 @@ proc setup_exec { arg_bad } {
                            DW_OP_GNU_variable_value ${varval_label}
                            DW_OP_minus
                            DW_OP_stack_value
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                    DW_TAG_variable {
-                       {DW_AT_name "pointerval"}
-                       {DW_AT_type :${ptr_label}}
-                       {DW_AT_location {
+                       DW_AT_name "pointerval"
+                       DW_AT_type :${ptr_label}
+                       DW_AT_location [subst {
                            DW_OP_GNU_variable_value ${var_p_label}
                            DW_OP_stack_value
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                    if { $bad } {
                        DW_TAG_variable {
-                           {DW_AT_name "badval"}
-                           {DW_AT_type :${int_label}}
-                           {DW_AT_location {
+                           DW_AT_name "badval"
+                           DW_AT_type :${int_label}
+                           DW_AT_location [subst {
                                DW_OP_GNU_variable_value ${var_bad_label}
                                DW_OP_stack_value
-                           } SPECIAL_expr}
+                           }] SPECIAL_expr
                        }
                    }
                    DW_TAG_variable {
-                       {DW_AT_name "structval"}
-                       {DW_AT_type :${struct_label}}
-                       {DW_AT_location {
+                       DW_AT_name "structval"
+                       DW_AT_type :${struct_label}
+                       DW_AT_location [subst {
                            DW_OP_GNU_variable_value ${var_s_label}
                            DW_OP_stack_value
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                    DW_TAG_variable {
-                       {DW_AT_name "untypedval"}
-                       {DW_AT_location {
+                       DW_AT_name "untypedval"
+                       DW_AT_location [subst {
                            DW_OP_GNU_variable_value ${var_untyped_label}
                            DW_OP_stack_value
-                       } SPECIAL_expr}
+                       }] SPECIAL_expr
                    }
                    if { $bad } {
                        DW_TAG_variable {
-                           {DW_AT_name "bad_die_val1"}
-                           {DW_AT_location {
+                           DW_AT_name "bad_die_val1"
+                           DW_AT_location {
                                DW_OP_GNU_variable_value 0xabcdef11
                                DW_OP_stack_value
-                           } SPECIAL_expr}
+                           } SPECIAL_expr
                        }
                        DW_TAG_variable {
-                           {DW_AT_name "bad_die_val2"}
-                           {DW_AT_location {
+                           DW_AT_name "bad_die_val2"
+                           DW_AT_location [subst {
                                DW_OP_GNU_variable_value ${ptr_label}+1
                                DW_OP_stack_value
-                           } SPECIAL_expr}
+                           }] SPECIAL_expr
                        }
                    }
                }
index 64bebe15c8db8bfb85e10d9e18b9fb34510339a3..10f5738c5dd5dabd609caeb5eb824aa6066454fa 100644 (file)
@@ -38,50 +38,54 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        DW_TAG_compile_unit {
-               {DW_AT_producer "Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.5.212 Build 20150212"}
-                {DW_AT_language @DW_LANG_C}
-                {DW_AT_name     $srcfile}
-                {DW_AT_comp_dir /tmp}
-        } {
+               DW_AT_producer "Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.5.212 Build 20150212"
+               DW_AT_language @DW_LANG_C
+               DW_AT_name     $srcfile
+               DW_AT_comp_dir /tmp
+       } {
            declare_labels int_type void_type ptr_type
 
            int_type: DW_TAG_base_type {
-               {DW_AT_byte_size 4 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      int}
+               DW_AT_byte_size 4 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      int
            }
 
            void_type: DW_TAG_base_type {
-               {DW_AT_byte_size 0 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      void}
+               DW_AT_byte_size 0 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      void
            }
 
            ptr_type: DW_TAG_pointer_type {
-               {DW_AT_type :$void_type}
+               DW_AT_type :$void_type
            }
 
-            DW_TAG_subprogram {
-               {MACRO_AT_func {func}}
-                {type :$void_type}
+           DW_TAG_subprogram {
+               MACRO_AT_func {func}
+               DW_AT_type :$void_type
            }
-            DW_TAG_subprogram {
-               {MACRO_AT_func {main}}
-                {type :$int_type}
+           DW_TAG_subprogram {
+               MACRO_AT_func {main}
+               DW_AT_type :$int_type
            }
 
            DW_TAG_variable {
-               {DW_AT_name "var_a"}
-               {DW_AT_type :$int_type}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_a"]} SPECIAL_expr}
+               DW_AT_name "var_a"
+               DW_AT_type :$int_type
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "var_a"]
+               }] SPECIAL_expr
            }
 
            DW_TAG_variable {
-               {DW_AT_name "var_ptr"}
-               {DW_AT_type :$ptr_type}
-               {DW_AT_external 1 DW_FORM_flag}
-               {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_ptr"]} SPECIAL_expr}
+               DW_AT_name "var_ptr"
+               DW_AT_type :$ptr_type
+               DW_AT_external 1 DW_FORM_flag
+               DW_AT_location [subst {
+                   DW_OP_addr [gdb_target_symbol "var_ptr"]
+               }] SPECIAL_expr
            }
        }
     }
index 1e737e114870d61e07d5c8be10019af547114e5d..55f4fedc97747ca2fd94c3ff8026e488737a11aa 100644 (file)
@@ -27,11 +27,11 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name py-linetable-empty.c}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name py-linetable-empty.c
        } {
            subprogram {
-                       {MACRO_AT_func {main}}
+               MACRO_AT_func {main}
            }
        }
     }
index e26e9d28da00aa3ecf106ab810b6d0e04e188542..831ebd2f5151bc0f0904319e19cc98a0f69e3e0b 100644 (file)
@@ -27,21 +27,21 @@ set asm_file [standard_output_file ${srcfile2}]
 Dwarf::assemble $asm_file {
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name py-sym-artificial.c}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name py-sym-artificial.c
        } {
            declare_labels signed
 
            signed: DW_TAG_base_type {
-               {DW_AT_byte_size 1 DW_FORM_sdata}
-               {DW_AT_encoding  @DW_ATE_signed}
-               {DW_AT_name      bool}
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding  @DW_ATE_signed
+               DW_AT_name      bool
            }
 
            DW_TAG_variable {
-               {name the_variable}
-               {DW_AT_type :$signed}
-               {artificial 1 DW_FORM_flag_present}
+               DW_AT_name the_variable
+               DW_AT_type :$signed
+               DW_AT_artificial 1 DW_FORM_flag_present
            }
        }
     }
index 410394c20dc0b48a7a14f7551f1a286f615c4e5a..e31eef0b70661f0d0468a50d8eb575b2d026962d 100644 (file)
@@ -48,16 +48,16 @@ Dwarf::assemble $asm_file {
 
     cu {} {
        compile_unit {
-           {language @DW_LANG_C}
-           {name map-to-same-line.c}
-           {stmt_list $L DW_FORM_sec_offset}
-           {low_pc 0 addr}
+           DW_AT_language @DW_LANG_C
+           DW_AT_name map-to-same-line.c
+           DW_AT_stmt_list $L DW_FORM_sec_offset
+           DW_AT_low_pc 0 addr
        } {
            subprogram {
-               {external 1 flag}
-               {name main}
-               {low_pc $main_start addr}
-               {high_pc $main_len DW_FORM_data4}
+               DW_AT_external 1 flag
+               DW_AT_name main
+               DW_AT_low_pc $main_start addr
+               DW_AT_high_pc $main_len DW_FORM_data4
            }
        }
     }
index 161496a53078ebed55b67844f6677cc079e773b0..1d2e8e9fb90aba25ead2256bc624501b2c20d88c 100644 (file)
@@ -90,61 +90,63 @@ Dwarf::assemble $asm_file {
     set bar_length [lindex $bar_result 1]
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            int_label: base_type {
-               {name int}
-               {encoding @DW_ATE_signed}
-               {byte_size 4 DW_FORM_sdata}
+               DW_AT_name int
+               DW_AT_encoding @DW_ATE_signed
+               DW_AT_byte_size 4 DW_FORM_sdata
            }
 
            foo_label: subprogram {
-               {decl_file 0 udata}
-               {MACRO_AT_func { foo }}
+               DW_AT_decl_file 0 udata
+               MACRO_AT_func { foo }
            } {
                formal_parameter {
-                   {type :$int_label}
-                   {name i}
-                   {location {DW_OP_reg0} SPECIAL_expr}
+                   DW_AT_type :$int_label
+                   DW_AT_name i
+                   DW_AT_location {DW_OP_reg0} SPECIAL_expr
                }
                formal_parameter {
-                   {type :$int_label}
-                   {name j}
-                   {location {DW_OP_reg1} SPECIAL_expr}
+                   DW_AT_type :$int_label
+                   DW_AT_name j
+                   DW_AT_location {DW_OP_reg1} SPECIAL_expr
                }
            }
 
            subprogram {
-               {name bar}
-               {decl_file 0 udata}
-               {low_pc $bar_start addr}
-               {high_pc "$bar_start + $bar_length" addr}
-               {GNU_all_call_sites 1 sdata}
+               DW_AT_name bar
+               DW_AT_decl_file 0 udata
+               DW_AT_low_pc $bar_start addr
+               DW_AT_high_pc "$bar_start + $bar_length" addr
+               DW_AT_GNU_all_call_sites 1 sdata
            } {
                formal_parameter {
-                   {type :$int_label}
-                   {name i}
+                   DW_AT_type :$int_label
+                   DW_AT_name i
                }
 
                GNU_call_site {
-                   {low_pc "$bar_start + $returned_from_foo" addr}
-                   {abstract_origin :$foo_label}
+                   DW_AT_low_pc "$bar_start + $returned_from_foo" addr
+                   DW_AT_abstract_origin :$foo_label
                } {
                    # Faked entry values are reference to variables 'global1'
                    # and 'global2' and faked locations are register 0 and
                    # register 1.
                    GNU_call_site_parameter {
-                       {location {DW_OP_reg0} SPECIAL_expr}
-                       {GNU_call_site_value {
+                       DW_AT_location {DW_OP_reg0} SPECIAL_expr
+                       DW_AT_GNU_call_site_value {
                            addr global1
                            deref_size 4
-                       } SPECIAL_expr}
+                       } SPECIAL_expr
                    }
                    GNU_call_site_parameter {
-                       {location {DW_OP_reg1} SPECIAL_expr}
-                       {GNU_call_site_value {
+                       DW_AT_location {DW_OP_reg1} SPECIAL_expr
+                       DW_AT_GNU_call_site_value {
                            addr global2
                            deref_size 4
-                       } SPECIAL_expr}
+                       } SPECIAL_expr
                    }
                }
            }
index 98207f01316ac9194a18e1df9c39415d3530bb59..3adf24afe1584c993a081ae1506ed12c9d1a1d8f 100644 (file)
@@ -32,165 +32,167 @@ Dwarf::assemble $asm_file {
     declare_labels uchar_label struct_s_label foo_label struct_t_label bar_label
 
     cu {} {
-       compile_unit {{language @DW_LANG_C}} {
+       compile_unit {
+           DW_AT_language @DW_LANG_C
+       } {
            uchar_label: DW_TAG_base_type {
-               {name "unsigned char"}
-               {byte_size 1 DW_FORM_sdata}
-               {encoding @DW_ATE_unsigned_char}
+               DW_AT_name "unsigned char"
+               DW_AT_byte_size 1 DW_FORM_sdata
+               DW_AT_encoding @DW_ATE_unsigned_char
            }
 
            struct_s_label: DW_TAG_structure_type {
-               {name s}
-               {byte_size 3 DW_FORM_sdata}
-               {decl_file 0 DW_FORM_udata}
-               {decl_line 1 DW_FORM_udata}
+               DW_AT_name s
+               DW_AT_byte_size 3 DW_FORM_sdata
+               DW_AT_decl_file 0 DW_FORM_udata
+               DW_AT_decl_line 1 DW_FORM_udata
            } {
                DW_TAG_member {
-                   {name a}
-                   {type :$uchar_label}
-                   {data_member_location {
+                   DW_AT_name a
+                   DW_AT_type :$uchar_label
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 0
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name b}
-                   {type :$uchar_label}
-                   {data_member_location {
+                   DW_AT_name b
+                   DW_AT_type :$uchar_label
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name c}
-                   {type :$uchar_label}
-                   {data_member_location {
+                   DW_AT_name c
+                   DW_AT_type :$uchar_label
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 2
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
            }
 
            struct_t_label: DW_TAG_structure_type {
-               {name t}
-               {byte_size 3 DW_FORM_sdata}
-               {decl_file 0 DW_FORM_udata}
-               {decl_line 1 DW_FORM_udata}
+               DW_AT_name t
+               DW_AT_byte_size 3 DW_FORM_sdata
+               DW_AT_decl_file 0 DW_FORM_udata
+               DW_AT_decl_line 1 DW_FORM_udata
            } {
                DW_TAG_member {
-                   {name a}
-                   {type :$uchar_label}
-                   {data_member_location {
+                   DW_AT_name a
+                   DW_AT_type :$uchar_label
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 0
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name b}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 7 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name b
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 7 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name c}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 6 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name c
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 6 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name d}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 5 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name d
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 5 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name e}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 4 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name e
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 4 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name f}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 3 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name f
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 3 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name g}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 2 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name g
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 2 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name h}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 1 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name h
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 1 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name i}
-                   {type :$uchar_label}
-                   {byte_size 1 DW_FORM_sdata}
-                   {bit_size 1 DW_FORM_sdata}
-                   {bit_offset 0 DW_FORM_sdata}
-                   {data_member_location {
+                   DW_AT_name i
+                   DW_AT_type :$uchar_label
+                   DW_AT_byte_size 1 DW_FORM_sdata
+                   DW_AT_bit_size 1 DW_FORM_sdata
+                   DW_AT_bit_offset 0 DW_FORM_sdata
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_member {
-                   {name j}
-                   {type :$uchar_label}
-                   {data_member_location {
+                   DW_AT_name j
+                   DW_AT_type :$uchar_label
+                   DW_AT_data_member_location {
                        DW_OP_plus_uconst 2
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
            }
 
            DW_TAG_subprogram {
-               {name foo}
-               {decl_file 0 udata}
-               {low_pc foo_start_lbl addr}
-               {high_pc foo_end_lbl addr}
+               DW_AT_name foo
+               DW_AT_decl_file 0 udata
+               DW_AT_low_pc foo_start_lbl addr
+               DW_AT_high_pc foo_end_lbl addr
            } {
                DW_TAG_formal_parameter {
-                   {type :$struct_s_label}
-                   {name x}
-                   {location {
+                   DW_AT_type :$struct_s_label
+                   DW_AT_name x
+                   DW_AT_location {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 2
                        DW_OP_reg0
                        DW_OP_piece 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_formal_parameter {
-                   {type :$struct_s_label}
-                   {name y}
-                   {location {
+                   DW_AT_type :$struct_s_label
+                   DW_AT_name y
+                   DW_AT_location {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
@@ -199,32 +201,32 @@ Dwarf::assemble $asm_file {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_formal_parameter {
-                   {type :$struct_s_label}
-                   {name z}
-                   {location {
+                   DW_AT_type :$struct_s_label
+                   DW_AT_name z
+                   DW_AT_location {
                        DW_OP_reg0
                        DW_OP_piece 1
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 2
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
            }
 
 
            DW_TAG_subprogram {
-               {name bar}
-               {decl_file 0 udata}
-               {low_pc bar_start_lbl addr}
-               {high_pc bar_end_lbl addr}
+               DW_AT_name bar
+               DW_AT_decl_file 0 udata
+               DW_AT_low_pc bar_start_lbl addr
+               DW_AT_high_pc bar_end_lbl addr
            } {
                DW_TAG_formal_parameter {
-                   {type :$struct_t_label}
-                   {name x}
-                   {location {
+                   DW_AT_type :$struct_t_label
+                   DW_AT_name x
+                   DW_AT_location {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
@@ -236,12 +238,12 @@ Dwarf::assemble $asm_file {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_formal_parameter {
-                   {type :$struct_t_label}
-                   {name y}
-                   {location {
+                   DW_AT_type :$struct_t_label
+                   DW_AT_name y
+                   DW_AT_location {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
@@ -256,12 +258,12 @@ Dwarf::assemble $asm_file {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
                DW_TAG_formal_parameter {
-                   {type :$struct_t_label}
-                   {name z}
-                   {location {
+                   DW_AT_type :$struct_t_label
+                   DW_AT_name z
+                   DW_AT_location {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
@@ -273,7 +275,7 @@ Dwarf::assemble $asm_file {
                        DW_OP_lit0
                        DW_OP_stack_value
                        DW_OP_piece 1
-                   } SPECIAL_expr}
+                   } SPECIAL_expr
                }
            }
 
index c19240bfc2ee27e24ac0b78fb787e636ac9df5d1..911ec8806eaac4643c8ab7a22649b541bf11afa5 100644 (file)
@@ -461,16 +461,13 @@ proc get_func_info { name {options {debug}} } {
 #
 # proc DW_TAG_mumble {{attrs {}} {children {}}} { ... }
 #
-# ATTRS is an optional list of attributes.
-# It is run through 'subst' in the caller's context before processing.
+# ATTRS holds optional attributes.  It is just Tcl code and is
+# evaluated in the caller's context.  Each attribute is a proc of the
+# form:
 #
-# Each attribute in the list has one of two forms:
-#   1. { NAME VALUE }
-#   2. { NAME VALUE FORM }
+# proc DW_AT_mumble {value {form {}}} { ... }
 #
-# In each case, NAME is the attribute's name.
-# This can either be the full name, like 'DW_AT_name', or a shortened
-# name, like 'name'.  These are fully equivalent.
+# Only the full name can be used here.
 #
 # Besides DWARF standard attributes, assembler supports 'macro' attribute
 # which will be substituted by one or more standard or macro attributes.
@@ -522,8 +519,6 @@ namespace eval Dwarf {
 
     # Constants from dwarf2.h.
     variable _constants
-    # DW_AT short names.
-    variable _AT
     # DW_FORM short names.
     variable _FORM
     # DW_OP short names.
@@ -594,7 +589,6 @@ namespace eval Dwarf {
 
     proc _process_one_constant {name value} {
        variable _constants
-       variable _AT
        variable _FORM
        variable _OP
 
@@ -633,7 +627,8 @@ namespace eval Dwarf {
            }
 
            AT {
-               set _AT($name2) $name
+               proc $name {value {form {}}} \
+                   "_handle_DW_AT $name \$value \$form"
            }
 
            FORM {
@@ -917,11 +912,27 @@ namespace eval Dwarf {
        return $name
     }
 
-    proc _handle_attribute { attr_name attr_value attr_form } {
+    # Implementation of all the DW_AT_* procs.
+    proc _handle_DW_AT {attr_name attr_value attr_form} {
        variable _abbrev_section
        variable _constants
        variable _cu_version
 
+       if {$attr_form == ""} {
+           set attr_form [_guess_form $attr_value attr_value]
+           if { $attr_form eq "" } {
+               set attr_form [_default_form $attr_name]
+           }
+           if { $attr_form eq "" } {
+               error "No form for $attr_name $attr_value"
+           }
+       } elseif { [string index $attr_value 0] == ":" } {
+           # It is a label, get its value.
+           _guess_form $attr_value attr_value
+       }
+
+       set attr_form [_map_name $attr_form _FORM]
+
        _handle_DW_FORM $attr_form $attr_value
 
        _defer_output $_abbrev_section {
@@ -942,9 +953,8 @@ namespace eval Dwarf {
        }
     }
 
-    # Handle macro attribute MACRO_AT_range.
-
-    proc _handle_macro_at_range { attr_value } {
+    # Handle extension attribute MACRO_AT_range.
+    proc MACRO_AT_range { attr_value } {
        variable _cu_is_fission
 
        if {[llength $attr_value] != 1} {
@@ -961,19 +971,17 @@ namespace eval Dwarf {
            set form DW_FORM_GNU_addr_index
        }
 
-       _handle_attribute DW_AT_low_pc [lindex $result 0] $form
-       _handle_attribute DW_AT_high_pc \
-           "[lindex $result 0] + [lindex $result 1]" $form
+       DW_AT_low_pc [lindex $result 0] $form
+       DW_AT_high_pc "[lindex $result 0] + [lindex $result 1]" $form
     }
 
-    # Handle macro attribute MACRO_AT_func.
-
-    proc _handle_macro_at_func { attr_value } {
+    # Handle extension attribute MACRO_AT_func.
+    proc MACRO_AT_func { attr_value } {
        if {[llength $attr_value] != 1} {
            error "usage: MACRO_AT_func { func file }"
        }
-       _handle_attribute DW_AT_name [lindex $attr_value 0] DW_FORM_string
-       _handle_macro_at_range $attr_value
+       DW_AT_name [lindex $attr_value 0] DW_FORM_string
+       MACRO_AT_range $attr_value
     }
 
     # Return the next available abbrev number in the current CU's abbrev
@@ -1003,47 +1011,7 @@ namespace eval Dwarf {
 
        _op .uleb128 $my_abbrev "Abbrev ($tag_name)"
 
-       foreach attr $attrs {
-           set attr_name [_map_name [lindex $attr 0] _AT]
-
-           # When the length of ATTR is greater than 2, the last
-           # element of the list must be a form.  The second through
-           # the penultimate elements are joined together and
-           # evaluated using subst.  This allows constructs such as
-           # [gdb_target_symbol foo] to be used.
-
-           if {[llength $attr] > 2} {
-               set attr_value [uplevel 2 [list subst [join [lrange $attr 1 end-1]]]]
-           } else {
-               set attr_value [uplevel 2 [list subst [lindex $attr 1]]]
-           }
-
-           if { [string equal "MACRO_AT_func" $attr_name] } {
-               _handle_macro_at_func $attr_value
-           } elseif { [string equal "MACRO_AT_range" $attr_name] } {
-               _handle_macro_at_range $attr_value
-           } else {
-               if {[llength $attr] > 2} {
-                   set attr_form [uplevel 2 [list subst [lindex $attr end]]]
-
-                   if { [string index $attr_value 0] == ":" } {
-                       # It is a label, get its value.
-                       _guess_form $attr_value attr_value
-                   }
-               } else {
-                   set attr_form [_guess_form $attr_value attr_value]
-                   if { $attr_form eq "" } {
-                       set attr_form [_default_form $attr_name]
-                   }
-                   if { $attr_form eq "" } {
-                       error "No form for $attr_name $attr_value"
-                   }
-               }
-               set attr_form [_map_name $attr_form _FORM]
-
-               _handle_attribute $attr_name $attr_value $attr_form
-           }
-       }
+       uplevel 2 $attrs
 
        _defer_output $_abbrev_section {
            # Terminator.