[patch v4 2/3] Test adding and removing a symbol file at runtime.

Luis Machado lgustavo@codesourcery.com
Wed May 29 09:48:00 GMT 2013


Hi,

More nits

On 05/29/2013 11:13 AM, Nicolas Blanc wrote:
> +unsigned char inline elf_st_type (unsigned char st_info)
> +{
> +  return ELF32_ST_TYPE (st_info);
> +}
> +#endif
> +
> +

Double empty line here. There are more occurrences of this throughout 
the testcase.

> +void gdb_add_symbol_file (void* addr, const char* file)
> +{
> +  return;
> +}
> +
> +

Here.

> +void gdb_remove_symbol_file (void* addr)
> +{
> +  return;
> +}
> +
> +

Here.

> +struct segment
> +{
> +  char* mapped_addr;
> +  Elf_Phdr* phdr;
> +  struct segment* next;
> +};
> +
> +

Here and so on.

> +# Test adding and removing a symbol file dynamically:
> +# 1)  Load the main executable.
> +# 2)  Run to GDB_ADD_SYMBOl_FILE in $srcfile.
> +# 3)  Set a pending breakpoint at BAR in $libsrc.
> +# 4)  Load $shlib_name using 'add-symbol-file'.
> +# 5)  Continue to BAR in $libsrc.
> +# 6)  Set a breakpiont at FOO in $librc.
> +# 7)  Continue to FOO in $libsrc.
> +# 8)  Set a breakpoint at GDB_REMOVE_SYMBOL_FILE.
> +# 9)  Continue to GDB_REMOVE_SYMBOL_FILE in $srcfile.
> +# 10) Remove $shlib_name using 'remove-symbol-file'.
> +# 11) Check that the breakpoints at FOO and BAR are pending.
> +# 12) Check that the execution can continue without error.
> +
> +

Double empty line again.

> +if [skip_shlib_tests] {
> +    return 0
> +}
> +
> +
> +if [is_remote target] {
> +    return 0
> +}
> +
> +set target_size TARGET_UNKNOWN
> +if [is_lp64_target] {
> +    set target_size TARGET_LP64
> +} elseif [is_ilp32_target] {
> +   set target_size TARGET_ILP32
> +} else {
> +    return 0
> +}
> +
> +set testfile sym-file-main
> +set libfile sym-file-lib
> +set srcfile ${testfile}.c
> +set binfile ${objdir}/${subdir}/${testfile}
> +
> +set libsrc "${srcdir}/${subdir}/${libfile}.c"
> +set libname "${libfile}.so"
> +set shlib_name "${objdir}/${subdir}/${libname}"
> +set libobj "${objdir}/${subdir}/${libname}"
> +set execsrc "${srcdir}/${subdir}/${srcfile}"
> +set exec_opts [list debug "additional_flags=-D$target_size -DSHLIB_NAME\\=\"$shlib_name\""]

I'm wondering if the newer function "prepare_for_testing" can be used 
here to prevent having to deal with all these individual options.



More information about the Gdb-patches mailing list