From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Replicate src dir in build dir
Date: Wed, 20 Sep 2017 17:45:00 -0000 [thread overview]
Message-ID: <06499c43-88b6-06cd-b3d8-4964bbd3b58e@redhat.com> (raw)
In-Reply-To: <86y3p99uy3.fsf@gmail.com>
On 09/20/2017 05:49 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> We've had to touch these lists several times recently to add some object to
>> a bunch of triplets. It'd be nice to move the common CPU-specific files to
>> variables shared by the different OS triplets, so that we'd have simple places
>> to edit them. Similar to srv_i386_linux_regobj etc. in
>> gdbserver/configure.srv.
>
> This is about common CPU-specific files shared by different triplets.
> This makes think a little bit further, how do we handle common
> OS-specific files shared by different triplets? We can match triplet
> CPU part and OS part respectively, and append the right objects to
> gdb_target_obs, like this,
>
> i386_tobjs="i386-tdep.o i386.o i387-tdep.o"
> amd64_tobjs="amd64-tdep.o arch/amd64.o"
> gdb_target_obs=""
>
> # Fill in gdb_target_obs according to CPU.
>
> case "${targ}" in
> aarch64*-*-*)
> gdb_target_obs="aarch64-tdep.o aarch64-insn.o ${gdb_target_obs}";;
> arm*-*-*)
> gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o ${gdb_target_obs}";;
> i[34567]86-*-*)
> gdb_target_obs="${i386_tobjs} ${gdb_target_obs}";;
> if test "x$enable_64_bit_bfd" = "xyes"; then
> gdb_target_obs="${amd64_tobjs} ${gdb_target_obs}"
> fi
> sparc-*-*)
> gdb_target_obs="sparc-tdep.o ravenscar-thread.o sparc-ravenscar-thread.o ${gdb_target_obs}";;
>
> sparc64-*-*)
> gdb_target_obs="sparc-tdep.o sparc64-tdep.o ravenscar-thread.o sparc-ravenscar-thread.o ${gdb_target_obs}";;
>
> x86_64-*-*)
> gdb_target_obs="${i386_tobjs} ${amd64_tobjs} ${gdb_target_obs}";;
> esac
>
> # Fill in gdb_target_obs according to OS.
>
> case "${targ}" in
> *-*-freebsd*)
> gdb_target_obs="fbsd-tdep.o solib-svr4.o ${gdb_target_obs}";;
> *-*-netbsd*)
> gdb_target_obs="nbsd-tdep.o solib-svr4.o ${gdb_target_obs}";;
> *-*-openbsd*)
> gdb_target_obs="obsd-tdep.o solib-svr4.o ${gdb_target_obs}";;
> esac
>
> # Fill in the rest according to the triplet.
> ...
>
> What do you think?
Yes, that works for me too.
Meeting in the middle, using separate variables for arch and OS
objects would allow getting rid of the need for spelling out
gdb_target_obs twice per line, like:
case "${targ}" in
aarch64*-*-*)
cpu_obs="aarch64-tdep.o aarch64-insn.o";;
arm*-*-*)
cpu_obs="arm.o arm-get-next-pcs.o arm-tdep.o";;
esac
case "${targ}" in
*-*-freebsd*)
os_obs="fbsd-tdep.o solib-svr4.o";;
*-*-netbsd*)
os_obs="nbsd-tdep.o solib-svr4.o";;
*-*-openbsd*)
os_obs="obsd-tdep.o solib-svr4.o";;
esac
gdb_target_obs="${cpu_obs} ${os_obs}"
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-09-20 17:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 14:42 Yao Qi
2017-09-19 20:44 ` Simon Marchi
2017-09-20 8:04 ` Yao Qi
2017-09-20 8:17 ` Simon Marchi
2017-09-20 14:26 ` Yao Qi
2017-09-20 11:26 ` Pedro Alves
2017-09-20 16:49 ` Yao Qi
2017-09-20 17:45 ` Pedro Alves [this message]
2017-09-29 19:23 ` Yao Qi
2017-10-03 20:02 ` Pedro Alves
2017-10-03 20:14 ` Kamil Rytarowski
2017-10-03 22:04 ` Pedro Alves
2017-10-04 9:46 ` Kamil Rytarowski
2017-10-06 9:29 ` Yao Qi
2017-10-04 11:41 ` Pedro Alves
2017-10-06 10:21 ` Yao Qi
2017-10-08 3:24 ` Tom Tromey
2017-10-08 21:04 ` Yao Qi
2017-10-11 1:25 ` Yao Qi
2017-10-11 3:26 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06499c43-88b6-06cd-b3d8-4964bbd3b58e@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox