This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [rfc] bi-arch for x86-64 corefile.
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: palves at redhat dot com
- Cc: yao at codesourcery dot com, hjl dot tools at gmail dot com, binutils at sourceware dot org, gdb at sourceware dot org
- Date: Tue, 30 Oct 2012 14:54:40 +0100 (CET)
- Subject: Re: [rfc] bi-arch for x86-64 corefile.
- References: <1350881426-4945-1-git-send-email-yao@codesourcery.com> <CAMe9rOpeR8AX6EG8mNcfZNHNMrpZmv1S4O8H7BmREsU1vyN1jQ@mail.gmail.com> <508F3B88.8060701@codesourcery.com> <CAMe9rOrXFG_E7F0hhHjexEhahWWNVwfxfSXoOcCAU9XotSuuVw@mail.gmail.com> <508F578F.8050807@codesourcery.com> <CAMe9rOp_7=S5rTEC+T8Q-UkZj3wDNNM6AhwbRXn18nZAGDH03A@mail.gmail.com> <508FCA04.6010600@codesourcery.com> <508FCEC5.2020403@redhat.com>
> Date: Tue, 30 Oct 2012 12:57:41 +0000
> From: Pedro Alves <palves@redhat.com>
>
> On 10/30/2012 12:37 PM, Yao Qi wrote:
>
> > This requires something different in configure options. In my previous patch, when configure i686-pc-linux-gnu-gdb to handle bi-arch, we run configure with '--enable-64-bit-bfd'. In current trunk (w/ your patch), we have to run configure with '--enable-targets=x86_64-pc-linux-gnu'.
> >
> > Copy gdb@ here to make sure GDB people are aware of this change, otherwise, configuring gdb with '--enable-64-bit-bfd' only still doesn't work for handling x86-64 corefile on x86 gdb.
>
> That sounds like an unnecessary restriction. A 32-bit GDB can debug a 64-bit
> inferior with gdbserver just fine (it can also debug a 64-bit core), provided GDB
> is built with --enable-64-bit-bfd. Yes, debugging a native 64-bit inferior won't
> work due to ptrace limitations, but GDB's gcore command can generate cores
> even when remote debugging w/ gdbserver.
>
> We have things like this, gdb/configure.tgt:
>
> i[34567]86-*-linux*)
> # Target: Intel 386 running GNU/Linux
> gdb_target_obs="i386-tdep.o i386-linux-tdep.o glibc-tdep.o i387-tdep.o \
> solib-svr4.o symfile-mem.o \
> linux-tdep.o linux-record.o"
> if test "x$enable_64_bit_bfd" = "xyes"; then
> # Target: GNU/Linux x86-64
> gdb_target_obs="amd64-tdep.o amd64-linux-tdep.o ${gdb_target_obs}"
> fi
> build_gdbserver=yes
> ;;
>
> So it's be nice if bfd did the same in this case. Thus, I'd very much
> prefer if --enable-64-bit-bfd was enough for making bi-arch corefiles
> work.
The problem is that the Linux core file support in bfd is still relies
on native headers. Trying to "fix them up" for bi-arch like what's
been done for the last couple of years on Linux is never going to give
you true cross-debugging support.