From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26449 invoked by alias); 2 Oct 2009 01:53:10 -0000 Received: (qmail 26437 invoked by uid 22791); 2 Oct 2009 01:53:09 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 02 Oct 2009 01:53:05 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id D257BB005D; Thu, 1 Oct 2009 21:53:03 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id n921r3Kn029907; Thu, 1 Oct 2009 21:53:03 -0400 Date: Fri, 02 Oct 2009 01:53:00 -0000 From: Jack Howarth To: Jonas Maebe Cc: gdb@sourceware.org Subject: Re: gdb seems to be broken on darwin 10.5.8 and later Message-ID: <20091002015303.GA29817@bromo.med.uc.edu> References: <20090930162038.GA7190@bromo.med.uc.edu> <8A12DBCB-8C04-4FAD-85ED-2447CD01F1ED@elis.ugent.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8A12DBCB-8C04-4FAD-85ED-2447CD01F1ED@elis.ugent.be> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-10/txt/msg00031.txt.bz2 On Thu, Oct 01, 2009 at 01:29:28PM +0200, Jonas Maebe wrote: > > On 30 Sep 2009, at 18:20, Jack Howarth wrote: > >> Now gdb errors out earlier and claims that darwin executables >> aren't valid executable files. Is anyone else seeing that on >> darwin? > > Since you mentioned later that you are on 10.6, might the problem be > that previously you only tested gdb on programs compiled under 10.5.x or > with "-mmacosx-version-min 10.5" (or earlier), while you are now trying > with a program compiled on and for 10.6? Apple added/changed some things > to the Mach-O object format in 10.6 (just like in 10.5), and e.g. (some?) > binaries compiled for 10.6 are not recognised as valid executables at all > on 10.5 or earlier. gdb might be confused for similar reasons. > > You may want to try compiling your program with "-mmacosx-version-min > 10.5" and check again. > > > Jonas Actually tonight's gdb cvs built on x86_64-apple-darwin10 seems to work fairly well with the proposed macho changes as long as I run as root. Targeting binaries for 10.6 doesn't seem to be a problem. The only issue I have run into so far is with binaries built at -O3 with gcc trunk. With Apple's gcc-4.2 compiler, if I compile... gcc -m64 -g -O3 himenoBMTxpa.c break points are set normally... (gdb) break 4 Breakpoint 1 at 0x100001b14: file himenoBMTxpa.c, line 4. but with binaries built with gcc 4.5, I find that this doesn't work... (gdb) break 4 Breakpoint 1 at 0x100002832: file himenoBMTxpa.c, line 70. (4 locations) The problem disappears if I regress the compile back to -O2 with gcc 4.5. Is this problem being seen with gdb under linux? Jack