From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26761 invoked by alias); 24 Jul 2013 14:33:49 -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 26748 invoked by uid 89); 24 Jul 2013 14:33:48 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Jul 2013 14:33:47 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6OEXcKj013932 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Jul 2013 10:33:38 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6OEXa3E004334; Wed, 24 Jul 2013 10:33:37 -0400 Message-ID: <51EFE5C0.60706@redhat.com> Date: Wed, 24 Jul 2013 14:33:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Nikita Karetnikov CC: gdb@sourceware.org Subject: Re: Debugging 64-bit programs using 32-bit GDB References: <87r4f8oxo3.fsf@karetnikov.org> In-Reply-To: <87r4f8oxo3.fsf@karetnikov.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00084.txt.bz2 On 07/09/2013 11:06 AM, Nikita Karetnikov 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. (you can however connect a 32-bit GDB to a 64-bit GDBserver, and use that to debug a 64-bit program, though that's more trouble than just using a 64-bit GDB.). > > I've tried to configure GDB 7.6 with '--enable-64-bit-bfd' (see [2]), > but it still shows "mips-tdep.c:709: internal-error: bad register > size". The x86_64 port catches the case early and bails out (amd64_linux_read_description): if (sizeof (void *) == 4 && is_64bit && !is_x32) error (_("Can't debug 64-bit process with 32-bit GDB")); It'd be obviously better if MIPS native target did the same, instead of tripping on assertions. > [1] http://www.fdn.fr/~lcourtes/tmp/guile-static-stripped-2.0.9-mips64el-linux-gnuabi64.tar.xz > [2] http://www.linux-mips.org/archives/linux-mips/2010-10/msg00336.html -- Pedro Alves