From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30149 invoked by alias); 14 Jan 2010 10:15:19 -0000 Received: (qmail 30134 invoked by uid 22791); 14 Jan 2010 10:15:17 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jan 2010 10:15:07 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0EADqvv009892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Jan 2010 05:13:52 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0EADnvR008179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jan 2010 05:13:51 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id o0EADnEC025889; Thu, 14 Jan 2010 11:13:49 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id o0EADmWm025885; Thu, 14 Jan 2010 11:13:48 +0100 Date: Thu, 14 Jan 2010 10:15:00 -0000 From: Jan Kratochvil To: Hui Zhu Cc: gdb-patches ml , Tristan Gingold , Daniel Jacobowitz Subject: Re: [RFA] Show some tips when file cmd get bfd_error_file_ambiguously_recognized Message-ID: <20100114101348.GA24756@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-01/txt/msg00375.txt.bz2 On Thu, 14 Jan 2010 03:43:58 +0100, Hui Zhu wrote: > exec_file_attach (char *filename, int from_tty) > { > + char **matching; This new variable could be moved to one more inner block. > + if (bfd_get_error () == bfd_error_file_ambiguously_recognized) > + { > + char **p = matching; There is commonly an empty line between declarations and first code line. > + fprintf_filtered (gdb_stderr, _("\"%s\":Matching formats:"), > + scratch_pathname); Missing space before "Matching formats". Isn't it "Matching targets" instead? Anyway I would still prefer to print even bfd_errmsg() for it as it is now IMO unclear why "Matching formats" has been printed and that any error occured: > "/ls":Matching formats: elf32-nbigmips elf32-ntradbigmips > Use command "set gnutarget" handle it. > + while (*p) > + fprintf_filtered (gdb_stderr, " %s", *p++); (Only a personal preference: for (p = matching; *p != NULL; p++) as this is the most common iterating loop, nothing special to use `while'.) > + fprintf_filtered (gdb_stderr, "\n"); (There exists also fputc_filtered.) > + free (matching); Use xfree (see gdbint); despite the memory does not come from xmalloc. > + error (_("Use command \"set gnutarget\" handle it.")); Missing "to" - "to handle it"; or just use _("Use command \"...\"."). > + } > + else > + error (_("\"%s\": not in executable format: %s"), > + scratch_pathname, bfd_errmsg (bfd_get_error ())); > } > > /* FIXME - This should only be run for RS6000, but the ifdef is a poor Your patch has been sent with spaces (' ') instead of tabs ('\t') to follow the GNU coding style (not using `indent -nut'). Regards, Jan