From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16866 invoked by alias); 22 May 2011 23:10:29 -0000 Received: (qmail 16857 invoked by uid 22791); 22 May 2011 23:10:29 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 May 2011 23:10:14 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id p4MNAA51025529; Mon, 23 May 2011 01:10:10 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id p4MNA92P021674; Mon, 23 May 2011 01:10:09 +0200 (CEST) Date: Sun, 22 May 2011 23:10:00 -0000 Message-Id: <201105222310.p4MNA92P021674@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: psmith@gnu.org CC: gdb@sourceware.org In-reply-to: <1306104901.2776.96.camel@homebase> (message from Paul Smith on Sun, 22 May 2011 18:55:01 -0400) Subject: Re: Debugging 32bit apps with 64bit target gdb References: <1305836264.2776.76.camel@homebase> <1306103110.2776.93.camel@homebase> <201105222240.p4MMeAfF013279@glazunov.sibelius.xs4all.nl> <1306104901.2776.96.camel@homebase> 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 X-SW-Source: 2011-05/txt/msg00123.txt.bz2 > From: Paul Smith > Date: Sun, 22 May 2011 18:55:01 -0400 > > On Mon, 2011-05-23 at 00:40 +0200, Mark Kettenis wrote: > > > From: Paul Smith > > > Date: Sun, 22 May 2011 18:25:10 -0400 > > > > > > A short summary, I'm trying to see if I can build one GDB executable > > > with all these properties: > > > > > > * Is a 32bit application so it can run on both 32bit and 64bit > > > systems > > > * Can debug 32bit applications > > > * Can debug 64bit applications (when run on a 64bit system > > > obviously) > > > * If I can get it to debug a 64bit core file when running on a > > > 32bit system (with --sysroot pointing to a 64bit sysroot of > > > course) that would be awesome. > > > > > > I'm only concerned with x86 architectures (for now?) > > > > > > Is such a thing possible? > > > > I believe this is possible on Solaris. It is possible on powerpc > > Linux. It is *not* possible on Linux. Not GDB's fault. The x86 > > Linux kernel simply doesn't provide the necessary support. > > Yes, I'm using Linux. Sorry to forget that detail. > > Interesting. I could have sworn I've seen this work before but maybe > there was simply magic going on behind the scenes (gdb was a shell > script that invoked a correct version based on the target architecture, > or something). > > So, I need to build a 32bit GDB to debug 32bit apps and a 64bit GDB to > debug 64bit apps? A 64-bit x86 Linux GDB will debug both 32-bit and 64-bit code. A 32-bit x86 Linux GDB will only debug 32-bit code. Cheers, Mark