From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: Nikita Karetnikov <nikita@karetnikov.org>, <gdb@sourceware.org>
Subject: Re: Debugging 64-bit programs using 32-bit GDB
Date: Wed, 24 Jul 2013 21:21:00 -0000 [thread overview]
Message-ID: <alpine.DEB.1.10.1307242209360.32382@tp.orcam.me.uk> (raw)
In-Reply-To: <51EFE5C0.60706@redhat.com>
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
prev parent reply other threads:[~2013-07-24 21:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 10:02 Nikita Karetnikov
2013-07-24 14:33 ` Pedro Alves
2013-07-24 16:09 ` Doug Evans
2013-07-24 16:25 ` Pedro Alves
2013-07-24 17:14 ` Pedro Alves
2013-07-24 21:21 ` Maciej W. Rozycki [this message]
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=alpine.DEB.1.10.1307242209360.32382@tp.orcam.me.uk \
--to=macro@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=nikita@karetnikov.org \
--cc=palves@redhat.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