* gdb.base/break-interp.exp: Remove $exec.debug safety removal.
* gdb.base/sepdebug.exp: Remove .debug subdirectory handling. New
variable different_dir. Move debugfile into a full directory pathname
under DIFFERENT_DIR.
* lib/gdb.exp (separate_debug_filename): Remove.
(gdb_gnu_strip_debug): No longer call separate_debug_filename. Remove
variable debug_dir and mkdir of it. Update function comments.
+2010-05-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.base/break-interp.exp: Remove $exec.debug safety removal.
+ * gdb.base/sepdebug.exp: Remove .debug subdirectory handling. New
+ variable different_dir. Move debugfile into a full directory pathname
+ under DIFFERENT_DIR.
+ * lib/gdb.exp (separate_debug_filename): Remove.
+ (gdb_gnu_strip_debug): No longer call separate_debug_filename. Remove
+ variable debug_dir and mkdir of it. Update function comments.
+
2010-04-29 Pedro Alves <pedro@codesourcery.com>
PR gdb/11557
}
if {$binsepdebug == "SEP"} {
gdb_gnu_strip_debug $exec
- # Just a sanity check. As gdb_gnu_strip_debug uses the
- # "[file dirname $exec]/.debug/[file tail $exec].debug"
- # variant delete the higher-priority exec.debug file.
- file delete "$exec.debug"
}
# Supply a self-sufficent directory $dir with the required
# ${binfile}, which is just like the executable ($binfile) but without
# the debuginfo. Instead $binfile has a .gnudebuglink section which contains
# the name of a debuginfo only file. This file will be stored in the
-# gdb.base/.debug subdirectory.
+# gdb.base/ subdirectory.
if [gdb_gnu_strip_debug $binfile] {
# check that you have a recent version of strip and objcopy installed
# now move the .debug file to a different location so that we can test
# the "set debug-file-directory" command.
-
-remote_exec build "mv ${objdir}/${subdir}/.debug/${testfile}.debug ${objdir}/${subdir}"
-set debugfile "${objdir}/${subdir}/${testfile}.debug"
-test_different_dir debuglink "${objdir}/${subdir}" 0
+set different_dir "${objdir}/${subdir}/${testfile}.dir"
+set debugfile "${different_dir}/${objdir}/${subdir}/${testfile}.debug"
+remote_exec build "rm -rf $different_dir"
+remote_exec build "mkdir -p [file dirname $debugfile]"
+remote_exec build "mv -f ${objdir}/${subdir}/${testfile}.debug $debugfile"
+
+test_different_dir debuglink $different_dir 0
# Test CRC mismatch is reported.
if {[build_executable sepdebug.exp sepdebug2 sepdebug2.c debug] != -1
&& ![gdb_gnu_strip_debug ${objdir}/${subdir}/sepdebug2]} {
- remote_exec build "cp ${debugfile} ${objdir}/${subdir}/.debug/sepdebug2.debug"
+ remote_exec build "cp ${debugfile} ${objdir}/${subdir}/sepdebug2.debug"
gdb_exit
gdb_start
set escapedobjdirsubdir [string_to_regexp ${objdir}/${subdir}]
- gdb_test "file ${objdir}/${subdir}/sepdebug2" "warning: the debug information found in \"${escapedobjdirsubdir}/\\.debug/sepdebug2\\.debug\" does not match \"${escapedobjdirsubdir}/sepdebug2\" \\(CRC mismatch\\)\\..*\\(no debugging symbols found\\).*" "CRC mismatch is reported"
+ gdb_test "file ${objdir}/${subdir}/sepdebug2" "warning: the debug information found in \"${escapedobjdirsubdir}/sepdebug2\\.debug\" does not match \"${escapedobjdirsubdir}/sepdebug2\" \\(CRC mismatch\\)\\..*\\(no debugging symbols found\\).*" "CRC mismatch is reported"
}
# Note: the procedure gdb_gnu_strip_debug will produce an executable called
# ${binfile}.dbglnk, which is just like the executable ($binfile) but without
# the debuginfo. Instead $binfile has a .gnu_debuglink section which contains
-# the name of a debuginfo only file. This file will be stored in the
-# gdb.base/.debug subdirectory.
+# the name of a debuginfo only file. This file will be stored in the same
+# subdirectory.
# Functions for separate debug info testing
# at the end of the process we have:
# foo.stripped --> foo w/o debug info
-# .debug/foo.debug --> foo's debug info
+# foo.debug --> foo's debug info
# foo --> like foo, but with a new .gnu_debuglink section pointing to foo.debug.
-# Return the name of the file in which we should stor EXEC's separated
-# debug info. EXEC contains the full path.
-proc separate_debug_filename { exec } {
-
- # In a .debug subdirectory off the same directory where the testcase
- # executable is going to be. Something like:
- # <your-path>/gdb/testsuite/gdb.base/.debug/blah.debug.
- # This is the default location where gdb expects to findi
- # the debug info file.
-
- set exec_dir [file dirname $exec]
- set exec_file [file tail $exec]
- set debug_dir [file join $exec_dir ".debug"]
- set debug_file [file join $debug_dir "${exec_file}.debug"]
-
- return $debug_file
-}
-
# Return the build-id hex string (usually 160 bits as 40 hex characters)
# converted to the form: .build-id/ab/cdef1234...89.debug
# Return "" if no build-id found.
proc gdb_gnu_strip_debug { dest args } {
- set debug_file [separate_debug_filename $dest]
+ # Use the first separate debug info file location searched by GDB so the
+ # run cannot be broken by some stale file searched with higher precedence.
+ set debug_file "${dest}.debug"
+
set strip_to_file_program [transform strip]
set objcopy_program [transform objcopy]
- # Make sure the directory that will hold the separated debug
- # info actually exists.
- set debug_dir [file dirname $debug_file]
- if {! [file isdirectory $debug_dir]} {
- file mkdir $debug_dir
- }
-
set debug_link [file tail $debug_file]
set stripped_file "${dest}.stripped"