From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8436 invoked by alias); 20 Oct 2010 15:45:32 -0000 Received: (qmail 8385 invoked by uid 22791); 20 Oct 2010 15:45:28 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from nx.neverkill.us (HELO nx.neverkill.us) (193.34.68.112) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Oct 2010 15:45:20 +0000 Received: from [127.0.0.1] (srv.neverkill.us [10.10.10.1]) by nx.neverkill.us (Postfix) with ESMTP id 29C5231366; Wed, 20 Oct 2010 17:45:17 +0200 (CEST) Subject: Re: gdb darwin target on Linux host? From: Paul Starzetz To: Tristan Gingold Cc: gdb@sourceware.org In-Reply-To: <1287588922.28107.281.camel@hp> References: <20101020135306.9C60531366@nx.neverkill.us> <20101020143016.6BE9131366@nx.neverkill.us> <20101020144225.2316031366@nx.neverkill.us> <20101020151257.25F2D31366@nx.neverkill.us> <1287588922.28107.281.camel@hp> Content-Type: text/plain; charset="ISO-8859-1" Date: Wed, 20 Oct 2010 15:45:00 -0000 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Message-Id: <20101020154517.29C5231366@nx.neverkill.us> 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: 2010-10/txt/msg00086.txt.bz2 On Wed, 2010-10-20 at 17:35 +0200, Peter Steiner wrote: > > > file /home/exchange/ls > > > /home/exchange/ls: Mach-O fat file with 2 architectures > > > > You can't debug fat binaries. You have to extract the executable you really want to debug. > > > > tried this - no luck at all! > > lipo -extract x86_64 /bin/ls -output ls.64 > lipo -extract i386 /bin/ls -output ls.32 ok ok I see my error... I must use -thin: lipo -thin x86_64 /bin/ls -output ls.64 now I can load it into native box gdb7.2: gdb-7.2 root# ./gdb/gdb /opt/src/ls.64 GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-apple-darwin10.0.0". For bug reporting instructions, please see: ... Reading symbols from /opt/src/ls.64...(no debugging symbols found)...done. BUT: on a cross-gdb compiled on Linux host I get now another error trying to read the "thinned" ls.64: gdb-7.2/gdb # /usr/local/gdb/bin/x86_64-apple-darwin-gdb /home/exchange/ls.64 GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host= --target=x86_64-apple-darwin". For bug reporting instructions, please see: ... Reading symbols from /home/exchange/ls.64...I'm sorry, Dave, I can't do that. Symbol format `mach-o-x86-64' unknown. Setting up the environment for debugging gdb. why is that? I compiled on native darwin and Linux from the same tarball 7.2.