From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19855 invoked by alias); 18 Sep 2008 20:13:13 -0000 Received: (qmail 19845 invoked by uid 22791); 18 Sep 2008 20:13:12 -0000 X-Spam-Check-By: sourceware.org Received: from ik-out-1112.google.com (HELO ik-out-1112.google.com) (66.249.90.176) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 18 Sep 2008 20:12:38 +0000 Received: by ik-out-1112.google.com with SMTP id c30so89759ika.0 for ; Thu, 18 Sep 2008 13:12:35 -0700 (PDT) Received: by 10.210.89.4 with SMTP id m4mr5481882ebb.73.1221768755178; Thu, 18 Sep 2008 13:12:35 -0700 (PDT) Received: by 10.210.63.19 with HTTP; Thu, 18 Sep 2008 13:12:35 -0700 (PDT) Message-ID: <6dc9ffc80809181312m5b0b47edqf2484dc98f428a6@mail.gmail.com> Date: Thu, 18 Sep 2008 20:13:00 -0000 From: "H.J. Lu" To: "H.J. Lu" , GDB Subject: Re: PATCH: Extend gdb remote protocol for AVX In-Reply-To: <20080918193858.GA26337@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080918172728.GA12703@lucon.org> <20080918183402.GA22646@caradoc.them.org> <6dc9ffc80809181203g3e7b67ccm35bfc86f80c27fc2@mail.gmail.com> <20080918193858.GA26337@caradoc.them.org> X-IsSubscribed: yes 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 X-SW-Source: 2008-09/txt/msg00393.txt.bz2 On Thu, Sep 18, 2008 at 12:38 PM, Daniel Jacobowitz wrote: > On Thu, Sep 18, 2008 at 12:03:11PM -0700, H.J. Lu wrote: >> On Thu, Sep 18, 2008 at 11:34 AM, Daniel Jacobowitz >> wrote: >> > On Thu, Sep 18, 2008 at 10:27:28AM -0700, H.J. Lu wrote: >> >> b. If remote target supports AVX: >> >> i. Don't send xmlarch. >> >> ii. Replace 128bit xmm registers with 256bit ymm registers in >> >> the g/G packet. >> >> iii. Gdb will auto-detect SSE unit on remote target, based on the >> >> the g/G packet size. >> > >> > Just a general note: I would much prefer you use the XML mechanism for >> > this, either by an architecture name or a property or an explicit >> > register description, than add more guesses to the g/G packet checks; >> > they're a heuristic for existing remote targets. >> > >> >> I tried adding xmlarch to regformats files. But I don't want to add new >> xmlarch entry for AVX since I had to create a new arch entry in BFD for it. It >> isn't necessary for this purpose. If I use the existing xmlarch, like >> i386:x86-64, it will match regformats/reg-x86-64.dat. Using >> the g/G packet size allows me not to add a new arch entry in BFD. >> Is there a way to do it with XML without changing BFD? > > Yes, either of the other two options I described. MIPS uses both of > them; search for PROPERTY_GP32 or tdesc_has_registers. > I took a similar approach for remote AVX debug. MIPS uses the size of g/G packet to set PROPERTY_GPXX: static void mips_register_g_packet_guesses (struct gdbarch *gdbarch) { /* If the size matches the set of 32-bit or 64-bit integer registers, assume that's what we've got. */ register_remote_g_packet_guess (gdbarch, 38 * 4, mips_tdesc_gp32); register_remote_g_packet_guess (gdbarch, 38 * 8, mips_tdesc_gp64); /* If the size matches the full set of registers GDB traditionally knows about, including floating point, for either 32-bit or 64-bit, assume that's what we've got. */ register_remote_g_packet_guess (gdbarch, 90 * 4, mips_tdesc_gp32); register_remote_g_packet_guess (gdbarch, 90 * 8, mips_tdesc_gp64); /* Otherwise we don't have a useful guess. */ } AVX uses: void i386_register_g_packet_guesses (struct gdbarch *gdbarch, int sse_unit_bytes, int avx_unit_bytes) { /* If the size matches the set of SSE registers, we are talking to an SSE remote target. */ register_remote_g_packet_guess (gdbarch, sse_unit_bytes, i386_tdesc_sse); /* If the size matches the set of AVX registers, we are talking to an AVX remote target. */ register_remote_g_packet_guess (gdbarch, avx_unit_bytes, i386_tdesc_avx); } Did I miss something? -- H.J.