From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66083 invoked by alias); 16 May 2017 13:44:01 -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 66033 invoked by uid 89); 16 May 2017 13:43:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1664, HTo:U*jhb, arrangement X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 May 2017 13:43:58 +0000 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id DEE8C99555FA2; Tue, 16 May 2017 14:43:55 +0100 (IST) Received: from [10.20.78.22] (10.20.78.22) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.294.0; Tue, 16 May 2017 14:43:57 +0100 Date: Tue, 16 May 2017 13:44:00 -0000 From: "Maciej W. Rozycki" To: John Baldwin CC: , Yao Qi Subject: Re: [PATCH] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c In-Reply-To: <3174656.5xSoUNdgyV@ralph.baldwin.cx> Message-ID: References: <1494324439-15918-1-git-send-email-yao.qi@linaro.org> <3174656.5xSoUNdgyV@ralph.baldwin.cx> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2017-05/txt/msg00343.txt.bz2 On Wed, 10 May 2017, John Baldwin wrote: > > Why? These descriptions are only used in the native case, otherwise > > gdbserver supplies its own. The current arrangement has worked for some > > 12 years now. > > Target descriptions (in general) might be determined purely by a core dump's > contents. For example, in my out-of-tree patches for CHERI MIPS I added > target descriptions for the CHERI capability registers and then use those > target descriptions instead of the default for FreeBSD/mips core dumps that > contain a special "capregs" note (this is implemented via a gdbarch > "core_read_description" method). For native binaries I depend on a working > ptrace op to determine if the native CPU supports the registers via > the "read_description" target method. > > If core dumps of Linux binaries on processors with DSP registers included > those registers in process cores then you would need a similar method for > the Linux MIPS gdbarch that worked similar to mips_linux_read_description > to select the appropriate target description for process cores. Your explanation makes sense to me, although as you have also observed a target description corresponding to a core dump may not necessarily be the same as one produced for a live target that core dump has been obtained from, because for various reasons the lists of registers included in each may be different. For these cases where there is no difference, I see no sense to duplicate code of course. But such details would have to be included in the description of a patch proposed, IMHO. Maciej