From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28440 invoked by alias); 19 Apr 2013 03:22:59 -0000 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 Received: (qmail 28428 invoked by uid 89); 19 Apr 2013 03:22:58 -0000 X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 19 Apr 2013 03:22:57 +0000 Received: by mail-ie0-f175.google.com with SMTP id a11so2932200iee.34 for ; Thu, 18 Apr 2013 20:22:55 -0700 (PDT) X-Received: by 10.43.146.3 with SMTP id jw3mr5811523icc.39.1366341775823; Thu, 18 Apr 2013 20:22:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.118.35 with HTTP; Thu, 18 Apr 2013 20:22:34 -0700 (PDT) In-Reply-To: <516FC7B3.4050502@redhat.com> References: <516FC7B3.4050502@redhat.com> From: Vladimir Kargov Date: Fri, 19 Apr 2013 14:30:00 -0000 Message-ID: Subject: =?windows-1252?Q?Re=3A_=5BPATCH=5D_Fix_the_x87_FP_register_printout_by_=93i?= =?windows-1252?Q?nfo_float=94=2E?= To: Pedro Alves , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-04/txt/msg00576.txt.bz2 On 18 April 2013 14:15, Pedro Alves wrote: > On 04/18/2013 01:51 AM, Vladimir Kargov wrote: > >> Another way to fix this would be to replace the type in the definition >> of variable "raw" from "char" to "gdb_char" which is currently defined >> as "unsigned char", > > You must have meant gdb_byte. Yes, sure. > Actually, this (not checked in yet) series does that: Oh, I did not notice it. It should solve the problem, although I think it is still reasonable to add the length modifier to fprintf_filtered in case the definition of gdb_byte ever changes. >> but I couldn't find any signs in the code that >> this typedef wouldn't be changed in the future to something else. > > Could you write a test case? That'd prevent a regression here > going unnoticed. A testcase for the proper FP register printout? I'm attaching one. (may have missed some formatting/guidelines...) 2013-04-19 Vladimir Kargov * gdb.arch/i386-float.S: New file. * gdb.arch/i386-float.exp: New file. diff --git a/gdb/testsuite/gdb.arch/i386-float.S b/gdb/testsuite/gdb.arch/i386-float.S new file mode 100644 index 0000000..f7c87f8 --- /dev/null +++ b/gdb/testsuite/gdb.arch/i386-float.S @@ -0,0 +1,24 @@ +/* Copyright 2009-2013 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + This file is part of the gdb testsuite. */ + + .text + .globl main +main: + fninit + fldt val +.data + val: .byte 0x00,0x00,0x45,0x07,0x11,0x19,0x22,0xe9,0xfe,0xbf diff --git a/gdb/testsuite/gdb.arch/i386-float.exp b/gdb/testsuite/gdb.arch/i386-float.exp new file mode 100644 index 0000000..a50f608 --- /dev/null +++ b/gdb/testsuite/gdb.arch/i386-float.exp @@ -0,0 +1,51 @@ +# Copyright (C) 2009-2013 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# This file is part of the gdb testsuite. + +# Test the x87 floating point information printout. + +if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then { + verbose "Skipping i386 test for proper x87 FP support." + return +} + +set testfile "i386-float" +set srcfile ${testfile}.S +set binfile ${objdir}/${subdir}/${testfile} + +# some targets have leading underscores on assembly symbols. +set additional_flags [gdb_target_symbol_prefix_flags] + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } { + untested i386-float.exp + return -1 +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +if ![runto_main] then { + fail "Can't run to main" + return 0 +} + +send_gdb "stepi\n" +gdb_test "info float" ".*R7: Empty 0x00000000000000000000\r\n.*" +send_gdb "stepi\n" +gdb_test "info float" ".*=>R7: Valid 0xbffee922191107450000 .*" -- Vladimir