From patchwork Fri Nov 20 22:07:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruslan Kabatsayev X-Patchwork-Id: 9761 Received: (qmail 5467 invoked by alias); 20 Nov 2015 22:07:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5441 invoked by uid 89); 20 Nov 2015 22:07:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lf0-f48.google.com Received: from mail-lf0-f48.google.com (HELO mail-lf0-f48.google.com) (209.85.215.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 20 Nov 2015 22:07:14 +0000 Received: by lfs39 with SMTP id 39so77640413lfs.3 for ; Fri, 20 Nov 2015 14:07:10 -0800 (PST) X-Received: by 10.25.28.70 with SMTP id c67mr5856319lfc.95.1448057230579; Fri, 20 Nov 2015 14:07:10 -0800 (PST) Received: from [10.0.2.15] ([91.215.122.25]) by smtp.gmail.com with ESMTPSA id 194sm189005lfd.4.2015.11.20.14.07.09 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Nov 2015 14:07:09 -0800 (PST) To: gdb-patches@sourceware.org From: Ruslan Kabatsayev Subject: [PATCH][PR 18702] Fix wrong output of x87 registers due to truncation to double on amd64 Message-ID: <564F998D.5080406@gmail.com> Date: Sat, 21 Nov 2015 01:07:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 When `info float` is used on an AMD64 system, GDB prints floating-point values of x87 registers with raw contents like 0x361a867a8e0527397ce0 or 0xc4f988454a1ddd3cfdab wrongly. This happens due to truncation to double, after which the former becomes 0.0, and the latter becomes negative infinity. This is caused by failed detection of x86-64 host, which results in setting gdb_host_{float,double,long_double}_format to zeros. This commit fixes this misdetection. gdb/ChangeLog: * configure.host: Fix detection of x86_64 host when setting floatformats --- gdb/configure.host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/configure.host b/gdb/configure.host index 48714f4..ef265eb 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -195,7 +195,7 @@ esac # "double" and "long double" types. case "${host}" in -i[34567]86-*-*) +i[34567]86-*-*|x86_64-*-*) gdb_host_float_format="&floatformat_ieee_single_little" gdb_host_double_format="&floatformat_ieee_double_little" gdb_host_long_double_format="&floatformat_i387_ext"