This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Test adding and removing a symbol file at runtime.


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]