+2020-07-17 Tom de Vries <tdevries@suse.de>
+
+ * lib/dwarf.exp (Dwarf::MACRO_AT_func, Dwarf::MACRO_AT_range): Drop
+ src parameter.
+ * gdb.dlang/watch-loc.exp: Update MACRO_AT_{func,range} calls.
+ * gdb.dwarf2/bitfield-parent-optimized-out.exp: Same.
+ * gdb.dwarf2/dw2-ifort-parameter.exp: Same.
+ * gdb.dwarf2/dw2-opt-structptr.exp: Same.
+ * gdb.dwarf2/dwz.exp: Same.
+ * gdb.dwarf2/implptr-optimized-out.exp: Same.
+ * gdb.dwarf2/implref-array.exp: Same.
+ * gdb.dwarf2/implref-const.exp: Same.
+ * gdb.dwarf2/implref-global.exp: Same.
+ * gdb.dwarf2/implref-struct.exp: Same.
+ * gdb.dwarf2/info-locals-optimized-out.exp: Same.
+ * gdb.dwarf2/opaque-type-lookup.exp: Same.
+ * gdb.dwarf2/var-access.exp: Same.
+ * gdb.dwarf2/varval.exp: Same.
+ * gdb.trace/entry-values.exp: Same.
+
2020-07-17 Tom de Vries <tdevries@suse.de>
* lib/dwarf.exp (Dwarf::extern): Remove.
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
cu {} {
compile_unit {
{language @DW_LANG_D}
}
subprogram {
- {MACRO_AT_func { "_Dmain" "${srcdir}/${subdir}/${srcfile}" }}
+ {MACRO_AT_func { "_Dmain" }}
{external 1 flag_present}
}
}
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
cu { version 3 addr_size 4 } {
compile_unit {} {
declare_labels struct_label var_label int_label
}
subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{type :$int_label}
{external 1 flag}
} {
Dwarf::assemble $asm_file {
declare_labels int_label
- global srcdir subdir srcfile
-
cu {} {
compile_unit {
{name file1.txt}
{language @DW_LANG_C}
- {MACRO_AT_range { func ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_range { func }}
} {
int_label: base_type {
{name int}
subprogram {
{external 1 flag}
- {MACRO_AT_func { func ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { func }}
} {
formal_parameter {
{name param}
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
# Creating a CU with 4-byte addresses lets this test link on
# both 32- and 64-bit machines.
{DW_AT_name func01}
{DW_AT_type :$int_label}
{external 1 flag}
- {MACRO_AT_func {func01 ${srcdir}/${subdir}/${srcfile}}}
+ {MACRO_AT_func {func01}}
} {
DW_TAG_variable {
{DW_AT_name ptr}
{DW_AT_name main}
{DW_AT_type :$int_label}
{external 1 flag}
- {MACRO_AT_func {main ${srcdir}/${subdir}/${srcfile}}}
+ {MACRO_AT_func {main}}
} {
}
}
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
declare_labels partial_label int_label int_label2
- global srcdir subdir srcfile
cu {} {
partial_label: partial_unit {} {
subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
}
}
}
# Create the DWARF.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
cu { version 3 addr_size 4 } {
compile_unit {
{producer "GNU C 4.4.3"}
}
subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{type :$int_label}
{external 1 flag}
} {
# The variable must be global so that its name is an exported symbol that we
# can reference from the DWARF using gdb_target_symbol.
Dwarf::assemble ${asm_file} {
- global srcdir subdir srcfile array_length
+ global array_length
cu {} {
DW_TAG_compile_unit {
}
DW_TAG_subprogram {
- {MACRO_AT_func { "main" "${srcdir}/${subdir}/${srcfile}" }}
+ {MACRO_AT_func { "main" }}
{DW_AT_type :${int_label}}
{DW_AT_external 1 DW_FORM_flag}
} {
# Create the DWARF. We need a regular variable and a reference to it that'll
# be marked with DW_OP_GNU_implicit_pointer.
Dwarf::assemble ${asm_file} {
- global srcdir subdir srcfile
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_C_plus_plus}
}
DW_TAG_subprogram {
- {MACRO_AT_func { "main" "${srcdir}/${subdir}/${srcfile}" }}
+ {MACRO_AT_func { "main" }}
{DW_AT_type :${int_label}}
{DW_AT_external 1 DW_FORM_flag}
} {
# that its name is an exported symbol that we can reference from the DWARF
# using gdb_target_symbol.
Dwarf::assemble ${asm_file} {
- global srcdir subdir srcfile
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_C_plus_plus}
}
DW_TAG_subprogram {
- {MACRO_AT_func { "main" "${srcdir}/${subdir}/${srcfile}" }}
+ {MACRO_AT_func { "main" }}
{DW_AT_type :${int_label}}
{DW_AT_external 1 DW_FORM_flag}
} {
# global so that its name is an exported symbol that can we can reference from
# the DWARF using gdb_target_symbol.
Dwarf::assemble ${asm_file} {
- global srcdir subdir srcfile
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_C_plus_plus}
}
DW_TAG_subprogram {
- {MACRO_AT_func { "main" "${srcdir}/${subdir}/${srcfile}" }}
+ {MACRO_AT_func { "main" }}
{DW_AT_type :${int_label}}
{DW_AT_external 1 DW_FORM_flag}
} {
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
global dwarf_regnum regname
set buf_var [gdb_target_symbol buf]
}
DW_TAG_subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{DW_AT_external 1 flag}
} {
# A variable completely optimized out.
declare_labels struct_a_label struct_b_label
declare_labels opaque_struct_a_label opaque_struct_b_label
declare_labels char_type1_label char_type2_label
- global srcdir subdir srcfile
# The partial units are laid out so we're not dependent on the order that
# they appear in compunit_symtab.includes. We need the one with the
{name main}
} {
subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
}
}
}
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
global dwarf_regnum regname
set buf_var [gdb_target_symbol buf]
}
DW_TAG_subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{DW_AT_external 1 flag}
} {
# Simple memory location.
# Create the DWARF.
Dwarf::assemble ${asm_file} {
- global srcdir subdir srcfile bad int_size addr_size
+ global bad int_size addr_size
cu {} {
DW_TAG_compile_unit {
}
DW_TAG_subprogram {
- {MACRO_AT_func { "main" "${srcdir}/${subdir}/${srcfile}" }}
+ {MACRO_AT_func { "main" }}
{DW_AT_type :${int_label}}
{DW_AT_external 1 DW_FORM_flag}
} {
foo_label: subprogram {
{decl_file 0 udata}
- {MACRO_AT_func { foo ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { foo }}
} {
formal_parameter {
{type :$int_label}
# which will be substituted by one or more standard or macro attributes.
# supported macro attributes are:
#
-# - MACRO_AT_range { FUNC FILE }
+# - MACRO_AT_range { FUNC }
# It is substituted by DW_AT_low_pc and DW_AT_high_pc with the start and
-# end address of function FUNC in file FILE.
+# end address of function FUNC in file $srcdir/$subdir/$srcfile.
#
-# - MACRO_AT_func { FUNC FILE }
+# - MACRO_AT_func { FUNC }
# It is substituted by DW_AT_name with FUNC and MACRO_AT_range.
#
# If FORM is given, it should name a DW_FORM_ constant.
# Handle macro attribute MACRO_AT_range.
proc _handle_macro_at_range { attr_value } {
- if {[llength $attr_value] != 2} {
- error "usage: MACRO_AT_range { func file }"
+ if {[llength $attr_value] != 1} {
+ error "usage: MACRO_AT_range { func }"
}
set func [lindex $attr_value 0]
- set src [lindex $attr_value 1]
+ global srcdir subdir srcfile
+ set src ${srcdir}/${subdir}/${srcfile}
set result [function_range $func $src]
_handle_attribute DW_AT_low_pc [lindex $result 0] \
# Handle macro attribute MACRO_AT_func.
proc _handle_macro_at_func { attr_value } {
- if {[llength $attr_value] != 2} {
+ if {[llength $attr_value] != 1} {
error "usage: MACRO_AT_func { func file }"
}
_handle_attribute DW_AT_name [lindex $attr_value 0] DW_FORM_string