From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21519 invoked by alias); 16 Jul 2013 17:06:36 -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 21509 invoked by uid 89); 16 Jul 2013 17:06:35 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_W,RDNS_NONE autolearn=ham version=3.3.1 Received: from Unknown (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 16 Jul 2013 17:06:35 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Jul 2013 18:00:38 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 16 Jul 2013 18:00:35 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id E393617D8025 for ; Tue, 16 Jul 2013 18:08:00 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6GH6CsC65798388 for ; Tue, 16 Jul 2013 17:06:12 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r6GH6Mxd014939 for ; Tue, 16 Jul 2013 11:06:23 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-143.boeblingen.de.ibm.com [9.152.212.143]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r6GH6LIm014931; Tue, 16 Jul 2013 11:06:22 -0600 From: Andreas Arnez To: "Ulrich Weigand" Cc: lgustavo@codesourcery.com, gdb-patches@sourceware.org Subject: Re: [ping 2] [RFA][PATCH v4 0/5] Add TDB regset support References: <201307161602.r6GG2up6007938@d06av02.portsmouth.uk.ibm.com> Date: Tue, 16 Jul 2013 17:06:00 -0000 In-Reply-To: <201307161602.r6GG2up6007938@d06av02.portsmouth.uk.ibm.com> (Ulrich Weigand's message of "Tue, 16 Jul 2013 18:02:56 +0200 (CEST)") Message-ID: <87sizel9iq.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: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13071617-5024-0000-0000-0000069AD5BE X-SW-Source: 2013-07/txt/msg00366.txt.bz2 "Ulrich Weigand" writes: > Your patch below doesn't show the common code changes, so I'm not > sure how you planned to handle legacy platforms. I guess it might > be possible to detect them using zero markers in those fields ... Right, before coming up with a complete patch I wanted to get some feedback on this general idea. So I guess it's worth giving it a try? > As an aside, I'm wondering: > >> + res = cb (tdep->wordsize == 4 ? >> + &ppc32_linux_gregset : &ppc64_linux_gregset, >> + cb_data); >> + if (!res) >> + res = cb (&ppc32_linux_fpregset, cb_data); >> + if (!res && have_altivec) >> + res = cb (&ppc32_linux_vrregset, cb_data); >> + if (!res && have_vsx) >> + cb (&ppc32_linux_vsxregset, cb_data); > > Why does the callback need to return a flag that has to be handled > by the caller? If there is indeed a requirement for treating > error conditions specially, couldn't the callback store error data > in the cb_data and handle it on subsequent calls? This is a good point. Yes, this is for error handling, and yes, the error indication could be moved to cb_data. > This would make the gdbarch implementations in the targets yet > easier and simpler to write, something along the lines of: > > if (tdep->wordsize == 4) > cb (&ppc32_linux_gregset, cb_data); > else > cb (&ppc64_linux_gregset, cb_data); > cb (&ppc32_linux_fpregset, cb_data); > if (have_altivec) > cb (&ppc32_linux_vrregset, cb_data); > if (have_vsx) > cb (&ppc32_linux_vsxregset, cb_data); Yup.