From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24781 invoked by alias); 14 Jan 2008 17:09:21 -0000 Received: (qmail 24766 invoked by uid 22791); 14 Jan 2008 17:09:21 -0000 X-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_46,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 14 Jan 2008 17:09:01 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0EH8xCj017765 for ; Mon, 14 Jan 2008 12:08:59 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0EH8x8r032752 for ; Mon, 14 Jan 2008 12:08:59 -0500 Received: from localhost.localdomain (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0EH8w3n002993; Mon, 14 Jan 2008 12:08:59 -0500 Message-ID: <478B96A6.3090509@redhat.com> Date: Mon, 14 Jan 2008 17:09:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Stan Cox CC: frysk@sourceware.org Subject: Re: [SCM] master: Add -sysroot option to fhpd. References: <20080114051518.31275.qmail@sourceware.org> In-Reply-To: <20080114051518.31275.qmail@sourceware.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00023.txt.bz2 Stan, A few things caught my eye: scox@sourceware.org wrote: > +frysk/pkglibdir/funit-addresses-stripped: frysk/pkglibdir/funit-addresses > + strip -o $@ frysk/pkglibdir/funit-addresses > + mkdir -p `pwd`/frysk/pkglibdir/test-sysroot/`pwd`/frysk/pkglibdir > + cp -r `pwd`/frysk/pkglibdir/funit-addresses `pwd`/frysk/pkglibdir/test-sysroot/`pwd`/frysk/pkglibdir > + mkdir -p `pwd`/frysk/pkglibdir/test-sysroot/$(realpath $(srcdir))/frysk/pkglibdir > + cp -r $(realpath $(srcdir))/frysk/pkglibdir/funit-addresses.c `pwd`/frysk/pkglibdir/test-sysroot/$(realpath $(srcdir))/frysk/pkglibdir > + mkdir -p `pwd`/frysk/pkglibdir/test-sysroot/usr/lib/debug/`pwd`/frysk/pkglibdir/ > + eu-strip --remove-comment -f `pwd`/frysk/pkglibdir/test-sysroot/usr/lib/debug/`pwd`/frysk/pkglibdir/funit-addresses.debug \ > + `pwd`/frysk/pkglibdir/test-sysroot/`pwd`/frysk/pkglibdir/funit-addresses > Right on; it needs to construct what looks like an installed sysroot so that we're testing against how things will appear in a live system. Two extra things to consider though: how to get this data installed; and now to have it also built 32-bit. > diff --git a/frysk-core/frysk/debuginfo/DebugInfoFrame.java b/frysk-core/frysk/debuginfo/DebugInfoFrame.java > index 8f2229e..f1d8682 100644 > --- a/frysk-core/frysk/debuginfo/DebugInfoFrame.java > +++ b/frysk-core/frysk/debuginfo/DebugInfoFrame.java > @@ -48,6 +48,7 @@ import lib.dwfl.Dwfl; > import lib.dwfl.DwflDieBias; > import lib.dwfl.DwflLine; > import frysk.dwfl.DwflCache; > +import frysk.hpd.DbgVariables; > import frysk.rt.LineXXX; > import frysk.scopes.SourceLocation; > import frysk.scopes.Scope; > @@ -183,6 +184,13 @@ public class DebugInfoFrame extends FrameDecorator { > File parent = new File(dwflLine.getCompilationDir()); > f = new File(parent, dwflLine.getSourceFile()); > } > + else { > + String sysroot = DbgVariables.getStringValue("SYSROOT"); > + if (sysroot.length() > 0) { > + File parent = new File(sysroot); > + f = new File(parent, dwflLine.getSourceFile()); > + } > + } > I'm not so sure about DebugInfoFrame using hpd to obtain a sysroot; and can this be coded to just assume that there's a sysroot ("/" by default)? Given that the underlying Dwfl knows its sysroot, would it be both simpler and more consistent to use that, and to do so internally? It would also remove the need to constantly need to remember to add code like the below: > diff --git a/frysk-core/frysk/hpd/ListCommand.java b/frysk-core/frysk/hpd/ListCommand.java > index 7b9c4ce..0161144 100644 > --- a/frysk-core/frysk/hpd/ListCommand.java > +++ b/frysk-core/frysk/hpd/ListCommand.java > @@ -120,7 +120,13 @@ class ListCommand extends ParameterizedCommand { > } > if (funcDie.getTag().hashCode() == DwTag.SUBPROGRAM_) { > line = (int)funcDie.getDeclLine(); > - file = funcDie.getDeclFile(); > + String sysRoot = DbgVariables.getStringValue("SYSROOT"); > + if (sysRoot.length() > 0) { > + File parent = new File(sysRoot); > + file = new File(parent, funcDie.getDeclFile().getName()); > + } > + else > + file = funcDie.getDeclFile(); > } > else { > cli.addMessage("function " + cmd.parameter(0) + " not found.", > and > @@ -146,6 +152,11 @@ class ListCommand extends ParameterizedCommand { > if (file == null) { > if (frame.getLine() != SourceLocation.UNKNOWN) { > file = (frame.getLine()).getFile(); > + String sysRoot = DbgVariables.getStringValue("SYSROOT"); > + if (sysRoot.length() > 0) { > + File parent = new File(sysRoot); > + file = new File(parent, file.getAbsolutePath()); > + } > if (file == null) { > cli.addMessage("No symbol table is available.", > Message.TYPE_NORMAL); > where ever a source-file is needed. Andrew