This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 07/14] add infcall_mmap and gcc_target_options gdbarch methods
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Mon, 19 May 2014 08:47:49 +0200
- Subject: Re: [PATCH 07/14] add infcall_mmap and gcc_target_options gdbarch methods
- Authentication-results: sourceware.org; auth=none
- References: <1400253995-12333-1-git-send-email-tromey at redhat dot com> <1400253995-12333-8-git-send-email-tromey at redhat dot com> <5379A051 dot 9040209 at codesourcery dot com> <20140519064019 dot GA19564 at host2 dot jankratochvil dot net>
On Mon, 19 May 2014 08:40:19 +0200, Jan Kratochvil wrote:
> On Mon, 19 May 2014 08:10:25 +0200, Yao Qi wrote:
> > > +# Return string (caller has to use xfree for it) with options for GCC
> > > +# to produce code for this target, typically "-m64", "-m32" or "-m31".
> > > +# These options are put before CU's DW_AT_producer compilation options so that
> > > +# they can override it. Method may also return NULL.
> > > +m:char *:gcc_target_options:void:::default_gcc_target_options::0
> > > EOF
> > > }
> >
> > I doubt the interface like this is sufficient for other archs, like
> > arm and mips, which have multiple multilibs, such as -marm/thumb,
> > -mfloat-abi={hard,softfp}, etc. This hook in GDB has to take something
> > into account, such as gdbarch, current frame, the related bfd, etc, in
> > order to return a correct or compatible options for gcc to compile
> > source.
>
> It already already takes 'gdbarch' as its parameter. If it is not enough some
> more parameters can be added. But IMO those should be added only when this
> method gets implemented for arch which needs such parameter.
Oh, you maybe mean that default_gcc_target_options should just error() out as
the default implementation does not work for many existing archs. And only
tested archs should get implemented their gcc_target_options (even if they
look as the current default_gcc_target_options).
I was considering it but I was expecting 99% of arch will look the same but if
it is not the case the default really can be error().
Jan