Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
@ 2019-08-22 14:42 Tom de Vries
  2019-09-06 15:28 ` [PING][PATCH][gdb/contrib] " Tom de Vries
  2019-09-28 20:09 ` [PATCH][gdb/contrib] " Kevin Buettner
  0 siblings, 2 replies; 5+ messages in thread
From: Tom de Vries @ 2019-08-22 14:42 UTC (permalink / raw)
  To: gdb-patches

Hi,

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.

OK for trunk?

Thanks,
- Tom

[gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir

gdb/ChangeLog:

2019-08-22  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/contrib/cc-with-tweaks.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
index 7df16bc6c1..98c4f89afc 100755
--- a/gdb/contrib/cc-with-tweaks.sh
+++ b/gdb/contrib/cc-with-tweaks.sh
@@ -163,6 +163,12 @@ then
     exit 1
 fi
 
+get_tmpdir ()
+{
+    tmpdir=$(dirname "$output_file")/.tmp
+    mkdir -p "$tmpdir"
+}
+
 if [ "$want_objcopy_compress" = true ]; then
     $OBJCOPY --compress-debug-sections "$output_file"
     rc=$?
@@ -202,17 +208,19 @@ if [ "$want_dwz" = true ]; then
 	;;
     esac
 elif [ "$want_multi" = true ]; then
+    get_tmpdir
+    dwz_file=$tmpdir/$(basename "$output_file").dwz
     # Remove the dwz output file if it exists, so we don't mistake it for a
     # new file in case dwz fails.
-    rm -f "${output_file}.dwz"
+    rm -f "$dwz_file"
 
     cp $output_file ${output_file}.alt
-    $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null
+    $DWZ -m "$dwz_file" "$output_file" ${output_file}.alt > /dev/null
     rm -f ${output_file}.alt
 
     # Validate dwz's work by checking if the expected output file exists.
-    if [ ! -f "${output_file}.dwz" ]; then
-	echo "$myname: dwz file ${output_file}.dwz missing."
+    if [ ! -f "$dwz_file" ]; then
+	echo "$myname: dwz file $dwz_file missing."
 	exit 1
     fi
 fi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PING][PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
  2019-08-22 14:42 [PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir Tom de Vries
@ 2019-09-06 15:28 ` Tom de Vries
  2019-09-13 19:50   ` [PING^2][PATCH][gdb/contrib] " Tom de Vries
  2019-09-28 20:09 ` [PATCH][gdb/contrib] " Kevin Buettner
  1 sibling, 1 reply; 5+ messages in thread
From: Tom de Vries @ 2019-09-06 15:28 UTC (permalink / raw)
  To: gdb-patches

On 22-08-19 16:42, Tom de Vries wrote:
> Hi,
> 
> 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.
> 
> OK for trunk?

Ping.

Thanks,
- Tom

> [gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
> 
> gdb/ChangeLog:
> 
> 2019-08-22  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/contrib/cc-with-tweaks.sh | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
> index 7df16bc6c1..98c4f89afc 100755
> --- a/gdb/contrib/cc-with-tweaks.sh
> +++ b/gdb/contrib/cc-with-tweaks.sh
> @@ -163,6 +163,12 @@ then
>      exit 1
>  fi
>  
> +get_tmpdir ()
> +{
> +    tmpdir=$(dirname "$output_file")/.tmp
> +    mkdir -p "$tmpdir"
> +}
> +
>  if [ "$want_objcopy_compress" = true ]; then
>      $OBJCOPY --compress-debug-sections "$output_file"
>      rc=$?
> @@ -202,17 +208,19 @@ if [ "$want_dwz" = true ]; then
>  	;;
>      esac
>  elif [ "$want_multi" = true ]; then
> +    get_tmpdir
> +    dwz_file=$tmpdir/$(basename "$output_file").dwz
>      # Remove the dwz output file if it exists, so we don't mistake it for a
>      # new file in case dwz fails.
> -    rm -f "${output_file}.dwz"
> +    rm -f "$dwz_file"
>  
>      cp $output_file ${output_file}.alt
> -    $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null
> +    $DWZ -m "$dwz_file" "$output_file" ${output_file}.alt > /dev/null
>      rm -f ${output_file}.alt
>  
>      # Validate dwz's work by checking if the expected output file exists.
> -    if [ ! -f "${output_file}.dwz" ]; then
> -	echo "$myname: dwz file ${output_file}.dwz missing."
> +    if [ ! -f "$dwz_file" ]; then
> +	echo "$myname: dwz file $dwz_file missing."
>  	exit 1
>      fi
>  fi
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PING^2][PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
  2019-09-06 15:28 ` [PING][PATCH][gdb/contrib] " Tom de Vries
@ 2019-09-13 19:50   ` Tom de Vries
  0 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2019-09-13 19:50 UTC (permalink / raw)
  To: gdb-patches

On 06-09-19 17:28, Tom de Vries wrote:
> On 22-08-19 16:42, Tom de Vries wrote:
>> Hi,
>>
>> 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.
>>
>> OK for trunk?
> 

Ping^2.

Thanks,
- Tom

>> [gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
>>
>> gdb/ChangeLog:
>>
>> 2019-08-22  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/contrib/cc-with-tweaks.sh | 16 ++++++++++++----
>>  1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
>> index 7df16bc6c1..98c4f89afc 100755
>> --- a/gdb/contrib/cc-with-tweaks.sh
>> +++ b/gdb/contrib/cc-with-tweaks.sh
>> @@ -163,6 +163,12 @@ then
>>      exit 1
>>  fi
>>  
>> +get_tmpdir ()
>> +{
>> +    tmpdir=$(dirname "$output_file")/.tmp
>> +    mkdir -p "$tmpdir"
>> +}
>> +
>>  if [ "$want_objcopy_compress" = true ]; then
>>      $OBJCOPY --compress-debug-sections "$output_file"
>>      rc=$?
>> @@ -202,17 +208,19 @@ if [ "$want_dwz" = true ]; then
>>  	;;
>>      esac
>>  elif [ "$want_multi" = true ]; then
>> +    get_tmpdir
>> +    dwz_file=$tmpdir/$(basename "$output_file").dwz
>>      # Remove the dwz output file if it exists, so we don't mistake it for a
>>      # new file in case dwz fails.
>> -    rm -f "${output_file}.dwz"
>> +    rm -f "$dwz_file"
>>  
>>      cp $output_file ${output_file}.alt
>> -    $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null
>> +    $DWZ -m "$dwz_file" "$output_file" ${output_file}.alt > /dev/null
>>      rm -f ${output_file}.alt
>>  
>>      # Validate dwz's work by checking if the expected output file exists.
>> -    if [ ! -f "${output_file}.dwz" ]; then
>> -	echo "$myname: dwz file ${output_file}.dwz missing."
>> +    if [ ! -f "$dwz_file" ]; then
>> +	echo "$myname: dwz file $dwz_file missing."
>>  	exit 1
>>      fi
>>  fi
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
  2019-08-22 14:42 [PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir Tom de Vries
  2019-09-06 15:28 ` [PING][PATCH][gdb/contrib] " Tom de Vries
@ 2019-09-28 20:09 ` Kevin Buettner
  2019-09-29 22:01   ` Tom de Vries
  1 sibling, 1 reply; 5+ messages in thread
From: Kevin Buettner @ 2019-09-28 20:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom de Vries

On Thu, 22 Aug 2019 16:42:22 +0200
Tom de Vries <tdevries@suse.de> wrote:

> 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.
> 
> OK for trunk?
> 
> Thanks,
> - Tom
> 
> [gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
> 
> gdb/ChangeLog:
> 
> 2019-08-22  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".

LGTM.

Kevin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
  2019-09-28 20:09 ` [PATCH][gdb/contrib] " Kevin Buettner
@ 2019-09-29 22:01   ` Tom de Vries
  0 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2019-09-29 22:01 UTC (permalink / raw)
  To: Kevin Buettner, gdb-patches; +Cc: Simon Marchi

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

On 28-09-19 22:09, Kevin Buettner wrote:
> On Thu, 22 Aug 2019 16:42:22 +0200
> Tom de Vries <tdevries@suse.de> wrote:
> 
>> 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.
>>
>> OK for trunk?
>>
>> Thanks,
>> - Tom
>>
>> [gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
>>
>> gdb/ChangeLog:
>>
>> 2019-08-22  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".
> 
> LGTM.

Thanks for the review, committed.

I retested before committing and found a regression because I didn't
update gdb.dwarf2/gdb-index.exp accordingly. That's fixed in the
committed version, attached below.

Thanks,
- Tom


[-- Attachment #2: 0001-gdb-contrib-cc-with-tweaks.sh-Create-.dwz-file-in-.tmp-subdir.patch --]
[-- Type: text/x-patch, Size: 3027 bytes --]

[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-08-22  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>

        * gdb.dwarf2/gdb-index.exp: Handle new location of .dwz file.

---
 gdb/contrib/cc-with-tweaks.sh          | 16 ++++++++++++----
 gdb/testsuite/gdb.dwarf2/gdb-index.exp |  6 ++++--
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
index 7df16bc6c1c..98c4f89afc9 100755
--- a/gdb/contrib/cc-with-tweaks.sh
+++ b/gdb/contrib/cc-with-tweaks.sh
@@ -163,6 +163,12 @@ then
     exit 1
 fi
 
+get_tmpdir ()
+{
+    tmpdir=$(dirname "$output_file")/.tmp
+    mkdir -p "$tmpdir"
+}
+
 if [ "$want_objcopy_compress" = true ]; then
     $OBJCOPY --compress-debug-sections "$output_file"
     rc=$?
@@ -202,17 +208,19 @@ if [ "$want_dwz" = true ]; then
 	;;
     esac
 elif [ "$want_multi" = true ]; then
+    get_tmpdir
+    dwz_file=$tmpdir/$(basename "$output_file").dwz
     # Remove the dwz output file if it exists, so we don't mistake it for a
     # new file in case dwz fails.
-    rm -f "${output_file}.dwz"
+    rm -f "$dwz_file"
 
     cp $output_file ${output_file}.alt
-    $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null
+    $DWZ -m "$dwz_file" "$output_file" ${output_file}.alt > /dev/null
     rm -f ${output_file}.alt
 
     # Validate dwz's work by checking if the expected output file exists.
-    if [ ! -f "${output_file}.dwz" ]; then
-	echo "$myname: dwz file ${output_file}.dwz missing."
+    if [ ! -f "$dwz_file" ]; then
+	echo "$myname: dwz file $dwz_file missing."
 	exit 1
     fi
 fi
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
index b14e07fa55d..1fe993accf8 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
@@ -34,8 +34,10 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
 
 proc add_gdb_index { program } {
     set index_file ${program}.gdb-index
-    set dwz ${program}.dwz
-    set dwz_index_file ${dwz}.gdb-index
+    set dir [file dirname ${program}]
+    set filename [file tail ${program}]
+    set dwz $dir/.tmp/${filename}.dwz
+    set dwz_index_file $program.dwz.gdb-index
     verbose -log "index_file: ${index_file}"
     remote_file host delete ${index_file}
     remote_file host delete ${dwz_index_file}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-29 22:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22 14:42 [PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir Tom de Vries
2019-09-06 15:28 ` [PING][PATCH][gdb/contrib] " Tom de Vries
2019-09-13 19:50   ` [PING^2][PATCH][gdb/contrib] " Tom de Vries
2019-09-28 20:09 ` [PATCH][gdb/contrib] " Kevin Buettner
2019-09-29 22:01   ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox