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] Add test for Fission DWP files with binary+dwp in different directories


On Sat, 08 Feb 2014 02:38:44 +0100, Doug Evans wrote:
> --- a/gdb/testsuite/gdb.base/Makefile.in
> +++ b/gdb/testsuite/gdb.base/Makefile.in
> @@ -51,7 +51,8 @@ MISCELLANEOUS = coremmap.data dprintf-pendshr.sl ../foobar.baz fixsectshr.sl \
>  	unloadshr.sl unloadshr2.sl watchpoint-solib-shr.sl \
>  	weaklib1.sl weaklib2.sl hashline1.c hashline2.c hashline3.c \
>  	auxv.gcore bigcore.corefile *.core *.debug *.stripped \
> -	gcore-buffer-overflow.test gcore.test shreloc.txt tmp-fullname.c
> +	gcore-buffer-overflow.test gcore.test shreloc.txt tmp-fullname.c \
> +	argv0-*
>  
>  all info install-info dvi install uninstall installcheck check:
>  	@echo "Nothing to be done for $@..."
> @@ -60,7 +61,7 @@ clean mostlyclean:
>  	-rm -f *~ *.o a.out xgdb *.x *.ci *.tmp
>  	-rm -f *.dwo *.dwp
>  	-rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
> -	-rm -f $(MISCELLANEOUS)
> +	-rm -rf $(MISCELLANEOUS)

These two changes are not right:
	make clean
	git status
->
	deleted: gdb.base/argv0-symlink.c
	deleted: gdb.base/argv0-symlink.exp


>  distclean maintainer-clean realclean: clean
>  	-rm -f *~ core
> diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
> index 0e0202d..6b6a8ad 100644
> --- a/gdb/testsuite/gdb.base/argv0-symlink.exp
> +++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
> @@ -15,10 +15,18 @@
>  
>  standard_testfile
>  
> +# With Fission DWP files, most of the debug info is in ${testfile}.dwp.
> +# Remove the file first.  If it gets created by build_executable then we
> +# know we have one.
> +set dwp_file [standard_output_file ${testfile}.dwp]
> +remote_file host delete $dwp_file
> +
>  if { [build_executable ${testfile}.exp ${testfile} ${srcfile}] == -1 } {
>      return -1
>  }
>  
> +set have_fission_dwp [remote_file host exists $dwp_file]
> +
>  set test "kept file symbolic link name"
>  set filelink "${testfile}-filelink"
>  
> @@ -73,3 +81,38 @@ if ![is_remote target] {
>  }
>  gdb_test {print argv[0]} "/$dirlink/$filelink\"" $test
>  gdb_test "info inferiors" "/$lastdir/$filelink *" "$test for info inferiors"
> +
> +# For Fission with DWP files, verify the following scenario works:
> +# dir1/real-binary-with-random-name
> +# dir2/real-dwp-with-random-name
> +# dir3/symlink-to-real-binary
> +# dir3/symlink-to-real-binary.dwp
> +
> +if { $have_fission_dwp } {
> +    set dwp_bin_dir [standard_output_file argv0-dwp1]
> +    set dwp_dwp_dir [standard_output_file argv0-dwp2]
> +    set dwp_symlink_dir [standard_output_file argv0-dwp3]
> +    set dwp_real_binary "dwp-abc"
> +    set dwp_real_dwp "dwp-def"
> +    set dwp_symlink_binary "argv0-dwp-binary"
> +    set dwp_symlink_dwp "${dwp_symlink_binary}.dwp"
> +

Here should be
	rm -rf $dwp_bin_dir $dwp_dwp_dir $dwp_symlink_dir
as otherwise
	rm -rf gdb.base/argv0-dwp1/; touch gdb.base/argv0-dwp1
	runtest-dwp gdb.base/argv0-symlink.exp
produces false
	ERROR: Couldn't load .../argv0-dwp3/argv0-dwp-binary into .../testsuite/../../gdb/gdb.


> +    remote_exec host "mkdir $dwp_bin_dir"
> +    remote_exec host "mkdir $dwp_dwp_dir"
> +    remote_exec host "mkdir $dwp_symlink_dir"
> +    remote_exec host "cp [standard_output_file $testfile] $dwp_bin_dir/$dwp_real_binary"
> +    remote_exec host "cp $dwp_file $dwp_dwp_dir/$dwp_real_dwp"
> +    # We don't test for failure to create the symlink here.
> +    # We assume that if the above symlinks are created ok, these will be too.
> +    remote_exec host "ln -sf $dwp_bin_dir/$dwp_real_binary $dwp_symlink_dir/$dwp_symlink_binary"
> +    remote_exec host "ln -sf $dwp_dwp_dir/$dwp_real_dwp $dwp_symlink_dir/$dwp_symlink_dwp"
> +
> +    clean_restart "$dwp_symlink_dir/$dwp_symlink_binary"
> +
> +    if ![runto_main] {

> +	untested "could not run to main"

Not needed as runto already prints an error if it fails.


> +	return -1
> +    }
> +
> +    gdb_test {print argv[0]} ".*/$dwp_symlink_binary\"" "symlinks with fission dwp"
> +}

Nitpick: here could be
else {
	untested "symlinks with fission dwp (no .dwp support)"
}


Jan


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