gdbserver: remove unused for loop

Message ID OS3P286MB21526C37D0DF8D10963532CDF04E9@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM
State Committed
Commit b7098e650c9f1ced654c939bebd4b70e7d028132
Headers
Series gdbserver: remove unused for loop |

Commit Message

Enze Li Sept. 22, 2022, 1:30 p.m. UTC
  In this commit,

  commit cf6c1e710ee162a5adb0ae47acb731f2bfecc956
  Date:   Mon Jul 11 20:53:48 2022 +0800

    gdbserver: remove unused variable

I removed an unused variable in handle_v_run.  Pedro then pointed out
that the for loop after it was also unused.  After a period of smoke
testing, no exceptions were found.

Tested on x86_64-linux.
---
 gdbserver/server.cc | 3 ---
 1 file changed, 3 deletions(-)


base-commit: aaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916
  

Comments

Simon Marchi Sept. 22, 2022, 4:13 p.m. UTC | #1
On 2022-09-22 09:30, Enze Li via Gdb-patches wrote:
> In this commit,
> 
>   commit cf6c1e710ee162a5adb0ae47acb731f2bfecc956
>   Date:   Mon Jul 11 20:53:48 2022 +0800
> 
>     gdbserver: remove unused variable
> 
> I removed an unused variable in handle_v_run.  Pedro then pointed out
> that the for loop after it was also unused.  After a period of smoke
> testing, no exceptions were found.
> 
> Tested on x86_64-linux.
> ---
>  gdbserver/server.cc | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/gdbserver/server.cc b/gdbserver/server.cc
> index c619206d5d2d..366a843ea894 100644
> --- a/gdbserver/server.cc
> +++ b/gdbserver/server.cc
> @@ -2984,9 +2984,6 @@ handle_v_run (char *own_buf)
>    char *new_program_name = NULL;
>    int i;
>  
> -  for (p = own_buf + strlen ("vRun;"); p && *p; p = strchr (p, ';'))
> -    p++;
> -
>    for (i = 0, p = own_buf + strlen ("vRun;"); *p; p = next_p, ++i)
>      {
>        next_p = strchr (p, ';');
> 
> base-commit: aaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916

Thanks, this is ok.

Simon
  
Enze Li Sept. 24, 2022, 4:13 a.m. UTC | #2
On Thu, Sep 22 2022 at 12:13:25 PM -0400, Simon Marchi wrote:

> On 2022-09-22 09:30, Enze Li via Gdb-patches wrote:
>> In this commit,
>> 
>>   commit cf6c1e710ee162a5adb0ae47acb731f2bfecc956
>>   Date:   Mon Jul 11 20:53:48 2022 +0800
>> 
>>     gdbserver: remove unused variable
>> 
>> I removed an unused variable in handle_v_run.  Pedro then pointed out
>> that the for loop after it was also unused.  After a period of smoke
>> testing, no exceptions were found.
>> 
>> Tested on x86_64-linux.
>> ---
>>  gdbserver/server.cc | 3 ---
>>  1 file changed, 3 deletions(-)
>> 
>> diff --git a/gdbserver/server.cc b/gdbserver/server.cc
>> index c619206d5d2d..366a843ea894 100644
>> --- a/gdbserver/server.cc
>> +++ b/gdbserver/server.cc
>> @@ -2984,9 +2984,6 @@ handle_v_run (char *own_buf)
>>    char *new_program_name = NULL;
>>    int i;
>>  
>> -  for (p = own_buf + strlen ("vRun;"); p && *p; p = strchr (p, ';'))
>> -    p++;
>> -
>>    for (i = 0, p = own_buf + strlen ("vRun;"); *p; p = next_p, ++i)
>>      {
>>        next_p = strchr (p, ';');
>> 
>> base-commit: aaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916
>
> Thanks, this is ok.
>
> Simon

Thanks, Simon.  Pushed.

Enze
  

Patch

diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index c619206d5d2d..366a843ea894 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -2984,9 +2984,6 @@  handle_v_run (char *own_buf)
   char *new_program_name = NULL;
   int i;
 
-  for (p = own_buf + strlen ("vRun;"); p && *p; p = strchr (p, ';'))
-    p++;
-
   for (i = 0, p = own_buf + strlen ("vRun;"); *p; p = next_p, ++i)
     {
       next_p = strchr (p, ';');