From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23044 invoked by alias); 29 Jan 2010 03:51:26 -0000 Received: (qmail 23034 invoked by uid 22791); 29 Jan 2010 03:51:25 -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; Fri, 29 Jan 2010 03:51:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CF1D12BABDA; Thu, 28 Jan 2010 22:51:16 -0500 (EST) 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 aVSeRWshY4sr; Thu, 28 Jan 2010 22:51:16 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1D5522BABB7; Thu, 28 Jan 2010 22:51:16 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 6071CF59A0; Fri, 29 Jan 2010 07:50:54 +0400 (RET) Date: Fri, 29 Jan 2010 03:51:00 -0000 From: Joel Brobecker To: Doug Evans Cc: Jan Kratochvil , Hui Zhu , gdb-patches ml , Tristan Gingold , Daniel Jacobowitz Subject: Re: [RFA] Show some tips when file cmd get bfd_error_file_ambiguously_recognized Message-ID: <20100129035054.GA26827@adacore.com> References: <20100114101348.GA24756@host0.dyn.jankratochvil.net> <20100119075642.GA30154@host0.dyn.jankratochvil.net> <20100128215609.GA31654@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00629.txt.bz2 > > Rather than all the C strings manipulation fragile magic maybe one could > > afford mem_fileopen with ui_file_xstrdup (as being done sometimes in GDB). > > Fine with me. > [I've always lamented the absence of such a facility in C itself.] I made the very same suggestion when reviewing the patch for D support, and Tom reminded us of of another option: libiberty/dyn-string.c (looking at this code, the memory allocated is doubled every time the buffer needs to be expanded, so it should be relatively efficient). -- Joel