GNU Binutils with patches for OS216
リビジョン | 0df0352ad0b64e884977d8251cf1b88b6640600f (tree) |
---|---|
日時 | 2019-09-30 06:58:21 |
作者 | Tom de Vries <tdevries@suse...> |
コミッター | Tom de Vries |
[gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
When running a test-case gdb.base/foo.exp with cc-with-dwz-m, a file
build/gdb/testsuite/outputs/gdb.base/foo/foo.dwz will be created, alongside
executable build/gdb/testsuite/outputs/gdb.base/foo/foo.
This can cause problems in f.i. test-cases that test file name completion.
Make these problems less likely by moving foo.dwz to a .tmp subdir:
build/gdb/testsuite/outputs/gdb.base/foo/.tmp/foo.dwz.
Tested on x86_64-linux.
gdb/ChangeLog:
2019-09-29 Tom de Vries <tdevries@suse.de>
* contrib/cc-with-tweaks.sh (get_tmpdir): New function.
Use $tmpdir/$(basename "$output_file").dwz instead of
"${output_file}.dwz".
gdb/testsuite/ChangeLog:
2019-09-29 Tom de Vries <tdevries@suse.de>
@@ -1,3 +1,9 @@ | ||
1 | +2019-09-29 Tom de Vries <tdevries@suse.de> | |
2 | + | |
3 | + * contrib/cc-with-tweaks.sh (get_tmpdir): New function. | |
4 | + Use $tmpdir/$(basename "$output_file").dwz instead of | |
5 | + "${output_file}.dwz". | |
6 | + | |
1 | 7 | 2019-09-28 Simon Marchi <simon.marchi@polymtl.ca> |
2 | 8 | |
3 | 9 | PR gdb/25045 |
@@ -163,6 +163,12 @@ then | ||
163 | 163 | exit 1 |
164 | 164 | fi |
165 | 165 | |
166 | +get_tmpdir () | |
167 | +{ | |
168 | + tmpdir=$(dirname "$output_file")/.tmp | |
169 | + mkdir -p "$tmpdir" | |
170 | +} | |
171 | + | |
166 | 172 | if [ "$want_objcopy_compress" = true ]; then |
167 | 173 | $OBJCOPY --compress-debug-sections "$output_file" |
168 | 174 | rc=$? |
@@ -202,17 +208,19 @@ if [ "$want_dwz" = true ]; then | ||
202 | 208 | ;; |
203 | 209 | esac |
204 | 210 | elif [ "$want_multi" = true ]; then |
211 | + get_tmpdir | |
212 | + dwz_file=$tmpdir/$(basename "$output_file").dwz | |
205 | 213 | # Remove the dwz output file if it exists, so we don't mistake it for a |
206 | 214 | # new file in case dwz fails. |
207 | - rm -f "${output_file}.dwz" | |
215 | + rm -f "$dwz_file" | |
208 | 216 | |
209 | 217 | cp $output_file ${output_file}.alt |
210 | - $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null | |
218 | + $DWZ -m "$dwz_file" "$output_file" ${output_file}.alt > /dev/null | |
211 | 219 | rm -f ${output_file}.alt |
212 | 220 | |
213 | 221 | # Validate dwz's work by checking if the expected output file exists. |
214 | - if [ ! -f "${output_file}.dwz" ]; then | |
215 | - echo "$myname: dwz file ${output_file}.dwz missing." | |
222 | + if [ ! -f "$dwz_file" ]; then | |
223 | + echo "$myname: dwz file $dwz_file missing." | |
216 | 224 | exit 1 |
217 | 225 | fi |
218 | 226 | fi |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2019-09-29 Tom de Vries <tdevries@suse.de> |
2 | 2 | |
3 | + * gdb.dwarf2/gdb-index.exp: Handle new location of .dwz file. | |
4 | + | |
5 | +2019-09-29 Tom de Vries <tdevries@suse.de> | |
6 | + | |
3 | 7 | * gdb.dwarf2/gdb-index.exp: Use with_test_prefix for second objcopy. |
4 | 8 | |
5 | 9 | 2019-09-27 Tom de Vries <tdevries@suse.de> |
@@ -34,8 +34,10 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \ | ||
34 | 34 | |
35 | 35 | proc add_gdb_index { program } { |
36 | 36 | set index_file ${program}.gdb-index |
37 | - set dwz ${program}.dwz | |
38 | - set dwz_index_file ${dwz}.gdb-index | |
37 | + set dir [file dirname ${program}] | |
38 | + set filename [file tail ${program}] | |
39 | + set dwz $dir/.tmp/${filename}.dwz | |
40 | + set dwz_index_file $program.dwz.gdb-index | |
39 | 41 | verbose -log "index_file: ${index_file}" |
40 | 42 | remote_file host delete ${index_file} |
41 | 43 | remote_file host delete ${dwz_index_file} |