This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH/RFC] Move the cmdarg before load execarg
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Fri, 28 Jan 2011 10:52:13 +0100
- Subject: Re: [PATCH/RFC] Move the cmdarg before load execarg
- References: <AANLkTik=q2dyCeMD5A3-dvjSsnzBxLb8y1NtA8-2-i_h@mail.gmail.com>
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