From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2108 invoked by alias); 4 Jan 2010 18:47:19 -0000 Received: (qmail 2100 invoked by uid 22791); 4 Jan 2010 18:47:18 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.antivirus.flexwebhosting.nl (HELO mail.antivirus.flexwebhosting.nl) (85.92.140.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jan 2010 18:47:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.antivirus.flexwebhosting.nl (Postfix) with ESMTP id 603D0121857C for ; Mon, 4 Jan 2010 19:47:09 +0100 (CET) Received: from mail.antivirus.flexwebhosting.nl ([127.0.0.1]) by localhost (mail.antivirus.flexwebhosting.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fnetIjVp0HTg for ; Mon, 4 Jan 2010 19:47:03 +0100 (CET) Received: from srv4086.flexwebhosting.nl (unknown [89.18.179.86]) by mail.antivirus.flexwebhosting.nl (Postfix) with ESMTP id DA6E51218567 for ; Mon, 4 Jan 2010 19:47:02 +0100 (CET) Received: from ip82-139-82-108.lijbrandt.net ([82.139.82.108] helo=[192.168.2.132]) by srv4086.flexwebhosting.nl with esmtpa (Exim 4.67) (envelope-from ) id 1NRrxH-0005h6-GU for gdb-patches@sourceware.org; Mon, 04 Jan 2010 19:47:03 +0100 Message-ID: <4B4237A7.70700@cyberfiber.org> Date: Mon, 04 Jan 2010 18:47:00 -0000 From: Michael User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [RFA/i387] improve the output of 'info float' References: <4B3E4DC6.7020901@cyberfiber.org> <20100102043704.GR548@adacore.com> <4B3F03C4.1040104@cyberfiber.org> <4B3F083C.2080300@cyberfiber.org> <20100102093213.GX2788@adacore.com> <20100102093302.GA12123@adacore.com> <4B3F252A.30504@cyberfiber.org> <20100102111708.GV548@adacore.com> <4B3F3442.60900@cyberfiber.org> <20100103053213.GA2788@adacore.com> <201001030845.o038jrhH012796@glazunov.sibelius.xs4all.nl> In-Reply-To: <201001030845.o038jrhH012796@glazunov.sibelius.xs4all.nl> Content-Type: multipart/mixed; boundary="------------010907000806050804080704" 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: 2010-01/txt/msg00067.txt.bz2 This is a multi-part message in MIME format. --------------010907000806050804080704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1001 Hi all, However, I personally still favor this version. Regards, Michael Mark Kettenis wrote: >> Date: Sun, 3 Jan 2010 09:32:13 +0400 >> From: Joel Brobecker >> >> Michael, >> >> I changed the subject to something meaningful; you have a *much* higher >> chance of attracting the eye of the appropriate maintainer if you use >> descriptive subjects. >> > > Yup. I didn't notice it. So either I didn't receive the origional > mail or I deleted it immediately based on the subject. Can you send > the diff again? > > >> I will let Mark tell you whether he likes your change of output or not. >> Personally, I liked the previous output better - much more compact >> and easier to read, there are too many decorations in your proposed >> output and it's harder to isolate the relevant information. >> > > If you send your diff again, can you include an example of how the > output looks? I must warn you that I'm likely to agree with Joel here > though. > > --------------010907000806050804080704 Content-Type: text/x-patch; name="gdb2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb2.diff" Content-length: 7115 diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 188347f..d747e79 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2010-01-02 Michael Baars + + * i387-tdep.c: + (print_i387_status_word): Adapted the output such that the least + significant bits appear at the right and added a more + comprehensive description of the flags involved. + (print_i387_control_word): Adapted the output such that the least + significant bits appear at the right. + + naming conventions are conform the intel i387 dx programmer's + reference manual (1989) + 2010-01-01 Jan Kratochvil * cli/cli-script.c (process_next_line): Rename p1 as p_end and p2 as diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 3fb5b56..419eb02 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -113,85 +113,86 @@ print_i387_ext (struct gdbarch *gdbarch, fputs_filtered (" Unsupported", file); } -/* Print the status word STATUS. */ - -static void -print_i387_status_word (unsigned int status, struct ui_file *file) +// Print the numeric coprocessor extension (npx) status word. +static void print_i387_status_word (unsigned int status, struct ui_file *file) { - fprintf_filtered (file, "Status Word: %s", - hex_string_custom (status, 4)); - fputs_filtered (" ", file); - fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " "); - fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " "); - fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " "); - fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " "); - fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " "); - fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " "); - fputs_filtered (" ", file); - fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " "); - fputs_filtered (" ", file); - fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " "); - fputs_filtered (" ", file); - fprintf_filtered (file, " %s", (status & 0x0100) ? "C0" : " "); - fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " "); - fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " "); - fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " "); + fprintf_filtered (file, "status word : %s\n", hex_string_custom(status, 4)); - fputs_filtered ("\n", file); + fprintf_filtered (file, " exception flags : "); - fprintf_filtered (file, - " TOP: %d\n", ((status >> 11) & 7)); -} + fprintf_filtered (file, "%s ", (status & 0x0020) ? "PE" : " "); // precision + fprintf_filtered (file, "%s ", (status & 0x0010) ? "UE" : " "); // underflow + fprintf_filtered (file, "%s ", (status & 0x0008) ? "OE" : " "); // overflow + fprintf_filtered (file, "%s ", (status & 0x0004) ? "ZE" : " "); // zero divice + fprintf_filtered (file, "%s ", (status & 0x0002) ? "DE" : " "); // denormalized operand + fprintf_filtered (file, "%s ", (status & 0x0001) ? "IE" : " "); // invalid operation -/* Print the control word CONTROL. */ + fprintf_filtered (file, "\n"); -static void -print_i387_control_word (unsigned int control, struct ui_file *file) + fprintf_filtered (file, " stack fault : %s\n", (status & 0x0040) ? "SF" : " "); + fprintf_filtered (file, " error summary status : %s\n", (status & 0x0080) ? "ES" : " "); + + fprintf_filtered (file, " condition code : "); + + fprintf_filtered (file, "%s ", (status & 0x4000) ? "C3" : " "); + fprintf_filtered (file, "%s ", (status & 0x0400) ? "C2" : " "); + fprintf_filtered (file, "%s ", (status & 0x0200) ? "C1" : " "); + fprintf_filtered (file, "%s ", (status & 0x0100) ? "C0" : " "); + fprintf_filtered (file, "\n"); + + fprintf_filtered (file, " top of stack (TOP) : %d\n", ((status >> 11) & 7)); +} + +// Print the numeric coprocessor extension (npx) control word. +static void print_i387_control_word (unsigned int control, struct ui_file *file) { - fprintf_filtered (file, "Control Word: %s", - hex_string_custom (control, 4)); - fputs_filtered (" ", file); - fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " "); - fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " "); - fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " "); - fprintf_filtered (file, " %s", (control & 0x0008) ? "OM" : " "); - fprintf_filtered (file, " %s", (control & 0x0010) ? "UM" : " "); - fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " "); + fprintf_filtered (file, "control word : %s\n", hex_string_custom(control, 4)); - fputs_filtered ("\n", file); + fprintf_filtered (file, " exception masks : "); + + fprintf_filtered (file, "%s ", (control & 0x0020) ? "PM" : " "); // precision + fprintf_filtered (file, "%s ", (control & 0x0010) ? "UM" : " "); // underflow + fprintf_filtered (file, "%s ", (control & 0x0008) ? "OM" : " "); // overflow + fprintf_filtered (file, "%s ", (control & 0x0004) ? "ZM" : " "); // zero divide + fprintf_filtered (file, "%s ", (control & 0x0002) ? "DM" : " "); // denormalized operand + fprintf_filtered (file, "%s ", (control & 0x0001) ? "IM" : " "); // invalid operation + + fprintf_filtered (file, "\n"); - fputs_filtered (" PC: ", file); - switch ((control >> 8) & 3) + fprintf_filtered (file, " precision control (PC) : "); + + switch ((control >> 8) & 3) { - case 0: - fputs_filtered ("Single Precision (24-bits)\n", file); - break; - case 1: - fputs_filtered ("Reserved\n", file); - break; - case 2: - fputs_filtered ("Double Precision (53-bits)\n", file); - break; - case 3: - fputs_filtered ("Extended Precision (64-bits)\n", file); - break; + case 0: + fprintf_filtered (file, "24-bits (single precision)\n"); + break; + case 1: + fprintf_filtered (file, "(reserved)\n"); + break; + case 2: + fprintf_filtered (file, "53-bits (double precision)\n"); + break; + case 3: + fprintf_filtered (file, "64-bits (extended precision)\n"); + break; } - - fputs_filtered (" RC: ", file); - switch ((control >> 10) & 3) + + fprintf_filtered (file, " rounding control (RC) : "); + + switch ((control >> 10) & 3) { - case 0: - fputs_filtered ("Round to nearest\n", file); - break; - case 1: - fputs_filtered ("Round down\n", file); - break; - case 2: - fputs_filtered ("Round up\n", file); - break; - case 3: - fputs_filtered ("Round toward zero\n", file); - break; + case 0: + fprintf_filtered (file, "round to nearest or even\n"); + break; + case 1: + fprintf_filtered (file, "round down (towards -inf)\n"); + break; + case 2: + fprintf_filtered (file, "round up (toward +inf)\n"); + break; + case 3: + fprintf_filtered (file, "chop (truncate toward zero)\n"); + break; } } --------------010907000806050804080704--