This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Move arch/tdesc.h to common/common-tdesc.h
- From: Philipp Rudo <prudo at linux dot vnet dot ibm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: Alan Hayward <Alan dot Hayward at arm dot com>, "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Tue, 6 Feb 2018 18:56:09 +0100
- Subject: Re: [PATCH] Move arch/tdesc.h to common/common-tdesc.h
- Authentication-results: sourceware.org; auth=none
- References: <97948063-b3db-fd3a-f62e-b552935cb8dd@arm.com> <20180201121443.43322674@ThinkPad> <59984094-96C1-4D84-89F6-384769471005@arm.com> <86k1vqjd5s.fsf@gmail.com>
Hi Yao,
On Tue, 06 Feb 2018 16:28:15 +0000
Yao Qi <qiyaoltc@gmail.com> wrote:
> Alan Hayward <Alan.Hayward@arm.com> writes:
>
> > That results in common/tdesc.h and gdbserver/tdesc.h
> > That’s not a problem by itself, because we can just prefix the dir
> > name as part of the include.
> >
>
> I don't see how does the name of *.c file affect the name of *.h file.
> We can still use common/tdesc.h no matter what the *.c name is.
Of course you could name the *.h file anything you want. But from my point of
view the *.c and *.h files belonging together should have the same name.
Having this in mind you cannot call it common/tdesc.h because in
gdbserver/Makefile:OBS the directory is ignored and both (common/tdesc.c and
gdbserver/tdec.c) would be compiled to tdesc.o, (most likely) leading to
unintended behavior.
> > My next set of patches will then add common/tdesc.c.
> > This is slightly more tricky because we now build two tdesc.o files.
>
> I am inclined to create common/ directory in gdb and gdbserver build
> tree, and put the object files in the right directory.
Yao, what do you mean with this? There already is a common/ directory with
code shared by gdb and gdbserver. The thing is that tdesc.h was in arch/ not
in common/. Alan, Omair (if I recall right) and I agreed that it would be
better to move it to common/ because arch/ should only contain architecture
specific code. Or am I understanding you wrong?
Philipp
> > The gdbserver IPA rules will need tweaking, and I’m not sure the OBS
> > list will work as it is (given it doesn’t have any dir names).
> >
> > Like you, I wasn’t sure if there was a naming convention for common/.
> > In the end I went with the easiest solution :)
>