From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22458 invoked by alias); 19 Dec 2011 21:49:47 -0000 Received: (qmail 22445 invoked by uid 22791); 19 Dec 2011 21:49:43 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,TW_CP,TW_EG X-Spam-Check-By: sourceware.org Received: from e06smtp18.uk.ibm.com (HELO e06smtp18.uk.ibm.com) (195.75.94.114) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Dec 2011 21:49:27 +0000 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Dec 2011 21:49:25 -0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com ([9.149.39.225]) by e06smtp18.uk.ibm.com ([192.168.101.148]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 19 Dec 2011 21:49:18 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBJLnIxQ2510870 for ; Mon, 19 Dec 2011 21:49:18 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBJLnIXE010108 for ; Mon, 19 Dec 2011 14:49:18 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id pBJLnGgE010099; Mon, 19 Dec 2011 14:49:16 -0700 Message-Id: <201112192149.pBJLnGgE010099@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 19 Dec 2011 22:49:16 +0100 Subject: [commit, s390] Fix regression in gdb.base/callfuncs.exp [Re: [commit, s390] Proper handling of PSW address/mask everywhere] To: jan.kratochvil@redhat.com (Jan Kratochvil) Date: Mon, 19 Dec 2011 22:39:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20111219194636.GA8429@host2.jankratochvil.net> from "Jan Kratochvil" at Dec 19, 2011 08:46:36 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 11121921-6892-0000-0000-000000824E73 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00653.txt.bz2 Jan Kratochvil wrote: > On Wed, 30 Nov 2011 17:09:25 +0100, Ulrich Weigand wrote: > > Tested with no regression on s390x-ibm-linux (with -m31 and -m64) and > > on s390-ibm-linux, all both native and gdbserver. Fixes the above > > step-resume-infcall.exp regressions. > > I see a regression for s390x with -m31, RHEL-6.2, kernel-2.6.32-220.el6.s390x. Interesting, I had tested with a current kernel where I don't see that regression. But I do see it with an older kernel as well ... > return 7 > Make add return now? (y or n) y > -#0 main () at ./gdb.base/callfuncs.c:655 > -655 t_structs_c(struct_val1); > -(gdb) PASS: gdb.base/callfuncs.exp: back at main after return from call dummy breakpoint > +Couldn't write registers: Invalid argument. > +(gdb) FAIL: gdb.base/callfuncs.exp: back at main after return from call dummy breakpoint > > GDB reads PC as 0x8aaabbbb and triess to write it back as 0x0aaabbbb. > > I rather did not try to fix it. > > #0 error (string=0x80d7b3aa "%s.") at utils.c:810 > #1 in perror_with_name (string=0x80daa600 "Couldn't write registers") at utils.c:1195 > #2 in store_regs (regcache=0x8cb90eb0, tid=51221, regnum=1) at s390-nat.c:269 > #3 in s390_linux_store_inferior_registers (ops=0x8c8ca340, regcache=0x8cb90eb0, regnum=1) at s390-nat.c:411 > #4 in target_store_registers (regcache=0x8cb90eb0, regno=1) at target.c:3585 > #5 in regcache_raw_write (regcache=0x8cb90eb0, regnum=1, buf=0x3ffff8d2b20 "") at regcache.c:877 > #6 in regcache_cooked_write (regcache=0x8cb90eb0, regnum=1, buf=0x3ffff8d2b20 "") at regcache.c:889 > #7 in regcache_restore (dst=0x8cb90eb0, cooked_read=0x8033a870 , cooked_read_context=0x8cc55e80) at regcache.c:358 > #8 in regcache_cpy (dst=0x8cb90eb0, src=0x8cc55e80) at regcache.c:382 > #9 in frame_pop (this_frame=0x8c9350e8) at frame.c:835 > #10 in return_command (retval_exp=0x8c709777 "7", from_tty=0) at stack.c:2402 Looks like there is a place where I forgot to preserve the addressing mode bit. Fixed by the following patch. Tested with no regression (fixing the callfuncs.exp one) on s390x (-m31,-m64). Committed to mainline and 7.4 branch. Bye, Ulrich ChangeLog: * s390-tdep.c (s390_push_dummy_call): Set addressing mode bit in return PSWA. Index: gdb/s390-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/s390-tdep.c,v retrieving revision 1.201 diff -u -p -r1.201 s390-tdep.c --- gdb/s390-tdep.c 7 Dec 2011 13:31:05 -0000 1.201 +++ gdb/s390-tdep.c 19 Dec 2011 20:59:28 -0000 @@ -2749,9 +2749,15 @@ s390_push_dummy_call (struct gdbarch *gd } } - /* Store return address. */ + /* Store return PSWA. In 31-bit mode, keep addressing mode bit. */ + if (word_size == 4) + { + ULONGEST pswa; + regcache_cooked_read_unsigned (regcache, S390_PSWA_REGNUM, &pswa); + bp_addr = (bp_addr & 0x7fffffff) | (pswa & 0x80000000); + } regcache_cooked_write_unsigned (regcache, S390_RETADDR_REGNUM, bp_addr); - + /* Store updated stack pointer. */ regcache_cooked_write_unsigned (regcache, S390_SP_REGNUM, sp); -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com