[RFA,08/13] Fix ravenscar-thread.c to use arch_ops

Message ID 20180712205208.32646-9-tom@tromey.com
State Superseded
Headers show
Series
  • Add -Wunused-variable
Related show

Commit Message

Tom Tromey July 12, 2018, 8:52 p.m.
The change to turn target ops into methods accidentally introduced a
bug in ravenscar-thread.c, changing some calls that were using
"arch_ops" to use the target beneath.

This patch changes ravenscar-thread.c to use these variables where
appropriate.

gdb/ChangeLog
2018-07-12  Tom Tromey  <tom@tromey.com>

	* ravenscar-thread.c (ravenscar_thread_target::store_registers):
	Use arch_ops.
	(ravenscar_thread_target::prepare_to_store): Likewise.
---
 gdb/ChangeLog          | 6 ++++++
 gdb/ravenscar-thread.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.13.6

Comments

Simon Marchi July 14, 2018, 1:25 a.m. | #1
On 2018-07-12 04:52 PM, Tom Tromey wrote:
> The change to turn target ops into methods accidentally introduced a

> bug in ravenscar-thread.c, changing some calls that were using

> "arch_ops" to use the target beneath.

> 

> This patch changes ravenscar-thread.c to use these variables where

> appropriate.

> 

> gdb/ChangeLog

> 2018-07-12  Tom Tromey  <tom@tromey.com>

> 

> 	* ravenscar-thread.c (ravenscar_thread_target::store_registers):

> 	Use arch_ops.

> 	(ravenscar_thread_target::prepare_to_store): Likewise.

> ---

>  gdb/ChangeLog          | 6 ++++++

>  gdb/ravenscar-thread.c | 4 ++--

>  2 files changed, 8 insertions(+), 2 deletions(-)

> 

> diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c

> index 8bd31a5a725..e60fad87466 100644

> --- a/gdb/ravenscar-thread.c

> +++ b/gdb/ravenscar-thread.c

> @@ -442,7 +442,7 @@ ravenscar_thread_target::store_registers (struct regcache *regcache,

>        struct ravenscar_arch_ops *arch_ops

>  	= gdbarch_ravenscar_ops (gdbarch);

>  

> -      beneath ()->store_registers (regcache, regnum);

> +      arch_ops->to_store_registers (regcache, regnum);

>      }

>    else

>      beneath ()->store_registers (regcache, regnum);

> @@ -461,7 +461,7 @@ ravenscar_thread_target::prepare_to_store (struct regcache *regcache)

>        struct ravenscar_arch_ops *arch_ops

>  	= gdbarch_ravenscar_ops (gdbarch);

>  

> -      beneath ()->prepare_to_store (regcache);

> +      arch_ops->to_prepare_to_store (regcache);

>      }

>    else

>      beneath ()->prepare_to_store (regcache);

> 


It looks obvious to me, but let's ping Pedro just to be sure.

Simon
Pedro Alves July 16, 2018, 1:59 p.m. | #2
On 07/14/2018 02:25 AM, Simon Marchi wrote:

> It looks obvious to me, but let's ping Pedro just to be sure.


Whoops.  Yes, this is correct.

Please also merge it to the 8.2 branch.

Thanks,
Pedro Alves
Tom Tromey July 16, 2018, 3:36 p.m. | #3
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:


Pedro> On 07/14/2018 02:25 AM, Simon Marchi wrote:
>> It looks obvious to me, but let's ping Pedro just to be sure.


Pedro> Whoops.  Yes, this is correct.

Pedro> Please also merge it to the 8.2 branch.

Thanks.
I also think the observer notification patch should go on the 8.2
branch.

Tom
Pedro Alves July 16, 2018, 4:43 p.m. | #4
On 07/16/2018 04:36 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

> 

> Pedro> On 07/14/2018 02:25 AM, Simon Marchi wrote:

>>> It looks obvious to me, but let's ping Pedro just to be sure.

> 

> Pedro> Whoops.  Yes, this is correct.

> 

> Pedro> Please also merge it to the 8.2 branch.

> 

> Thanks.

> I also think the observer notification patch should go on the 8.2

> branch.


I think so too.

Thanks,
Pedro Alves

Patch

diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 8bd31a5a725..e60fad87466 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -442,7 +442,7 @@  ravenscar_thread_target::store_registers (struct regcache *regcache,
       struct ravenscar_arch_ops *arch_ops
 	= gdbarch_ravenscar_ops (gdbarch);
 
-      beneath ()->store_registers (regcache, regnum);
+      arch_ops->to_store_registers (regcache, regnum);
     }
   else
     beneath ()->store_registers (regcache, regnum);
@@ -461,7 +461,7 @@  ravenscar_thread_target::prepare_to_store (struct regcache *regcache)
       struct ravenscar_arch_ops *arch_ops
 	= gdbarch_ravenscar_ops (gdbarch);
 
-      beneath ()->prepare_to_store (regcache);
+      arch_ops->to_prepare_to_store (regcache);
     }
   else
     beneath ()->prepare_to_store (regcache);