gdb/testsuite/rocm: fix rocm-multi-inferior-gpu.cpp

Message ID 20230911150410.3050439-1-lancelot.six@amd.com
State New
Headers
Series gdb/testsuite/rocm: fix rocm-multi-inferior-gpu.cpp |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Lancelot SIX Sept. 11, 2023, 3:04 p.m. UTC
  The gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp testcase contains a
call to execl which does not have NULL as a last argument.  This is
an invalid use of execl.  This patch fixes this oversight.

Change-Id: I03b60abe30468d71ba5089b240c6d00f9b8883b2
---
 gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: cdda72c2fa1e47c566c7b5768f3831a1cc11d263
  

Comments

Tom Tromey Sept. 11, 2023, 5:52 p.m. UTC | #1
>>>>> "Lancelot" == Lancelot Six via Gdb-patches <gdb-patches@sourceware.org> writes:

Lancelot> The gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp testcase contains a
Lancelot> call to execl which does not have NULL as a last argument.  This is
Lancelot> an invalid use of execl.  This patch fixes this oversight.

Thank you.  FAOD and for future reference, I think it could have gone in
by the obvious rule.

Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Lancelot SIX Sept. 12, 2023, 8:18 a.m. UTC | #2
On 11/09/2023 18:52, Tom Tromey wrote:
>>>>>> "Lancelot" == Lancelot Six via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Lancelot> The gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp testcase contains a
> Lancelot> call to execl which does not have NULL as a last argument.  This is
> Lancelot> an invalid use of execl.  This patch fixes this oversight.
> 
> Thank you.  FAOD and for future reference, I think it could have gone in
> by the obvious rule.
> 
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom

Thanks,

I have just pushed this patch.

I did wonder if I should use the obv rule for this, but ended up not 
using it.  I'll keep that in mind for future patches!

Best,
Lancelot.
  

Patch

diff --git a/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp b/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp
index ca869233b58..d64afdd1994 100644
--- a/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp
+++ b/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp
@@ -62,7 +62,7 @@  parent (int argc, char **argv)
       if (pid == 0)
 	{
 	  /* Exec to force the child to re-initialize the ROCm runtime.  */
-	  if (execl (argv[0], argv[0], n) == -1)
+	  if (execl (argv[0], argv[0], n, nullptr) == -1)
 	    {
 	      perror ("Failed to exec");
 	      return -1;