gdb/testsuite: Fix file location for gdb.base/backtrace-through-cu-nodebug

Message ID 20250120122608.115710-2-guinevere@redhat.com
State New
Headers
Series gdb/testsuite: Fix file location for gdb.base/backtrace-through-cu-nodebug |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Patch failed to apply

Commit Message

Guinevere Larsen Jan. 20, 2025, 12:26 p.m. UTC
  The newly added test gdb.base/backtrace-through-cu-nodebug.exp had a
problem in the call to gdb_comiple, that caused the .o files to be
outputted in the GDB file tree. This commit fixes the issues in the calls.

Reported-By: Tom de Vries <tdevries@suse.de>
---

Hi Tom,

Sorry about that, this patch should fix it. I'm not sure if this counts
as obvious, so I haven't pushed it yet, do let me know if this is ok :)

---
 .../gdb.base/backtrace-through-cu-nodebug.exp      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
  

Comments

Tom de Vries Jan. 20, 2025, 12:46 p.m. UTC | #1
On 1/20/25 13:26, Guinevere Larsen wrote:
> The newly added test gdb.base/backtrace-through-cu-nodebug.exp had a
> problem in the call to gdb_comiple, that caused the .o files to be

Hi Gwen,

gdb_comiple -> gdb_compile

> outputted in the GDB file tree. This commit fixes the issues in the calls.
> 
> Reported-By: Tom de Vries <tdevries@suse.de>

I've tested this, and checked that it fixes the problem.

LGTM.

Approved-By: Tom de Vries <tdevries@suse.de>

Thanks,
- Tom

> ---
> 
> Hi Tom,
> 
> Sorry about that, this patch should fix it. I'm not sure if this counts
> as obvious, so I haven't pushed it yet, do let me know if this is ok :)
> 
> ---
>   .../gdb.base/backtrace-through-cu-nodebug.exp      | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp b/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
> index d6e686539c9..53bf642a92c 100644
> --- a/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
> +++ b/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
> @@ -17,8 +17,8 @@
>   # trace goes through a function with no debug information.
>   
>   standard_testfile -caller.c -main.c
> -set objmainfile ${testfile}-main.o
> -set objcallerfile ${testfile}-caller.o
> +set objmainfile [standard_output_file ${testfile}-main.o]
> +set objcallerfile [standard_output_file ${testfile}-caller.o]
>   
>   # Recompile the inferior with or without CFI information, then run the
>   # inferior until the point where the important test starts.
> @@ -28,7 +28,7 @@ proc prepare_test {has_cfi} {
>       if {$has_cfi} {
>   	set extension "cfi"
>   	if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" \
> -	     "${srcdir}/${subdir}/${objcallerfile}" \
> +	     "${objcallerfile}" \
>   	     object [list {additional_flags=-fomit-frame-pointer \
>   		 -funwind-tables -fasynchronous-unwind-tables}]] != "" } {
>   	    untested "couldn't compile with cfi"
> @@ -37,7 +37,7 @@ proc prepare_test {has_cfi} {
>       } else {
>   	set extension "no-cfi"
>   	if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" \
> -	     "${srcdir}/${subdir}/${objcallerfile}" \
> +	     "${objcallerfile}" \
>   	     object [list {additional_flags=-fomit-frame-pointer \
>   		 -fno-unwind-tables \
>   		 -fno-asynchronous-unwind-tables}]] != "" } {
> @@ -45,8 +45,8 @@ proc prepare_test {has_cfi} {
>   	    return false
>         }
>       }
> -    if {[gdb_compile [list "${srcdir}/${subdir}/${objmainfile}" \
> -	    "${srcdir}/${subdir}/${objcallerfile}"] \
> +    if {[gdb_compile [list "${objmainfile}" \
> +	    "${objcallerfile}"] \
>   	    "${binfile}-${extension}" binfile {}] != ""} {
>   	untested "couldn't link object files"
>   	return false
> @@ -66,7 +66,7 @@ proc prepare_test {has_cfi} {
>   }
>   
>   if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" \
> -	"${srcdir}/${subdir}/${objmainfile}" \
> +	"${objmainfile}" \
>   	object {debug}] != "" } {
>       untested "couldn't compile main file"
>       return
  
Guinevere Larsen Jan. 20, 2025, 12:48 p.m. UTC | #2
On 1/20/25 9:46 AM, Tom de Vries wrote:
> On 1/20/25 13:26, Guinevere Larsen wrote:
>> The newly added test gdb.base/backtrace-through-cu-nodebug.exp had a
>> problem in the call to gdb_comiple, that caused the .o files to be
>
> Hi Gwen,
>
> gdb_comiple -> gdb_compile
>
>> outputted in the GDB file tree. This commit fixes the issues in the 
>> calls.
>>
>> Reported-By: Tom de Vries <tdevries@suse.de>
>
> I've tested this, and checked that it fixes the problem.
>
> LGTM.
>
> Approved-By: Tom de Vries <tdevries@suse.de>
Thanks for the quick review, I've pushed the patch!
  

Patch

diff --git a/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp b/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
index d6e686539c9..53bf642a92c 100644
--- a/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
+++ b/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
@@ -17,8 +17,8 @@ 
 # trace goes through a function with no debug information.
 
 standard_testfile -caller.c -main.c
-set objmainfile ${testfile}-main.o
-set objcallerfile ${testfile}-caller.o
+set objmainfile [standard_output_file ${testfile}-main.o]
+set objcallerfile [standard_output_file ${testfile}-caller.o]
 
 # Recompile the inferior with or without CFI information, then run the
 # inferior until the point where the important test starts.
@@ -28,7 +28,7 @@  proc prepare_test {has_cfi} {
     if {$has_cfi} {
 	set extension "cfi"
 	if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" \
-	     "${srcdir}/${subdir}/${objcallerfile}" \
+	     "${objcallerfile}" \
 	     object [list {additional_flags=-fomit-frame-pointer \
 		 -funwind-tables -fasynchronous-unwind-tables}]] != "" } {
 	    untested "couldn't compile with cfi"
@@ -37,7 +37,7 @@  proc prepare_test {has_cfi} {
     } else {
 	set extension "no-cfi"
 	if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" \
-	     "${srcdir}/${subdir}/${objcallerfile}" \
+	     "${objcallerfile}" \
 	     object [list {additional_flags=-fomit-frame-pointer \
 		 -fno-unwind-tables \
 		 -fno-asynchronous-unwind-tables}]] != "" } {
@@ -45,8 +45,8 @@  proc prepare_test {has_cfi} {
 	    return false
       }
     }
-    if {[gdb_compile [list "${srcdir}/${subdir}/${objmainfile}" \
-	    "${srcdir}/${subdir}/${objcallerfile}"] \
+    if {[gdb_compile [list "${objmainfile}" \
+	    "${objcallerfile}"] \
 	    "${binfile}-${extension}" binfile {}] != ""} {
 	untested "couldn't link object files"
 	return false
@@ -66,7 +66,7 @@  proc prepare_test {has_cfi} {
 }
 
 if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" \
-	"${srcdir}/${subdir}/${objmainfile}" \
+	"${objmainfile}" \
 	object {debug}] != "" } {
     untested "couldn't compile main file"
     return