How to configure a cross gdb to debug natively
H . J . Lu
hjl@lucon.org
Fri Jul 13 13:48:00 GMT 2001
On Fri, Jul 13, 2001 at 01:23:46PM -0700, H . J . Lu wrote:
> I'd like to configure gdb inside a tree with binutils, gcc and gdb
> on Linux/i686 with
>
> # ../configure --target=i386-linux ....
>
> I do that on purpose so that gcc and binutils won't use any files
> on the host machine. But gdb refuses to debug natively on Linux/i686
> since it is configured as a cross gdb, However, Linux/i686 is
> compatible with i386-linux, how can I convince gdb to debug natively?
>
This patch seems to do the trick for me.
H.J.
----
2001-07-13 H.J. Lu (hjl@gnu.org)
* configure.in: Check "${target_os}" = "${host_os}" and
"${gdb_target_cpu}" = "${gdb_host_cpu}" for native files
instead of "${target}" = "${host}".
* configure: Regenerated.
--- gdb/configure.in.arch Fri Jul 13 12:12:33 2001
+++ gdb/configure.in Fri Jul 13 13:36:15 2001
@@ -1183,7 +1183,7 @@ s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[
# these really aren't orthogonal true/false values of the same condition,
# but shells are slow enough that I like to reuse the test conditions
# whenever possible
-if test "${target}" = "${host}"; then
+if test "${target_os}" = "${host_os}" -a "${gdb_target_cpu}" = "${gdb_host_cpu}"; then
nativefile=`sed -n '
s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${host_makefile_frag}`
More information about the Gdb-patches
mailing list