From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15575 invoked by alias); 10 Mar 2002 16:30:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15522 invoked from network); 10 Mar 2002 16:30:14 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.135.44) by sources.redhat.com with SMTP; 10 Mar 2002 16:30:14 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BDB8D3E0C; Sun, 10 Mar 2002 11:30:09 -0500 (EST) Message-ID: <3C8B8A11.8070609@cygnus.com> Date: Sun, 10 Mar 2002 08:30:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.8) Gecko/20020210 X-Accept-Language: en-us MIME-Version: 1.0 To: Daniel Jacobowitz , Don Howard Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] mips: Fix "info registers" output References: <20010619225007.A10141@nevyn.them.org> <20020307165956.A22042@nevyn.them.org> <3C8ABF59.7080908@cygnus.com> <20020310015637.A13373@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-03/txt/msg00135.txt.bz2 > > FP_REGISTER_DOUBLE describes a property of the ABI. I don't really > think it's the appropriate check when printing floating-point > registers; we always take care to print the single-precision value even > if FP_REGISTER_DOUBLE, because they might be used in single-precision > anyway. True, sort of. The decision is a function of that FP bit, FP_REGISTER_DOUBLE and the user typing ``(gdb) set mips fp-register-double on, damit!'' (the user is always right :-). If the FP register bit is used by just this code, other parts of GDB are going to be inconsistent since they are still using FP_REGISTER_DOUBLE when [un]packing FP registers. Can I suggest using FP_REGISTER_DOUBLE initially (#if 0 #else #endif the code in mips2_fp_compat()) and bug report the need to change everyting to use mips2_fp_compat() as a separate change. Apart from that, I think the code is brilliant. Just suggest a few comment tweaks before the commit. + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + mips_read_fp_register_single (regno, rare_buffer + 4); + mips_read_fp_register_single (regno + 1, rare_buffer); + } + else + { + mips_read_fp_register_single (regno, rare_buffer); + mips_read_fp_register_single (regno + 1, rare_buffer + 4); + } Suggest mentioning that mips_read_fp_register_single() handles the problem of extracting the correct four bytes from from each register. > - /* use HI and LO to control the order of combining two flt regs */ > - int HI = (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG); > - int LO = (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG); Yes! In 20:20 hindsight that was a very confusing idea. > + /* 4-byte registers: we can fit two registers per row. */ > + /* Also print every pair of 4-byte regs as an 8-byte double. */ > + mips_read_fp_register_single (regnum, raw_buffer); > + flt1 = unpack_double (builtin_type_float, raw_buffer, &inv1); > + > + mips_read_fp_register_single (regnum + 1, raw_buffer); > + flt2 = unpack_double (builtin_type_float, raw_buffer, &inv2); > > + mips_read_fp_register_double (regnum, raw_buffer); > + doub = unpack_double (builtin_type_double, raw_buffer, &inv3); > + > printf_filtered (" %-5s", REGISTER_NAME (regnum)); Suggest a FIXME and bug report here. It isn't safe to assume things like builtin_type_double is 64 bit. The code should use the ABI independant builtin_type_ieee_BLAH. But this is a separate bug and not your problem :-) enjoy, Andrew