From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18606 invoked by alias); 28 Jan 2011 09:52:22 -0000 Received: (qmail 18596 invoked by uid 22791); 28 Jan 2011 09:52:22 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Fri, 28 Jan 2011 09:52:18 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0S9qGnn024891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 Jan 2011 04:52:17 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0S9qE8B019353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 28 Jan 2011 04:52:16 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p0S9qE5E023324; Fri, 28 Jan 2011 10:52:14 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id p0S9qDEM023323; Fri, 28 Jan 2011 10:52:13 +0100 Date: Fri, 28 Jan 2011 09:58:00 -0000 From: Jan Kratochvil To: Hui Zhu Cc: gdb-patches ml Subject: Re: [PATCH/RFC] Move the cmdarg before load execarg Message-ID: <20110128095213.GA18993@host1.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.21 (2010-09-15) 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: 2011-01/txt/msg00533.txt.bz2 On Fri, 28 Jan 2011 07:41:22 +0100, Hui Zhu wrote: > I got following trouble: > gdb -q -ex "set gnutarget elf32-littlearm" ./vmlinux > "/home/teawater/kernel/barm_versatile_926ejs/vmlinux": not in executable format: File format is ambiguous. > Matching formats: elf32-littlearm elf32-littlearm-symbian elf32-littlearm-vxworks. > Use "set gnutarget format-name" to specify the format. > > Even if I use -ex to exec the command to set the gnutarget, but it is > useless because cmdarg is exec after the vmlinux load. > > I think -ex should have more high level than others. So I make a > patch let it exec before load execarg. > What do you think about it? It apparently breaks the much more common case of: gdb program -ex 'b main' You should just use: gdb -q -ex "set gnutarget elf32-littlearm" -ex "file ./vmlinux" as changing options required before the image load is generally an advanced topic so I guess the "file" command requirement is OK in such case. Thanks, Jan