aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog20
-rw-r--r--gdb/testsuite/gdb.dlang/watch-loc.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp5
-rw-r--r--gdb/testsuite/gdb.dwarf2/dwz.exp3
-rw-r--r--gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/implref-array.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/implref-const.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/implref-global.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/implref-struct.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp3
-rw-r--r--gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp3
-rw-r--r--gdb/testsuite/gdb.dwarf2/var-access.exp3
-rw-r--r--gdb/testsuite/gdb.dwarf2/varval.exp4
-rw-r--r--gdb/testsuite/gdb.trace/entry-values.exp2
-rw-r--r--gdb/testsuite/lib/dwarf.exp15
17 files changed, 47 insertions, 45 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 76ad965..f9ee612 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,25 @@
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.
* gdb.compile/compile-ops.exp: Remove use of Dwarf::extern.
* gdb.dlang/circular.exp: Same.
diff --git a/gdb/testsuite/gdb.dlang/watch-loc.exp b/gdb/testsuite/gdb.dlang/watch-loc.exp
index 431f56f..d65f3c6 100644
--- a/gdb/testsuite/gdb.dlang/watch-loc.exp
+++ b/gdb/testsuite/gdb.dlang/watch-loc.exp
@@ -30,8 +30,6 @@ standard_testfile watch-loc.c watch-loc-dw.S
# 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}
@@ -56,7 +54,7 @@ Dwarf::assemble $asm_file {
}
subprogram {
- {MACRO_AT_func { "_Dmain" "${srcdir}/${subdir}/${srcfile}" }}
+ {MACRO_AT_func { "_Dmain" }}
{external 1 flag_present}
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
index 68a59f0..8c4365a 100644
--- a/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
@@ -29,8 +29,6 @@ set executable ${testfile}
# 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
@@ -59,7 +57,7 @@ Dwarf::assemble $asm_file {
}
subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{type :$int_label}
{external 1 flag}
} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
index 2388ce5..32ae5ed 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
@@ -29,13 +29,11 @@ set asm_file [standard_output_file $srcfile2]
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}
@@ -45,7 +43,7 @@ Dwarf::assemble $asm_file {
subprogram {
{external 1 flag}
- {MACRO_AT_func { func ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { func }}
} {
formal_parameter {
{name param}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
index 37a9b93..d6e309d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
@@ -41,7 +41,6 @@ proc build_test_program {} {
# 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.
@@ -102,7 +101,7 @@ proc build_test_program {} {
{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}
@@ -115,7 +114,7 @@ proc build_test_program {} {
{DW_AT_name main}
{DW_AT_type :$int_label}
{external 1 flag}
- {MACRO_AT_func {main ${srcdir}/${subdir}/${srcfile}}}
+ {MACRO_AT_func {main}}
} {
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/dwz.exp b/gdb/testsuite/gdb.dwarf2/dwz.exp
index 9f5eda5..7be7313 100644
--- a/gdb/testsuite/gdb.dwarf2/dwz.exp
+++ b/gdb/testsuite/gdb.dwarf2/dwz.exp
@@ -26,12 +26,11 @@ standard_testfile main.c dwz.S
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 }}
}
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
index 8999be3..d6ce5df 100644
--- a/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
@@ -25,8 +25,6 @@ set executable ${testfile}
# 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"}
@@ -53,7 +51,7 @@ Dwarf::assemble $asm_file {
}
subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{type :$int_label}
{external 1 flag}
} {
diff --git a/gdb/testsuite/gdb.dwarf2/implref-array.exp b/gdb/testsuite/gdb.dwarf2/implref-array.exp
index 0e6cc04..3535be5 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-array.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-array.exp
@@ -51,7 +51,7 @@ set array_length [get_valueof "/u" "sizeof(array) / sizeof(array\[0\])" -1]
# 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 {
@@ -99,7 +99,7 @@ Dwarf::assemble ${asm_file} {
}
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}
} {
diff --git a/gdb/testsuite/gdb.dwarf2/implref-const.exp b/gdb/testsuite/gdb.dwarf2/implref-const.exp
index d836baf..f289f61 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-const.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-const.exp
@@ -47,8 +47,6 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
# 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}
@@ -76,7 +74,7 @@ Dwarf::assemble ${asm_file} {
}
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}
} {
diff --git a/gdb/testsuite/gdb.dwarf2/implref-global.exp b/gdb/testsuite/gdb.dwarf2/implref-global.exp
index 59f8bff..86f1c50 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-global.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-global.exp
@@ -49,8 +49,6 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
# 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}
@@ -80,7 +78,7 @@ Dwarf::assemble ${asm_file} {
}
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}
} {
diff --git a/gdb/testsuite/gdb.dwarf2/implref-struct.exp b/gdb/testsuite/gdb.dwarf2/implref-struct.exp
index b00408b..e47d74e 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-struct.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-struct.exp
@@ -49,8 +49,6 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}]
# 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}
@@ -115,7 +113,7 @@ Dwarf::assemble ${asm_file} {
}
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}
} {
diff --git a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
index 7874c86..e270441 100644
--- a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
@@ -28,7 +28,6 @@ standard_testfile .c ${gdb_test_file_name}-dw.S
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]
@@ -48,7 +47,7 @@ Dwarf::assemble $asm_file {
}
DW_TAG_subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{DW_AT_external 1 flag}
} {
# A variable completely optimized out.
diff --git a/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp b/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
index 19316ef..d383b98 100644
--- a/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
+++ b/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
@@ -32,7 +32,6 @@ Dwarf::assemble $asm_file {
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
@@ -180,7 +179,7 @@ Dwarf::assemble $asm_file {
{name main}
} {
subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
}
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/var-access.exp b/gdb/testsuite/gdb.dwarf2/var-access.exp
index 88539a6..ad53148 100644
--- a/gdb/testsuite/gdb.dwarf2/var-access.exp
+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp
@@ -50,7 +50,6 @@ standard_testfile .c ${gdb_test_file_name}-dw.S
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]
@@ -162,7 +161,7 @@ Dwarf::assemble $asm_file {
}
DW_TAG_subprogram {
- {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { main }}
{DW_AT_external 1 flag}
} {
# Simple memory location.
diff --git a/gdb/testsuite/gdb.dwarf2/varval.exp b/gdb/testsuite/gdb.dwarf2/varval.exp
index 876725b..69790e7 100644
--- a/gdb/testsuite/gdb.dwarf2/varval.exp
+++ b/gdb/testsuite/gdb.dwarf2/varval.exp
@@ -48,7 +48,7 @@ proc setup_exec { arg_bad } {
# 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 {
@@ -198,7 +198,7 @@ proc setup_exec { arg_bad } {
}
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}
} {
diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp
index f647f3c..d03626a 100644
--- a/gdb/testsuite/gdb.trace/entry-values.exp
+++ b/gdb/testsuite/gdb.trace/entry-values.exp
@@ -108,7 +108,7 @@ Dwarf::assemble $asm_file {
foo_label: subprogram {
{decl_file 0 udata}
- {MACRO_AT_func { foo ${srcdir}/${subdir}/${srcfile} }}
+ {MACRO_AT_func { foo }}
} {
formal_parameter {
{type :$int_label}
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index f745b2a..ee625c9 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -219,11 +219,11 @@ proc get_func_info { name {options {debug}} } {
# 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.
@@ -621,12 +621,13 @@ namespace eval Dwarf {
# 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] \
@@ -638,7 +639,7 @@ namespace eval Dwarf {
# 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