From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19888 invoked by alias); 16 Apr 2011 13:46:30 -0000 Received: (qmail 19871 invoked by uid 22791); 16 Apr 2011 13:46:28 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ew0-f41.google.com (HELO mail-ew0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Apr 2011 13:46:13 +0000 Received: by ewy9 with SMTP id 9so1100991ewy.0 for ; Sat, 16 Apr 2011 06:46:12 -0700 (PDT) Received: by 10.213.23.89 with SMTP id q25mr3246510ebb.101.1302961572072; Sat, 16 Apr 2011 06:46:12 -0700 (PDT) Received: from [192.168.2.100] (ip82-139-82-5.lijbrandt.net [82.139.82.5]) by mx.google.com with ESMTPS id y7sm2702606eeh.21.2011.04.16.06.46.09 (version=SSLv3 cipher=OTHER); Sat, 16 Apr 2011 06:46:10 -0700 (PDT) Message-ID: <4DA99DA1.2090708@gmail.com> Date: Sat, 16 Apr 2011 13:46:00 -0000 From: "Baars, M.J." User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: gdb@sourceware.org, gdb-patches@sourceware.org CC: Mark Kettenis Subject: Re: print_npx_status_word References: <4DA7166F.10302@gmail.com> <4DA7ED79.3000400@gmail.com> <4DA87235.7060003@gmail.com> <4DA87479.50203@gmail.com> <4DA93270.6030708@gmail.com> <201104160824.p3G8ONWV006175@glazunov.sibelius.xs4all.nl> In-Reply-To: <201104160824.p3G8ONWV006175@glazunov.sibelius.xs4all.nl> Content-Type: multipart/mixed; boundary="------------020608060101080707000003" 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: 2011-04/txt/msg00239.txt.bz2 This is a multi-part message in MIME format. --------------020608060101080707000003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 554 On 04/16/2011 10:24 AM, Mark Kettenis wrote: >> Date: Sat, 16 Apr 2011 08:08:48 +0200 >> From: "Baars, M.J." >> >> Hi Tom, >> >> I believe this is the format you requested? > No! This is a .tar.gz. Proper diffs don't come as a .tar.gz. Oops... did I remove one of your entries in the ChangeLog? :) >> --------------020309050206070002040202 >> Content-Type: application/x-gzip; >> name="patches-gdb-7.2.tar.gz" >> Content-Transfer-Encoding: base64 >> Content-Disposition: attachment; >> filename="patches-gdb-7.2.tar.gz" --------------020608060101080707000003 Content-Type: text/x-patch; name="ChangeLog.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ChangeLog.diff" Content-length: 382 --- ./gdb-7.2/gdb/ChangeLog 2010-09-03 01:37:25.000000000 +0200 +++ ./gdb-7.2.2/gdb/ChangeLog 2011-04-14 16:14:53.623948000 +0200 @@ -1,3 +1,7 @@ +2011-04-14 Ir. M.J. Baars + + * i387-tdep.c (print_npx_status_word) - new function + 2010-09-02 Joel Brobecker * NEWS: Replace "Changes since GDB 7.1" by "Changes in GDB 7.2". --------------020608060101080707000003 Content-Type: text/x-patch; name="ChangeLog-1999.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ChangeLog-1999.diff" Content-length: 704 --- ./gdb-7.2/gdb/ChangeLog-1999 2001-01-12 04:44:31.000000000 +0100 +++ ./gdb-7.2.2/gdb/ChangeLog-1999 2011-04-14 16:11:31.503948001 +0200 @@ -581,9 +581,9 @@ Wed Dec 8 15:29:48 1999 Andrew Cagney Patch from Mark Kettenis : * config/i386/tm-i386.h (FLOAT_INFO): New define. - * i387-tdep.c (print_i387_value, print_i387_ext, - print_i387_status_word, print_i387_control_word, i387_float_info): - New functions, used to implement generic `info float' command. + + * i387-tdep.c (print_i387_value, print_i387_ext,print_i387_control_word, i387_float_info): + New functions, used to implement generic `info float' command. 1999-12-06 Christopher Faylor --------------020608060101080707000003 Content-Type: text/x-patch; name="ChangeLog-2001.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ChangeLog-2001.diff" Content-length: 557 --- ./gdb-7.2/gdb/ChangeLog-2001 2002-01-06 05:37:53.000000000 +0100 +++ ./gdb-7.2.2/gdb/ChangeLog-2001 2011-04-14 15:55:22.631948002 +0200 @@ -8076,11 +8076,6 @@ Wed Apr 4 21:48:42 2001 Christopher Fa * MAINTAINERS: Add myself to write after approval list. -2001-03-09 Mark Kettenis - - * i387-tdep.c (print_i387_status_word): Fix printing of Stack - fault flag. It is bit 6 of the x87 FPU status word, not bit 7. - 2001-03-08 Andrew Cagney * configure.host (m88*-harris-cxux*): Mark as obsolete. --------------020608060101080707000003 Content-Type: text/x-patch; name="ChangeLog-2002.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ChangeLog-2002.diff" Content-length: 1081 --- ./gdb-7.2/gdb/ChangeLog-2002 2004-04-24 00:15:17.000000000 +0200 +++ ./gdb-7.2.2/gdb/ChangeLog-2002 2011-04-14 16:13:29.187948001 +0200 @@ -5396,12 +5396,13 @@ Fri Sep 13 07:42:09 2002 Andrew Cagney * config/i386/tm-i386.h: Don't include "regcache.h". * i387-tdep.h (i387_print_float_info): New prototype. - * i387-tdep.c (print_i387_value, print_i387_ext, - print_i387_status_word, print_i387_control_word): Add `struct - ui_file *' argument and use it for output. - (i387_print_float_info): Renamed from i387_float_info. Add - `struct gdbarch *' and `struct ui_file *' arguments and use the - latter for output. + * i387-tdep.c (print_i387_value, print_i387_ext, print_i387_control_word): + Add `struct ui_file *' argument and use it for output. + + * i387-tdep.c (i387_print_float_info): + Renamed from i387_float_info. Add `struct gdbarch *' and `struct ui_file *' arguments + and use the latter for output. + * i386-tdep.c: Include "i387-tdep.h". (i386_gdbarch_init): Set print_float_info. * config/i386/tm-i386.h (i387_float_info): Remove prototype. --------------020608060101080707000003 Content-Type: text/x-patch; name="ChangeLog-2004.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ChangeLog-2004.diff" Content-length: 679 --- ./gdb-7.2/gdb/ChangeLog-2004 2006-10-24 22:23:56.000000000 +0200 +++ ./gdb-7.2.2/gdb/ChangeLog-2004 2011-04-14 16:13:52.067948001 +0200 @@ -3468,9 +3468,10 @@ * ui-out.c (ui_out_field_core_addr): Ditto. * breakpoint.c (breakpoint_adjustment_warning): Ditto. * exec.c (print_section_info): Ditto. - * i387-tdep.c (print_i387_status_word): Ditto. - (print_i387_control_word): Ditto. - (i387_print_float_info): Ditto. + + * i387-tdep.c (print_i387_control_word): Ditto. + * i387-tdep.c (i387_print_float_info): Ditto. + * maint.c (maint_print_section_info): Ditto. * solib.c (info_sharedlibrary_command): Ditto. * somsolib.c (som_sharedlibrary_info_command): Ditto. --------------020608060101080707000003 Content-Type: text/x-patch; name="i387-tdep.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="i387-tdep.c.diff" Content-length: 4261 --- ./gdb-7.2/gdb/i387-tdep.c 2010-05-05 21:30:36.000000000 +0200 +++ ./gdb-7.2.2/gdb/i387-tdep.c 2011-04-14 16:23:54.647948001 +0200 @@ -36,6 +36,52 @@ #include "i387-tdep.h" #include "i386-xstate.h" +struct +{ + char *tag; + char *description; +} + +static const npx_exception_flags[6] = + +{ + {"IE", "invalid operation"}, + {"DE", "denormalized operand"}, + {"ZE", "zero divide"}, + {"OE", "overflow"}, + {"UE", "underflow"}, + {"PE", "precision"} +}; + +// print the numeric coprocessor extension (npx) status word +void print_npx_status_word(uint16_t npx_status_word, struct ui_file *file) +{ + fprintf_filtered(file, "status word : 0x%04X\n", npx_status_word); + + fprintf_filtered(file, " exception flags : "); + + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0005) & 0x0001) ? npx_exception_flags[5].tag : " "); // precision + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0004) & 0x0001) ? npx_exception_flags[4].tag : " "); // underflow + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0003) & 0x0001) ? npx_exception_flags[3].tag : " "); // overflow + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0002) & 0x0001) ? npx_exception_flags[2].tag : " "); // zero divide + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0001) & 0x0001) ? npx_exception_flags[1].tag : " "); // denormalized operand + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0000) & 0x0001) ? npx_exception_flags[0].tag : " "); // invalid operation + fprintf_filtered(file, "\n"); + + fprintf_filtered(file, " stack fault : %u\n", ((npx_status_word >> 0x0006) & 0x0001)); + fprintf_filtered(file, " error summary status : %u\n", ((npx_status_word >> 0x0007) & 0x0001)); + fprintf_filtered(file, " busy : %u\n", ((npx_status_word >> 0x000F) & 0x0001)); + fprintf_filtered(file, " top of stack pointer : %u\n", ((npx_status_word >> 0x000B) & 0x0007)); + + fprintf_filtered(file, " condition code : "); + + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x000E) & 0x0001) ? "C3" : " "); + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x000A) & 0x0001) ? "C2" : " "); + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0009) & 0x0001) ? "C1" : " "); + fprintf_filtered(file, "%s ", ((npx_status_word >> 0x0008) & 0x0001) ? "C0" : " "); + fprintf_filtered(file, "\n"); +} + /* Print the floating point number specified by RAW. */ static void @@ -114,36 +160,6 @@ 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) -{ - 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" : " "); - - fputs_filtered ("\n", file); - - fprintf_filtered (file, - " TOP: %d\n", ((status >> 11) & 7)); -} - /* Print the control word CONTROL. */ static void @@ -268,7 +284,9 @@ i387_print_float_info (struct gdbarch *g fputs_filtered ("\n", file); - print_i387_status_word (fstat, file); + print_npx_status_word(fstat, file); + fprintf_filtered(file, "\n"); + print_i387_control_word (fctrl, file); fprintf_filtered (file, "Tag Word: %s\n", hex_string_custom (ftag, 4)); --------------020608060101080707000003--