This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] Test adding and removing a symbol file at runtime.
- From: Tom Tromey <tromey at redhat dot com>
- To: Nicolas Blanc <nicolas dot blanc at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 23 Apr 2013 14:24:56 -0600
- Subject: Re: [PATCH 2/3] Test adding and removing a symbol file at runtime.
- References: <1366098721-18302-1-git-send-email-nicolas dot blanc at intel dot com> <1366098721-18302-4-git-send-email-nicolas dot blanc at intel dot com>
>>>>> "Nicolas" == Nicolas Blanc <nicolas.blanc@intel.com> writes:
Nicolas> This test exercises the commands 'add-symbol-file'
Nicolas> and 'remove-symbol-file'.
Thank you.
Nicolas> +#include </usr/include/elf.h>
This line seems wrong.
It seems simpler to do the test by using an ordinary .so and then
calling remove-symbol-file on it. Then perhaps it could even work on
some non-ELF systems. Would this not work for some reason?
Nicolas> +# 6) Set a breakpiont at FOO in $librc.
Two typos, "breakpoint" and "$libsrc".
Nicolas> +set testfile sym-file-main
Nicolas> +set libfile sym-file-lib
Nicolas> +set srcfile ${testfile}.c
Nicolas> +set binfile ${objdir}/${subdir}/${testfile}
Nicolas> +
Nicolas> +set libsrc "${srcdir}/${subdir}/${libfile}.c"
Nicolas> +set libname "${libfile}.so"
Nicolas> +set shlib_name "${objdir}/${subdir}/${libname}"
Nicolas> +set libobj "${objdir}/${subdir}/${libname}"
Nicolas> +set execsrc "${srcdir}/${subdir}/${srcfile}"
This should use standard_testfile and standard_output_file.
Nicolas> +gdb_exit
Nicolas> +gdb_start
Nicolas> +gdb_reinitialize_dir $srcdir/$subdir
Nicolas> +
Nicolas> +# 1) Load the main executable.
Nicolas> +set result [gdb_load ${binfile}]
Nicolas> +if { $result != 0 } then {
Nicolas> + return
Nicolas> +}
clean_restart
Nicolas> +# 6) Set a breakpoint at FOO in $libsrc.
Nicolas> +set result [gdb_breakpoint foo]
Nicolas> +if { !$result } then {
Nicolas> + return
I think most .exp files don't bother checking each result like this.
It is enough for one thing to report a fail; the test may limp on.
That said I don't really mind either way.
Tom