RFA: handle "MiniDebuginfo" section

Yufeng Zhang Yufeng.Zhang@arm.com
Tue Dec 11 16:42:00 GMT 2012


Hi Tom,

On 26/11/12 19:20, Tom Tromey wrote:
> diff --git a/gdb/testsuite/gdb.base/gnu-debugdata.exp b/gdb/testsuite/gdb.base/gnu-debugdata.exp
> new file mode 100644
> index 0000000..f876309
[snip]
> +# Extract the dynamic symbols from the main binary, there is no need
> +# to also have these in the normal symbol table.
> +remote_file host delete ${binfile}.dynsyms
> +if {[pipeline "nm -D" \
> +        [list [transform nm] "-D ${binfile} --format=posix --defined-only"] \
> +        [list awk "\\{print\\ \\\$1\\}"] \
> +        [list sort "" "" "${binfile}.dynsyms"]]} {
> +    return -1
> +}

The test can fail when there is no dynamic symbols in the binary file as 
'nm' will return 1 with an error message of "No symbols"; binaries for 
baremetal targets usually don't have dynamic symbols.  In such a case, I 
think the test should generate an empty ${binfile}.dynsyms and continue. 
  Or maybe the tests should only be run for linux targets?

> +# Inject the compressed data into the .gnu_debugdata section of the
> +# original binary.
> +remote_file host delete ${binfile}.mini_debuginfo.xz
> +if {[run "xz" "xz" "${binfile}.mini_debuginfo"]} {
> +    return -1
> +}

This creates a dependency on 'xz'.  I think either its availability 
should be checked before the test (and return UNSUPPORTED if 'xz' not 
found), or 'xz' should be documented as required in the section of 
"Requirements for Building GDB".


Thanks,
Yufeng



More information about the Gdb-patches mailing list