This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 07/14] add infcall_mmap and gcc_target_options gdbarch methods


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]