Re: [patch] for mig check in GDB's configure

Doug Evans
2013-05-04T17:22:41Z

On Fri, May 3, 2013 at 3:43 AM, 陆岳 <hacklu.newborn@gmail.com> wrote:
>> Hmm, I think that instead of only examining the host system, $host, this
>> also needs to examine the target system, $target. (Please tell if the
>> difference between build, host, and target system is not clear to you.)
>> The MIG tool is used to generate files (from RPC definition files) that
>> are used by the native GDB port for GNU Hurd (which, of couse, is the
>> only GNU Hurd port that currently exists.) But if someone, for example,
>> builds GDB targeting mips-linux-gnu on a GNU Hurd system, they would not
>> need the MIG tool.
>>
>
> To my knowledge now, $target just need to set when building a compiler
> which specify which plateform your compiler generate code for. When we
> build GDB, it is trivial to check the variable.
> In your example, builds GDB targeting mips-linux-gnu means the GDB is
> running on mips-linux. So we only need to set the
> $host=mips-linux-gnu, $build=*-*-gnu.
> Maybe I have got a wrong understanding about these gcc terms.

I can run gdb on an x86 system and debug a program running on a mips
system via gdbserver (or some other program that speaks gdb's remote
protocol).

--build = system you're building the tool on
--host = system the tool will run on
--target = system the tool will handle or target (generate code for in
the case of gcc, debug in the case of gdb)

[These terms are common to all GNU tools, not just gcc btw.]

All three can be different for gdb as well as gcc.

So for example I *could*, given appropriately ported tools,
build gdb on x86, run it on mips, and have it debug programs running on arm.