Re: [PATCH] Fix macro info lookup for binaries containing DWARFv5 line table

Tom Tromey
2021-05-13T15:48:06Z

>>>>> ">" == Sourabh Singh Tomar via Gdb-patches <gdb-patches@sourceware.org> writes:

>> +standard_testfile
>> +set additional_flags {debug}
>> +file copy -force $srcdir/$subdir/$srcfile [standard_output_file $srcfile]
>> +gdb_compile outputs/gdb.base/dwarf5-macro/dwarf5-macro.c $binfile executable {debug}

If the copying is really needed, then a comment explaining why would be
helpful.

I'm not sure if "file copy" can be used. You may want to see what other
tests do, I think maybe dejagnu provides some wrapper. Not really sure.

This set 'additional_flags' but doesn't use it. You could just drop the
assignment.

>> +if { [test_compiler_info "gcc-*"] } {
>> + set options "additional_flags=-g3"
>> +} elseif { [test_compiler_info "clang-*"] } {
>> + set options "additional_flags=-gdwarf-5 -fdebug-macro"

It seems like you'd want to pass -gdwarf-5 to gcc as well?

>> +if { [prepare_for_testing "failed to prepare" \
>> + ${testfile} ${srcfile}] } {

No need to break this line, I think.

>> +set filepat {dwarf5-macro.[ch]}
>> +set definition {}
>> +set location {}
>> +set nonzero {[1-9][0-9]*}

None of these are used.

Tom