This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debugging 64-bit programs using 32-bit GDB


On Wed, 24 Jul 2013, Pedro Alves wrote:

> > Is it possible to debug a 64-bit executable ('bin/guile' [1]) using
> > 32-bit GDB?  (I use GNU/Linux.)
> 
> I don't think so.  The ptrace registers interfaces allow retrieving
> the right register sets (at least the modern interfaces), but
> things like breakpoints, etc. won't work, as the 32-bit GDB won't
> be able to handle the inferior's 64-bit addresses (due to how ptrace
> works).  Last I checked, Power had extra ptrace interfaces for that.
> Don't know about MIPS.

 This is apparently supported -- <asm/ptrace.h> on MIPS/Linux has this:

/* Calls to trace a 64bit program from a 32bit program.	 */
#define PTRACE_PEEKTEXT_3264	0xc0
#define PTRACE_PEEKDATA_3264	0xc1
#define PTRACE_POKETEXT_3264	0xc2
#define PTRACE_POKEDATA_3264	0xc3
#define PTRACE_GET_THREAD_AREA_3264	0xc4

and arch/mips/kernel/ptrace32.c in the kernel tree has corresponding code.
So it looks like we could support it.

  Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]