From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27948 invoked by alias); 24 Jul 2013 21:21:23 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 27939 invoked by uid 89); 24 Jul 2013 21:21:22 -0000 X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Jul 2013 21:21:13 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1V26Ub-0005Ym-Lp from Maciej_Rozycki@mentor.com ; Wed, 24 Jul 2013 14:21:05 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 24 Jul 2013 14:21:05 -0700 Received: from [172.30.64.136] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 24 Jul 2013 22:21:04 +0100 Date: Wed, 24 Jul 2013 21:21:00 -0000 From: "Maciej W. Rozycki" To: Pedro Alves CC: Nikita Karetnikov , Subject: Re: Debugging 64-bit programs using 32-bit GDB In-Reply-To: <51EFE5C0.60706@redhat.com> Message-ID: References: <87r4f8oxo3.fsf@karetnikov.org> <51EFE5C0.60706@redhat.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-07/txt/msg00092.txt.bz2 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 -- 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