This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb/hppa-tdep.c: Fix a logical typo bug found by compiler warning
- From: Chen Gang <gang dot chen dot 5i5j at gmail dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 15 Oct 2014 05:43:15 +0800
- Subject: Re: [PATCH] gdb/hppa-tdep.c: Fix a logical typo bug found by compiler warning
- Authentication-results: sourceware.org; auth=none
- References: <543D93DD dot 5000906 at gmail dot com> <87d29uxrvg dot fsf at igel dot home>
On 10/15/2014 05:29 AM, Andreas Schwab wrote:
> Chen Gang <gang.chen.5i5j@gmail.com> writes:
>
>> && (((inst >> 6) & 0xf) == 0x8
>> - || (inst >> 6) & 0xf) == 0x9))
>> + || ((inst >> 6) & 0xf) == 0x9)))
>
> ((inst >> 6) & 0xe) == 8
>
> Andreas.
>
I guess, your fixing may like below, which will be a different logical
working flow.
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 627f31a..3112732 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1402,8 +1402,8 @@ inst_saves_gr (unsigned long inst)
too. */
if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18
|| ((inst >> 26) == 0x3
- && (((inst >> 6) & 0xf) == 0x8
- || (inst >> 6) & 0xf) == 0x9))
+ && ((inst >> 6) & 0xf) == 0x8
+ || ((inst >> 6) & 0xf) == 0x9))
return hppa_extract_5R_store (inst);
return 0;
If you are sure it is, please help send related patch with more details
comments for it (excuse me, I am not quite familiar the related logical
details).
Thanks.
--
Chen Gang
Open share and attitude like air water and life which God blessed