public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] ppc64: Fix stwux encoding
@ 2018-02-04 20:39 Jan Kratochvil
  2018-02-05 18:46 ` Kevin Buettner
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2018-02-04 20:39 UTC (permalink / raw)
  To: gdb-patches; +Cc: Kevin Buettner

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]

Hi,

with gcc-8.0.1-0.9.fc28.x86_64 I get:

../../gdb/rs6000-tdep.c: In function 'CORE_ADDR skip_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, rs6000_framedata*)':
../../gdb/rs6000-tdep.c:1911:34: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
       else if ((op & 0xfc1f016a) == 0x7c01016e)
                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

The code is there since:
	commit 98f08d3d9b69b344bb8b0cd2a4bda1cf4d966e20
	Author: Kevin Buettner <kevinb@redhat.com>
	Date:   Thu May 29 19:47:14 2003 +0000
		    From Jimi X <jimix@watson.ibm.com>:
		    * rs6000-tdep.c (skip_prologue): Improve support for 64-bit code.
So I do not think we can find the original author.

https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.alangref/idalangref_stwux_stux_instrs.htm
says
	bit 21 - 30 = 183
	Those are bits 1..10 in normal bit order: 183<<1 = 0x16e

OK for check-in?


Jan

[-- Attachment #2: 1 --]
[-- Type: text/plain, Size: 521 bytes --]

gdb/ChangeLog
2018-02-04  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* rs6000-tdep.c (skip_prologue): Fix stwux encoding.

--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1857,7 +1857,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
 	  offset = fdata->offset;
 	  continue;
 	}
-      else if ((op & 0xfc1f016a) == 0x7c01016e)
+      else if ((op & 0xfc1f016e) == 0x7c01016e)
 	{			/* stwux rX,r1,rY */
 	  /* No way to figure out what r1 is going to be.  */
 	  fdata->frameless = 0;

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

* Re: [patch] ppc64: Fix stwux encoding
  2018-02-04 20:39 [patch] ppc64: Fix stwux encoding Jan Kratochvil
@ 2018-02-05 18:46 ` Kevin Buettner
  2018-02-05 19:22   ` [commit] " Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Buettner @ 2018-02-05 18:46 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On Sun, 4 Feb 2018 21:39:23 +0100
Jan Kratochvil <jan.kratochvil@redhat.com> wrote:

> 2018-02-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* rs6000-tdep.c (skip_prologue): Fix stwux encoding.
> 

Okay.

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

* [commit] ppc64: Fix stwux encoding
  2018-02-05 18:46 ` Kevin Buettner
@ 2018-02-05 19:22   ` Jan Kratochvil
  2018-03-16 18:24     ` Pedro Franco de Carvalho
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2018-02-05 19:22 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

On Mon, 05 Feb 2018 19:46:21 +0100, Kevin Buettner wrote:
> On Sun, 4 Feb 2018 21:39:23 +0100 Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> > 2018-02-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > 
> > 	* rs6000-tdep.c (skip_prologue): Fix stwux encoding.
> > 
> 
> Okay.

Checked in:
	72dd27306224497c8ba97f391d30b774d4d973fb


Jan

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

* Re: [commit] ppc64: Fix stwux encoding
  2018-02-05 19:22   ` [commit] " Jan Kratochvil
@ 2018-03-16 18:24     ` Pedro Franco de Carvalho
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Franco de Carvalho @ 2018-03-16 18:24 UTC (permalink / raw)
  To: Jan Kratochvil, Kevin Buettner; +Cc: gdb-patches


Thank you for this patch!

The mask was still too permissive (see PR gdb/18295), so I submitted
another patch fixing that. Sorry I didn't see this before!

Previously the stdux mask also allowed stwux (and more), and the if body
was the same, so it was accidentally working for stwux, despite the
tautological compare.

-- 
Pedro Franco de Carvalho

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

end of thread, other threads:[~2018-03-16 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-04 20:39 [patch] ppc64: Fix stwux encoding Jan Kratochvil
2018-02-05 18:46 ` Kevin Buettner
2018-02-05 19:22   ` [commit] " Jan Kratochvil
2018-03-16 18:24     ` Pedro Franco de Carvalho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).