From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14190 invoked by alias); 9 Dec 2014 16:10:09 -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 14177 invoked by uid 89); 9 Dec 2014 16:10:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp12.uk.ibm.com Received: from e06smtp12.uk.ibm.com (HELO e06smtp12.uk.ibm.com) (195.75.94.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 09 Dec 2014 16:10:07 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Dec 2014 16:10:04 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 9 Dec 2014 16:10:01 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 60BD61B08049 for ; Tue, 9 Dec 2014 16:10:21 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sB9GA0c261538318 for ; Tue, 9 Dec 2014 16:10:00 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sB9GA0vJ011624 for ; Tue, 9 Dec 2014 09:10:00 -0700 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sB9G9xq7011596; Tue, 9 Dec 2014 09:09:59 -0700 From: Andreas Arnez To: Pedro Alves Cc: gdb-patches@sourceware.org, Ulrich Weigand Subject: Re: [PATCH 2/2] S390: Fix gdbserver support for TDB References: <1417002962-3424-1-git-send-email-arnez@linux.vnet.ibm.com> <1417002962-3424-3-git-send-email-arnez@linux.vnet.ibm.com> <87iohvp77u.fsf@br87z6lw.de.ibm.com> <547DD8C2.9000403@redhat.com> <8761dtq2rx.fsf@br87z6lw.de.ibm.com> <871togppgg.fsf@br87z6lw.de.ibm.com> <54806247.8050000@redhat.com> Date: Tue, 09 Dec 2014 16:10:00 -0000 In-Reply-To: <54806247.8050000@redhat.com> (Pedro Alves's message of "Thu, 04 Dec 2014 13:31:51 +0000") Message-ID: <877fy0old4.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14120916-0009-0000-0000-0000024FDD02 X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00198.txt.bz2 On Thu, Dec 04 2014, Pedro Alves wrote: > On 12/03/2014 06:18 PM, Andreas Arnez wrote: >> [...] >> >> For illustration, why don't we do something like the (untested) patch >> below? >> >> -- >> diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c >> index 718ae8c..b0f6a22 100644 >> --- a/gdb/gdbserver/regcache.c >> +++ b/gdb/gdbserver/regcache.c >> @@ -52,6 +52,8 @@ get_thread_regcache (struct thread_info *thread, int fetch) >> struct thread_info *saved_thread = current_thread; >> >> current_thread = thread; >> + memset (regcache->register_status, REG_UNAVAILABLE, >> + regcache->tdesc->num_registers); > > This makes sense to me, it's similar to gdb's own handling. > See gdb/regcache.c:regcache_raw_read (and regcache_invalidate). > > Can you check the patch on x86 too, please? You'll need the > same #ifdef guard as init_register_cache uses; s390 > doesn't build the IPA. > >> fetch_inferior_registers (regcache, -1); >> current_thread = saved_thread; >> regcache->registers_valid = 1; OK, did that, and it seems to work for me with the #ifdef guard added. See the updated patch set: https://sourceware.org/ml/gdb-patches/2014-12/msg00193.html -- Andreas