From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24674 invoked by alias); 18 Mar 2009 13:54:58 -0000 Received: (qmail 24662 invoked by uid 22791); 18 Mar 2009 13:54:56 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Mar 2009 13:54:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 07AC52BAAA4; Wed, 18 Mar 2009 09:54:50 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JZHtjvRC6ARQ; Wed, 18 Mar 2009 09:54:49 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E18C82BAC16; Wed, 18 Mar 2009 09:54:48 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 51E64F5CFA; Wed, 18 Mar 2009 06:54:48 -0700 (PDT) Date: Wed, 18 Mar 2009 14:44:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org, Jan Kratochvil , Eli Zaretskii , tromey@redhat.com, mark.kettenis@xs4all.nl, drow@false.org Subject: Re: [patch] Fix `return' of long/long-long results with no debuginfo Message-ID: <20090318135448.GA18396@adacore.com> References: <20090315092137.GA14577@host0.dyn.jankratochvil.net> <200903180420.37390.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903180420.37390.pedro@codesourcery.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-03/txt/msg00377.txt.bz2 > The issue is that it relies on parsing the output of printf, which > doesn't work against remote targets that don't implement some kind > of semi-hosting io, like gdbserver. Yeah - the worse part is that I saw the use of printf, frowned on it, but let it go because I didn't see a quick way of avoiding it. Lessons learned for me. > 2009-03-18 Pedro Alves > > * return-nodebug.c: Don't include stdio.h. > (init): Delete. > (func): Delete definition and provide extern declaration. > (t): New. > (main): Don't call printf. Call func and store its result in t. > * return-nodebug1.c: New. > * return-nodebug.exp: Don't expect stdio output. Instead, print > the global variable t. Drop printf formatters and cast types from > foreach loop. Don't use prepare_for_testing. Compile > return-nodebug.c and return-nodebug1.c in separate steps. Don't > define FORMAT or CAST. Looks great to me. In the future, don't feel obliged to fix it yourself unless you want to. I can help fix my own messes... -- Joel