From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13277 invoked by alias); 22 May 2011 22:55:19 -0000 Received: (qmail 13268 invoked by uid 22791); 22 May 2011 22:55:19 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from oproxy3-pub.bluehost.com (HELO oproxy3-pub.bluehost.com) (69.89.21.8) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sun, 22 May 2011 22:55:05 +0000 Received: (qmail 26398 invoked by uid 0); 22 May 2011 22:55:04 -0000 Received: from unknown (HELO box531.bluehost.com) (74.220.219.131) by oproxy3.bluehost.com with SMTP; 22 May 2011 22:55:04 -0000 Received: from 146-115-68-18.c3-0.lex-ubr3.sbo-lex.ma.cable.rcn.com ([146.115.68.18] helo=[172.31.1.105]) by box531.bluehost.com with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1QOHY7-00016j-Uj; Sun, 22 May 2011 16:55:04 -0600 Subject: Re: Debugging 32bit apps with 64bit target gdb From: Paul Smith Reply-To: psmith@gnu.org To: Mark Kettenis Cc: gdb@sourceware.org In-Reply-To: <201105222240.p4MMeAfF013279@glazunov.sibelius.xs4all.nl> References: <1305836264.2776.76.camel@homebase> <1306103110.2776.93.camel@homebase> <201105222240.p4MMeAfF013279@glazunov.sibelius.xs4all.nl> Content-Type: text/plain; charset="us-ascii" Date: Sun, 22 May 2011 22:55:00 -0000 Message-ID: <1306104901.2776.96.camel@homebase> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Identified-User: {678:box531.bluehost.com:madscie1:mad-scientist.us} {sentby:smtp auth 146.115.68.18 authed with paul+mad-scientist.us} X-IsSubscribed: yes 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/msg00122.txt.bz2 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? Thanks! -- ------------------------------------------------------------------------------- Paul D. Smith Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist