gdbserver: Fix build on MIPS

Message ID 20250116011055.4022193-1-sergiodj@sergiodj.net
State New
Headers
Series gdbserver: Fix build on MIPS |

Checks

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

Commit Message

Sergio Durigan Junior Jan. 16, 2025, 1:10 a.m. UTC
  Commit 3470a0e144df6c01f8479fa649f43aa907936e7e inadvertently broke
the build on MIPS because it's passing a non-existent "pid" argument
to "proc->for_each_thread".  This commit fixes the problem by removing
the argument from the call.

Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
---
 gdbserver/linux-mips-low.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Marchi Jan. 16, 2025, 2:26 a.m. UTC | #1
On 2025-01-15 20:10, Sergio Durigan Junior wrote:
> Commit 3470a0e144df6c01f8479fa649f43aa907936e7e inadvertently broke
> the build on MIPS because it's passing a non-existent "pid" argument
> to "proc->for_each_thread".  This commit fixes the problem by removing
> the argument from the call.
> 
> Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
> ---
>  gdbserver/linux-mips-low.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc
> index 98733709fa3..fafcdefbb06 100644
> --- a/gdbserver/linux-mips-low.cc
> +++ b/gdbserver/linux-mips-low.cc
> @@ -623,7 +623,7 @@ mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
>  				  &priv->watch_mirror);
>  
>    /* Only update the threads of this process.  */
> -  proc->for_each_thread (pid, update_watch_registers_callback);
> +  proc->for_each_thread (update_watch_registers_callback);
>  
>    return 0;
>  }

Thanks for catching this.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon
  
Sergio Durigan Junior Jan. 16, 2025, 4:07 a.m. UTC | #2
On Wednesday, January 15 2025, Simon Marchi wrote:

> On 2025-01-15 20:10, Sergio Durigan Junior wrote:
>> Commit 3470a0e144df6c01f8479fa649f43aa907936e7e inadvertently broke
>> the build on MIPS because it's passing a non-existent "pid" argument
>> to "proc->for_each_thread".  This commit fixes the problem by removing
>> the argument from the call.
>> 
>> Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
>> ---
>>  gdbserver/linux-mips-low.cc | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc
>> index 98733709fa3..fafcdefbb06 100644
>> --- a/gdbserver/linux-mips-low.cc
>> +++ b/gdbserver/linux-mips-low.cc
>> @@ -623,7 +623,7 @@ mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
>>  				  &priv->watch_mirror);
>>  
>>    /* Only update the threads of this process.  */
>> -  proc->for_each_thread (pid, update_watch_registers_callback);
>> +  proc->for_each_thread (update_watch_registers_callback);
>>  
>>    return 0;
>>  }
>
> Thanks for catching this.
>
> Approved-By: Simon Marchi <simon.marchi@efficios.com>

Thanks; pushed.
  
Joel Brobecker Jan. 16, 2025, 4:53 a.m. UTC | #3
Hi Sergio,

On Wed, Jan 15, 2025 at 11:07:20PM -0500, Sergio Durigan Junior wrote:
> On Wednesday, January 15 2025, Simon Marchi wrote:
> 
> > On 2025-01-15 20:10, Sergio Durigan Junior wrote:
> >> Commit 3470a0e144df6c01f8479fa649f43aa907936e7e inadvertently broke
> >> the build on MIPS because it's passing a non-existent "pid" argument
> >> to "proc->for_each_thread".  This commit fixes the problem by removing
> >> the argument from the call.
> >> 
> >> Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
> >> ---
> >>  gdbserver/linux-mips-low.cc | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >> 
> >> diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc
> >> index 98733709fa3..fafcdefbb06 100644
> >> --- a/gdbserver/linux-mips-low.cc
> >> +++ b/gdbserver/linux-mips-low.cc
> >> @@ -623,7 +623,7 @@ mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
> >>  				  &priv->watch_mirror);
> >>  
> >>    /* Only update the threads of this process.  */
> >> -  proc->for_each_thread (pid, update_watch_registers_callback);
> >> +  proc->for_each_thread (update_watch_registers_callback);
> >>  
> >>    return 0;
> >>  }
> >
> > Thanks for catching this.
> >
> > Approved-By: Simon Marchi <simon.marchi@efficios.com>
> 
> Thanks; pushed.

Branch gdb-16-branch also contains
3470a0e144df6c01f8479fa649f43aa907936e7e,
so I'm wondering if it might be worth backporting
this change to that branch as well?

(just in time for teh 16.1 release, which is currently
scheduled for this weekend!)
  
Sergio Durigan Junior Jan. 16, 2025, 4:28 p.m. UTC | #4
On Wednesday, January 15 2025, Joel Brobecker wrote:

> Hi Sergio,

Hey Joel!

> On Wed, Jan 15, 2025 at 11:07:20PM -0500, Sergio Durigan Junior wrote:
>> On Wednesday, January 15 2025, Simon Marchi wrote:
>> 
>> > On 2025-01-15 20:10, Sergio Durigan Junior wrote:
>> >> Commit 3470a0e144df6c01f8479fa649f43aa907936e7e inadvertently broke
>> >> the build on MIPS because it's passing a non-existent "pid" argument
>> >> to "proc->for_each_thread".  This commit fixes the problem by removing
>> >> the argument from the call.
>> >> 
>> >> Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
>> >> ---
>> >>  gdbserver/linux-mips-low.cc | 2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >> 
>> >> diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc
>> >> index 98733709fa3..fafcdefbb06 100644
>> >> --- a/gdbserver/linux-mips-low.cc
>> >> +++ b/gdbserver/linux-mips-low.cc
>> >> @@ -623,7 +623,7 @@ mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
>> >>  				  &priv->watch_mirror);
>> >>  
>> >>    /* Only update the threads of this process.  */
>> >> -  proc->for_each_thread (pid, update_watch_registers_callback);
>> >> +  proc->for_each_thread (update_watch_registers_callback);
>> >>  
>> >>    return 0;
>> >>  }
>> >
>> > Thanks for catching this.
>> >
>> > Approved-By: Simon Marchi <simon.marchi@efficios.com>
>> 
>> Thanks; pushed.
>
> Branch gdb-16-branch also contains
> 3470a0e144df6c01f8479fa649f43aa907936e7e,
> so I'm wondering if it might be worth backporting
> this change to that branch as well?

Yep, I was going to raise this with you but forgot to do that yesterday.
I can do the backport if you want, but I may have forgotten the proper
dance.  Do I still need to create a bug?

> (just in time for teh 16.1 release, which is currently
> scheduled for this weekend!)

Great!

Cheers,
  
Joel Brobecker Jan. 17, 2025, 2:35 a.m. UTC | #5
> > Branch gdb-16-branch also contains
> > 3470a0e144df6c01f8479fa649f43aa907936e7e,
> > so I'm wondering if it might be worth backporting
> > this change to that branch as well?
> 
> Yep, I was going to raise this with you but forgot to do that yesterday.
> I can do the backport if you want, but I may have forgotten the proper
> dance.  Do I still need to create a bug?

PR-s are only required after the .1, so you're good. All you need
is to cherry-pick the commit into the gdb-16-branch.

Thank you!
  
Sergio Durigan Junior Jan. 17, 2025, 2:50 a.m. UTC | #6
On Thursday, January 16 2025, Joel Brobecker wrote:

>> > Branch gdb-16-branch also contains
>> > 3470a0e144df6c01f8479fa649f43aa907936e7e,
>> > so I'm wondering if it might be worth backporting
>> > this change to that branch as well?
>> 
>> Yep, I was going to raise this with you but forgot to do that yesterday.
>> I can do the backport if you want, but I may have forgotten the proper
>> dance.  Do I still need to create a bug?
>
> PR-s are only required after the .1, so you're good. All you need
> is to cherry-pick the commit into the gdb-16-branch.

Thanks; pushed!  And this time I remembered to add the Approved-By :-).
  

Patch

diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc
index 98733709fa3..fafcdefbb06 100644
--- a/gdbserver/linux-mips-low.cc
+++ b/gdbserver/linux-mips-low.cc
@@ -623,7 +623,7 @@  mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
 				  &priv->watch_mirror);
 
   /* Only update the threads of this process.  */
-  proc->for_each_thread (pid, update_watch_registers_callback);
+  proc->for_each_thread (update_watch_registers_callback);
 
   return 0;
 }