Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [AArch64] Fix erroneous use of spu architecture bfd
@ 2020-01-03 19:15 Luis Machado
  2020-01-05  6:27 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado @ 2020-01-03 19:15 UTC (permalink / raw)
  To: gdb-patches; +Cc: Alan.Hayward

While investigating some SVE code, i noticed the use of two spu bfd variables.

This looks like an oversight, as the "id" field is available for non-spu
architectures as well, even though its primary use was the Cell BE
architecture.

The following patch fixes this.

gdb/ChangeLog:

2020-01-03  Luis Machado  <luis.machado@linaro.org>

	* aarch64-linux-nat.c
	(aarch64_linux_nat_target::thread_architecture): Use bfd_arch_aarch64
	and bfd_mach_aarch64.

Change-Id: I817673e9a12cadfa88638870f0ff524241cf6a34
---
 gdb/aarch64-linux-nat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 62f5cdb1fc..4e712ebfb7 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -970,7 +970,7 @@ aarch64_linux_nat_target::thread_architecture (ptid_t ptid)
      unavailable, to distinguish from an unset value of 0.  */
   struct gdbarch_info info;
   gdbarch_info_init (&info);
-  info.bfd_arch_info = bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu);
+  info.bfd_arch_info = bfd_lookup_arch (bfd_arch_aarch64, bfd_mach_aarch64);
   info.id = (int *) (vq == 0 ? -1 : vq);
   return gdbarch_find_by_info (info);
 }
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [AArch64] Fix erroneous use of spu architecture bfd
  2020-01-03 19:15 [PATCH] [AArch64] Fix erroneous use of spu architecture bfd Luis Machado
@ 2020-01-05  6:27 ` Joel Brobecker
  2020-01-05 12:00   ` Luis Machado
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2020-01-05  6:27 UTC (permalink / raw)
  To: Luis Machado; +Cc: gdb-patches, Alan.Hayward

Hi Luis,

> While investigating some SVE code, i noticed the use of two spu bfd variables.
> 
> This looks like an oversight, as the "id" field is available for non-spu
> architectures as well, even though its primary use was the Cell BE
> architecture.
> 
> The following patch fixes this.
> 
> gdb/ChangeLog:
> 
> 2020-01-03  Luis Machado  <luis.machado@linaro.org>
> 
> 	* aarch64-linux-nat.c
> 	(aarch64_linux_nat_target::thread_architecture): Use bfd_arch_aarch64
> 	and bfd_mach_aarch64.
> 
> Change-Id: I817673e9a12cadfa88638870f0ff524241cf6a34


I think the patch looks pretty clear to me ;-), so you can go ahead
and push.

Or perhaps, before doing so: Since the Gerrit experiment is being
put on hold, you might want to remove your commit hook, and then
remove the "Change-Id" field above...

Thanks for the patch!

> ---
>  gdb/aarch64-linux-nat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
> index 62f5cdb1fc..4e712ebfb7 100644
> --- a/gdb/aarch64-linux-nat.c
> +++ b/gdb/aarch64-linux-nat.c
> @@ -970,7 +970,7 @@ aarch64_linux_nat_target::thread_architecture (ptid_t ptid)
>       unavailable, to distinguish from an unset value of 0.  */
>    struct gdbarch_info info;
>    gdbarch_info_init (&info);
> -  info.bfd_arch_info = bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu);
> +  info.bfd_arch_info = bfd_lookup_arch (bfd_arch_aarch64, bfd_mach_aarch64);
>    info.id = (int *) (vq == 0 ? -1 : vq);
>    return gdbarch_find_by_info (info);
>  }
> -- 
> 2.17.1

-- 
Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [AArch64] Fix erroneous use of spu architecture bfd
  2020-01-05  6:27 ` Joel Brobecker
@ 2020-01-05 12:00   ` Luis Machado
  0 siblings, 0 replies; 3+ messages in thread
From: Luis Machado @ 2020-01-05 12:00 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, Alan.Hayward

On 1/5/20 3:27 AM, Joel Brobecker wrote:
> Hi Luis,
> 
>> While investigating some SVE code, i noticed the use of two spu bfd variables.
>>
>> This looks like an oversight, as the "id" field is available for non-spu
>> architectures as well, even though its primary use was the Cell BE
>> architecture.
>>
>> The following patch fixes this.
>>
>> gdb/ChangeLog:
>>
>> 2020-01-03  Luis Machado  <luis.machado@linaro.org>
>>
>> 	* aarch64-linux-nat.c
>> 	(aarch64_linux_nat_target::thread_architecture): Use bfd_arch_aarch64
>> 	and bfd_mach_aarch64.
>>
>> Change-Id: I817673e9a12cadfa88638870f0ff524241cf6a34
> 
> 
> I think the patch looks pretty clear to me ;-), so you can go ahead
> and push.
> 
> Or perhaps, before doing so: Since the Gerrit experiment is being
> put on hold, you might want to remove your commit hook, and then
> remove the "Change-Id" field above...

Done now.

> 
> Thanks for the patch >

Pushed to master. Thanks!


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-05 12:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-03 19:15 [PATCH] [AArch64] Fix erroneous use of spu architecture bfd Luis Machado
2020-01-05  6:27 ` Joel Brobecker
2020-01-05 12:00   ` Luis Machado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox