From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102774 invoked by alias); 9 Aug 2019 11:04:43 -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 102765 invoked by uid 89); 9 Aug 2019 11:04:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Aug 2019 11:04:42 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x79B2iWl122425 for ; Fri, 9 Aug 2019 07:04:39 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2u94e2q2f9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 09 Aug 2019 07:04:39 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Aug 2019 12:04:38 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 9 Aug 2019 12:04:36 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x79B4ZZw34079100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Aug 2019 11:04:35 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 168BF5205A; Fri, 9 Aug 2019 11:04:35 +0000 (GMT) Received: from oc3748833570.ibm.com (unknown [9.152.214.225]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 04AB45205F; Fri, 9 Aug 2019 11:04:35 +0000 (GMT) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id C48D2D80277; Fri, 9 Aug 2019 13:04:34 +0200 (CEST) Subject: Re: [PATCH 3/3] [PowerPC] Fix debug register issues in ppc-linux-nat To: pedromfc@linux.ibm.com (Pedro Franco de Carvalho) Date: Fri, 09 Aug 2019 11:04:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <875zn7iery.fsf@linux.ibm.com> from "Pedro Franco de Carvalho" at Aug 08, 2019 05:27:29 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 19080911-0008-0000-0000-000003070C15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19080911-0009-0000-0000-00004A2514F9 Message-Id: <20190809110434.C48D2D80277@oc3748833570.ibm.com> X-SW-Source: 2019-08/txt/msg00220.txt.bz2 Pedro Franco de Carvalho wrote: > "Ulrich Weigand" writes: > > > This looks generally good to me, just two questions: > > > > - As mentioned in the 1/3 patch, why do you need the low_new_clone > > callback? As I understand it, you'll get low_new_thread called > > immediatedly afterwards, which will mark the thread as "stale", > > and once it is scheduled again, all debug regs will be set up > > from scratch anyway ... > > The reason I did this is so that we have the lwp object of the parent > thread, so that we can copy the correct debug register state. The > arguments for low_new_thread don't include the parent. I think other > targets always know how to clear all the debug registers without keeping > track of anything, but we need to know which slots might already be > installed in a new thread. I may still be missing something, but why exactly *do* we need to know which slots might already be installed? I'd have assumed that when we get to low_prepare_to_resume, and the lwp is marked stale, we just throw away everything and install the complete desired state. > Another reason is that add_lwp (and therefore low_new_thread) is also > called in cases other than a ptrace clone event. Well, yes, but those cases *also* need to be handled, right? This is e.g. when you attach to an already multi-threaded process while there are already watchpoints set up. In that case, you'll need to install those watchpoints into all those threads. > > - We currently do not support hardware watchpoints in gdbserver, > > even though we really should. Ideally, the low-level code to > > handle debug regs should be shared between gdb and gdbserver, > > as is done e.g. on x86. Now, I'm not saying that handling > > gdbserver is a pre-req for this patch (fixing GDB first is of > > course fine!), but I'm wondering if it would make sense, given > > that you're refactoring a lot of this code anyway, to think > > about whether this setup would help or hinder a future merge > > with gdbserver. > > Ok, I'll review this and see if this can be easily ported to gdbserver. Thanks! Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com