+2020-07-17 Tom de Vries <tdevries@suse.de>
+
+ * gdb.dlang/circular.c (found): Use found_label as label name.
+ * gdb.dwarf2/arr-subrange.c (main): Use main_label as label name.
+ * gdb.dwarf2/comp-unit-lang.c (func): Use func_label as label name.
+ * gdb.dlang/circular.exp: Use MACRO_AT_func and MACRO_AT_range.
+ * gdb.dwarf2/ada-linkage-name.exp: Same.
+ * gdb.dwarf2/arr-subrange.exp: Same.
+ * gdb.dwarf2/atomic-type.exp: Same.
+ * gdb.dwarf2/comp-unit-lang.exp: Same.
+ * gdb.dwarf2/cpp-linkage-name.exp: Same.
+ * gdb.dwarf2/dw2-bad-mips-linkage-name.exp: Same.
+ * gdb.dwarf2/dw2-lexical-block-bare.exp: Same.
+ * gdb.dwarf2/dw2-regno-invalid.exp: Same.
+ * gdb.dwarf2/implptr-64bit.exp: Same.
+ * gdb.dwarf2/imported-unit-abstract-const-value.exp: Same.
+ * gdb.dwarf2/imported-unit-runto-main.exp: Same.
+ * gdb.dwarf2/imported-unit.exp: Same.
+ * gdb.dwarf2/main-subprogram.exp: Same.
+ * gdb.dwarf2/missing-type-name.exp: Same.
+ * gdb.dwarf2/nonvar-access.exp: Same.
+ * gdb.dwarf2/struct-with-sig.exp: Same.
+ * gdb.dwarf2/typedef-void-finish.exp: Same.
+ * gdb.dwarf2/void-type.exp: Same.
+
2020-07-17 Tom de Vries <tdevries@suse.de>
* lib/dwarf.exp (Dwarf::MACRO_AT_func, Dwarf::MACRO_AT_range): Drop
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-asm ("circular1_found_start: .globl circular1_found_start");
-
/* DWARF will describe this function as being inside a D module. */
void
found (void)
{
+ asm ("found_label: .globl found_label");
}
-asm ("circular1_found_end: .globl circular1_found_end");
-
int
main (void)
{
}
subprogram {
- {name found}
{external 1 flag_present}
- {low_pc circular1_found_start addr}
- {high_pc circular1_found_end addr}
+ {MACRO_AT_func {found}}
}
}
Dwarf::assemble $asm_file {
global srcdir subdir srcfile
- lassign [function_range first ${srcdir}/${subdir}/${srcfile}] \
- first_start first_length
-
- lassign [function_range second ${srcdir}/${subdir}/${srcfile}] \
- second_start second_length
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_Ada95}
DW_TAG_subprogram {
{name system__namefirst}
{linkage_name __gnat_namefirst}
- {low_pc $first_start addr}
- {high_pc "$first_start + $first_length" addr}
+ {MACRO_AT_range {first}}
{type :$b_l}
}
# Here the linkage name comes first and the name second.
DW_TAG_subprogram {
{linkage_name __gnat_namesecond}
{name system__namesecond}
- {low_pc $second_start addr}
- {high_pc "$second_start + $second_length" addr}
+ {MACRO_AT_range {second}}
{type :$b_l}
}
}
int
main (void)
{
+ asm ("main_label: .globl main_label");
return 0;
}
{DW_AT_language @DW_LANG_Ada95}
{DW_AT_name foo.adb}
{DW_AT_comp_dir /tmp}
- {DW_AT_low_pc 0x1000 addr}
- {DW_AT_high_pc 0x2000 addr}
+ {MACRO_AT_range {main}}
} {
declare_labels boolean_label typedef_label array_label enum_label
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- set f_result [function_range f ${srcdir}/${subdir}/${srcfile}]
- set f_start [lindex $f_result 0]
- set f_length [lindex $f_result 1]
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_C11}
}
DW_TAG_subprogram {
- {name f}
- {low_pc $f_start addr}
- {high_pc "$f_start + $f_length" addr}
+ {MACRO_AT_func {f}}
{type :$i_l}
} {
DW_TAG_formal_parameter {
asm (".section \".text\"");
asm (".balign 8");
-asm ("func_start: .globl func_start");
static void
func (void)
{
+ asm ("func_label: .globl func_label");
}
-asm ("func_end: .globl func_end");
-
int
main (void)
{
compile_unit {
{name file1.txt}
{language @$cu_lang}
- {low_pc func_start addr}
- {high_pc func_end addr}
+ {MACRO_AT_range {func}}
} {
subprogram {
{external 1 flag}
- {name func}
- {low_pc func_start addr}
- {high_pc func_end addr}
+ {MACRO_AT_func {func}}
} {
}
}
# Set up the DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \
- main_start main_length
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_C_plus_plus}
}
}
DW_TAG_subprogram {
- {name "main"}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_func {main}}
{type :$a_l}
}
DW_TAG_variable {
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- set f_result [function_range f ${srcdir}/${subdir}/${srcfile}]
- set f_start [lindex $f_result 0]
- set f_length [lindex $f_result 1]
-
- set g_result [function_range g ${srcdir}/${subdir}/${srcfile}]
- set g_start [lindex $g_result 0]
- set g_length [lindex $g_result 1]
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_C_plus_plus}
{DW_AT_name bool}
}
DW_TAG_subprogram {
- {name f}
- {low_pc $f_start addr}
- {high_pc "$f_start + $f_length" addr}
+ {MACRO_AT_func {f}}
{type :$b_l}
{DW_AT_MIPS_linkage_name _Z1fv}
}
DW_TAG_subprogram {
- {name g}
- {low_pc $g_start addr}
- {high_pc "$g_start + $g_length" addr}
+ {MACRO_AT_func {g}}
{type :$b_l}
{DW_AT_MIPS_linkage_name 42 DW_FORM_data1}
}
return 0
}
-standard_testfile .S main.c
+standard_testfile main.c .S
# Make some DWARF for the test.
-set asm_file [standard_output_file $srcfile]
+set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile2
-
- set main_result [function_range main ${srcdir}/${subdir}/${srcfile2}]
- set main_start [lindex $main_result 0]
- set main_length [lindex $main_result 1]
-
cu {} {
compile_unit {
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_range {main}}
} {
declare_labels integer_label
}
DW_TAG_subprogram {
- {name main}
+ {MACRO_AT_func {main}}
{DW_AT_external 1 flag}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
} {
DW_TAG_lexical_block {
} {
}
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile2 $asm_file] {nodebug}] } {
+ [list $srcfile $asm_file] {nodebug}] } {
return -1
}
return 0
}
-standard_testfile .S main.c
+standard_testfile main.c .S
# Make some DWARF for the test.
-set asm_file [standard_output_file $srcfile]
+set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
cu {} {
compile_unit {
- {low_pc [gdb_target_symbol main] DW_FORM_addr}
- {high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr}
+ {MACRO_AT_range {main}}
} {
declare_labels integer_label
}
DW_TAG_subprogram {
- {name main}
{DW_AT_external 1 flag}
- {low_pc [gdb_target_symbol main] DW_FORM_addr}
- {high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr}
+ {MACRO_AT_func {main}}
} {
DW_TAG_variable {
{DW_AT_name bregx}
}
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile2 $asm_file] {nodebug}] } {
+ [list $srcfile $asm_file] {nodebug}] } {
return -1
}
if { !$two_cu } {
subprogram {
- { name main }
- { low_pc main addr }
- { high_pc "main+0x100" addr }
+ {MACRO_AT_func {main}}
{ type :$int_label }
{ external 1 flag }
} {
{ name 1.c }
} {
subprogram {
- { name main }
- { low_pc main addr }
- { high_pc "main+0x100" addr }
+ { MACRO_AT_func {main} }
{ type %$int_label }
{ external 1 flag }
} {
declare_labels aaa_label
set int_size [get_sizeof "int" 4]
- global srcdir subdir srcfile
-
- set main_range [function_range main ${srcdir}/${subdir}/${srcfile}]
- set main_start [lindex $main_range 0]
- set main_length [lindex $main_range 1]
-
cu {} {
cu_label: partial_unit {
{language @DW_LANG_C}
}
subprogram {
{abstract_origin %$main_label}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_range {main}}
}
}
}
declare_labels aaa_label
set int_size [get_sizeof "int" 4]
- global srcdir subdir srcfile
-
- set main_range [function_range main ${srcdir}/${subdir}/${srcfile}]
- set main_start [lindex $main_range 0]
- set main_length [lindex $main_range 1]
-
cu {} {
cu_label: partial_unit {
{language @DW_LANG_C}
} {
subprogram {
{abstract_origin %$main_label}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_range {main}}
}
}
}
set int_size [get_sizeof "int" 4]
set addr_size [get_sizeof "void *" 8]
- global srcdir subdir srcfile
-
- set main_range [function_range main ${srcdir}/${subdir}/${srcfile}]
- set main_start [lindex $main_range 0]
- set main_length [lindex $main_range 1]
-
- set doit_range [function_range doit ${srcdir}/${subdir}/${srcfile}]
- set doit_start [lindex $doit_range 0]
- set doit_length [lindex $doit_range 1]
-
cu {} {
compile_unit {
{language @DW_LANG_C_plus_plus}
}
subprogram {
{abstract_origin %$main_label}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_range {main}}
} {
subprogram {
{abstract_origin %$doit_label}
- {low_pc $doit_start addr}
- {high_pc "$doit_start + $doit_length" addr}
+ {MACRO_AT_range {doit}}
} {
formal_parameter {
{abstract_origin %$doit_self_label}
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- set range [function_range mymain ${srcdir}/${subdir}/${srcfile}]
- set mymain_start [lindex $range 0]
- set mymain_length [lindex $range 1]
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_language @DW_LANG_C}
}
DW_TAG_subprogram {
- {name mymain}
- {low_pc $mymain_start addr}
- {high_pc "$mymain_start + $mymain_length" addr}
+ {MACRO_AT_func {mymain}}
{type :$type}
{DW_AT_main_subprogram 1 flag}
} {
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- set func_result [function_range func ${srcdir}/${subdir}/${srcfile}]
- set func_start [lindex $func_result 0]
- set func_length [lindex $func_result 1]
-
- set main_result [function_range main ${srcdir}/${subdir}/${srcfile}]
- set main_start [lindex $main_result 0]
- set main_length [lindex $main_result 1]
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_producer "GNU C 8.1"}
}
DW_TAG_subprogram {
- {name func}
- {low_pc $func_start addr}
- {high_pc "$func_start + $func_length" addr}
+ {MACRO_AT_func func}
{type :$int_type}
}
DW_TAG_subprogram {
- {name main}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_func main}
{type :$main_type}
}
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- set range [function_range main ${srcdir}/${subdir}/${srcfile}]
- set main_start [lindex $range 0]
- set main_length [lindex $range 1]
-
cu {} {
compile_unit {
{DW_AT_name main.c}
}
DW_TAG_subprogram {
- {name main}
+ {MACRO_AT_func {main}}
{DW_AT_external 1 flag}
- {low_pc [gdb_target_symbol main] DW_FORM_addr}
- {high_pc "$main_start + $main_length" DW_FORM_addr}
} {
# Simple variable without location.
DW_TAG_variable {
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \
- main_start main_length
-
- lassign [function_range foo ${srcdir}/${subdir}/${srcfile}] \
- foo_start foo_length
-
cu {} {
compile_unit {
{DW_AT_language @DW_LANG_C}
{declaration 1 flag}
}
DW_TAG_subprogram {
- {name "main"}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_func {main}}
}
}
}
{declaration 1 flag}
}
DW_TAG_subprogram {
- {name "foo"}
- {low_pc $foo_start addr}
- {high_pc "$foo_start + $foo_length" addr}
+ {MACRO_AT_func {foo}}
}
}
}
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- set func_result [function_range func ${srcdir}/${subdir}/${srcfile}]
- set func_start [lindex $func_result 0]
- set func_length [lindex $func_result 1]
-
- set main_result [function_range main ${srcdir}/${subdir}/${srcfile}]
- set main_start [lindex $main_result 0]
- set main_length [lindex $main_result 1]
-
cu {} {
DW_TAG_compile_unit {
{DW_AT_producer "GNU C 8.1"}
}
DW_TAG_subprogram {
- {name func}
- {low_pc $func_start addr}
- {high_pc "$func_start + $func_length" addr}
+ {MACRO_AT_func {func}}
{type :$void_typedef}
}
DW_TAG_subprogram {
- {name main}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_func {main}}
{type :$main_type}
}
}
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
- global srcdir subdir srcfile
-
- set func_result [function_range func ${srcdir}/${subdir}/${srcfile}]
- set func_start [lindex $func_result 0]
- set func_length [lindex $func_result 1]
-
- set main_result [function_range main ${srcdir}/${subdir}/${srcfile}]
- set main_start [lindex $main_result 0]
- set main_length [lindex $main_result 1]
-
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_TAG_subprogram {
- {name func}
- {low_pc $func_start addr}
- {high_pc "$func_start + $func_length" addr}
+ {MACRO_AT_func {func}}
{type :$void_type}
}
DW_TAG_subprogram {
- {name main}
- {low_pc $main_start addr}
- {high_pc "$main_start + $main_length" addr}
+ {MACRO_AT_func {main}}
{type :$int_type}
}