From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2842 invoked by alias); 29 Jan 2016 18:57:26 -0000 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 Received: (qmail 2828 invoked by uid 89); 29 Jan 2016 18:57:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Supply, cooked, Hx-languages-length:1608, speak X-HELO: e06smtp14.uk.ibm.com Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 29 Jan 2016 18:57:24 +0000 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Jan 2016 18:57:21 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 29 Jan 2016 18:57:20 -0000 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: arnez@linux.vnet.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id CFF0E2190046 for ; Fri, 29 Jan 2016 18:57:06 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0TIvJYN3014980 for ; Fri, 29 Jan 2016 18:57:19 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0TIvJsv030535 for ; Fri, 29 Jan 2016 13:57:19 -0500 Received: from oc1027705133.ibm.com (dyn-9-152-212-180.boeblingen.de.ibm.com [9.152.212.180]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0TIvIBV030513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 29 Jan 2016 13:57:19 -0500 From: Andreas Arnez To: Marcin =?utf-8?Q?Ko=C5=9Bcielnicki?= Cc: gdb-patches@sourceware.org, Ulrich Weigand Subject: Re: [PATCH 2/8] gdb/s390: Fill write_guessed_tracepoint_pc hook. References: <1453637529-26972-1-git-send-email-koriakin@0x04.net> <1453637529-26972-3-git-send-email-koriakin@0x04.net> <56A7C855.6090806@0x04.net> Date: Fri, 29 Jan 2016 18:57:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16012918-0017-0000-0000-00000700489A X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00724.txt.bz2 On Tue, Jan 26 2016, Marcin Ko=C5=9Bcielnicki wrote: > If write_guessed_tracepoint_pc is called, we explicitely have no > registers data other than PC itself - there's no original PSWA to > speak of. The state of PSWA high bit probably doesn't matter all that > much, but since we want to mark PSWA as known, we'd better write the > reasonable value to it. That's true if the new gdbarch method implements a very specific semantic, tailored to the singular use in tracefile_fetch_registers and not necessarily usable for any other purposes. But I interpreted the semantic more generically: "Supply VAL as the new PC to the given REGCACHE". Maybe the generic approach could be implemented like this (completely untested): /* Adjust PSWA high bit if in 31-bit mode. */ if (sz =3D=3D 4) { if (regcache_register_status (regcache, S390_PSWA_REGNUM) =3D=3D REG_VALID) { gdb_byte pswa[4]; regcache_raw_collect (regcache, S390_PSWA_REGNUM, pswa); pc |=3D 0x80000000 & extract_unsigned_integer (pswa, 4, byte_order); } else pc |=3D 0x80000000; } BTW, even this may be considered a special case of a hypothetical gdbarch method pseudo_register_supply(). *Or* we might think of it as writing to a "cache-only" (rather than read-only) regcache via a usual regcache_cooked_write(). In this case no new gdbarch method would be needed. Such a feature might also come handy when trying to support the modification of cooked registers during core file debugging, such as discussed in this thread: https://www.sourceware.org/ml/gdb/2011-02/msg00042.html -- Andreas