From owner-freebsd-emulation@FreeBSD.ORG Fri Jan 4 14:30:09 2013 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8173C255 for ; Fri, 4 Jan 2013 14:30:09 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 22F846A9 for ; Fri, 4 Jan 2013 14:30:08 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so7914857wey.13 for ; Fri, 04 Jan 2013 06:30:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=gcxaxnO/F7iu4ZkzOjLkwUrc3ieg513X7yhDNnCwato=; b=WX8v30U7jO+YBWrB2dYa4JxIQLaZNJiCaRJB2pacc+oAkcG2+dBL3vxhgnBiDNlJ25 MMy5okvmoLqVaficyi/8YfiMiXSLG8j/oOX3PsXfe7MqZvCvYOhgbxKgB9O1Tld9zztJ QO7YWvtQBJM8dPb2Fi4ensvfMksOmKYEytoNU6ATa+9ib/FTccM2tyGp3NwNTQ+GbTGl GhpfExMNspWtm4Y+19ZV6K9Y+FP53bn43+HhLqtAdqzP9ULub4qNlzDo69UMbCvmaF7V KS7tUO+5XKfk65HkJVxMbHQgMyx3T78yquzL1xwYCE+MIdcR2splxyFcR9PaJ0DCMe2y x2Vw== X-Received: by 10.180.84.193 with SMTP id b1mr73224619wiz.26.1357309802445; Fri, 04 Jan 2013 06:30:02 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id dm3sm94142476wib.9.2013.01.04.06.30.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 06:30:01 -0800 (PST) Date: Fri, 4 Jan 2013 15:29:50 +0100 From: Mateusz Guzik To: Martin Laabs Subject: Re: Debugging a linux application and library in freebsd Message-ID: <20130104142950.GA12191@dft-labs.eu> References: <50E6D903.7080306@martinlaabs.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50E6D903.7080306@martinlaabs.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-emulation@freebsd.org X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 14:30:09 -0000 On Fri, Jan 04, 2013 at 02:28:35PM +0100, Martin Laabs wrote: > Hi, > > I'm currently searching a bug in the linuxulator concerning a libc > function. Therefore it would be very helpful using gdb to trace the program > not only instruction for instruction but also with the source code and full > symbols. > Building the linux binary that reproduce the bug is done in a VM running an > somewhat old debian. Building it with debugging symbols is also no problem. > I could also imagine to build the libc with debugging symbols (if not > available in some binary packages) > Would you suggest to do this with a cross compiler under the linuxulator > enviroment or in the debian VM? > > But anyway - the native gdb does not support linux binaries very well. So > did anyone tried to run a linux gdb inside the linuxulator enviroment to > trace the bug down into the library? Obviously the linux gdb does not know > anything about the linux-call translation but this should be transparent to it. > Afair linuxolator on amd64 does not support ptrace, therefore no gdb for you. However if this is still about http://www.freebsd.org/cgi/query-pr.cgi?pr=174933 I don't think you need it at this stage. You should be able to easly decipher arguments in socketcall and check what these mean in Linux kernel. Also reading glibc sources may be helpful. -- Mateusz Guzik