public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Stan Cox <scox@redhat.com>
To: Frysk List <frysk@sourceware.org>
Subject: Re: [SCM]  master: Add -sysroot option to fhpd.
Date: Mon, 14 Jan 2008 13:17:00 -0000	[thread overview]
Message-ID: <1200316510.16575.105.camel@multics.rdu.redhat.com> (raw)
In-Reply-To: <1200301565.3383.5.camel@dijkstra.wildebeest.org>

On Mon, 2008-01-14 at 10:06 +0100, Mark Wielaard wrote:
> Hi Stan,
> 
> On Mon, 2008-01-14 at 05:15 +0000, scox@sourceware.org wrote:
> > commit c02d1bd3109ef0406be508fc08426e75b1b6fe07
> > Author: Stan Cox <scox@redhat.com>
> > Date:   Mon Jan 14 00:12:57 2008 -0500
> > 
> >     Add -sysroot option to fhpd.
> >     
> >     * fhpd.java (main): Add sysroot option.
> >     * Makefile.am (frysk/pkglibdir/funit-addresses-stripped): New
> >     * DwflCache.java (getSysRoot): New
> >     * DbgVariables.java (DbgVariables): Make public.
> >     (vars): Make static final.  Add SYSROOT.
> >     (getStringValue): Make static.  Return String.
> >     * ListCommand.java (interpret): Consider SYSROOT.
> >     * TestSysRoot.java: New file.
> >     * Dwfl.java (Dwfl): Add sysroot parameter.  Change all callers.
> > [...]
> > +    public void testHaveSysRoot() {
> > +	File testPath = Config.getPkgLibFile("funit-addresses");
> > +	System.out.println(Config.getBinFile("fhpd").getAbsolutePath() +
> > +		" -sysroot " + testPath.getParent() + "/test-sysroot/ " +
> > +	        testPath.getParent() + "/test-sysroot/"
> > +			   + testPath.getAbsolutePath());
> > +	child = new Expect(new String[] {
> > +		Config.getBinFile("fhpd").getAbsolutePath(),
> > +		"-sysroot", testPath.getParent() + "/test-sysroot/",
> > +	        testPath.getParent() + "/test-sysroot/"
> > +		+ testPath.getAbsolutePath()
> > +	    });
> 
> This test doesn't work for me (and note the System.out.println which
> probably shouldn't be there). It gives the following output:
> 
> $ ./TestRunner frysk.hpd.TestSysRoot
> Running testHaveSysRoot(frysk.hpd.TestSysRoot) .../home/mark/src/frysk-obj/frysk-core/frysk/bindir/fhpd -sysroot /home/mark/src/frysk-obj/frysk-core/frysk/pkglibdir/test-sysroot/ /home/mark/src/frysk-obj/frysk-core/frysk/pkglibdir/test-sysroot//home/mark/src/frysk-obj/frysk-core/frysk/pkglibdir/funit-addresses
> ERROR
>   frysk.expunit.EndOfFileException: end-of-file; expecting:  <<\(fhpd\) >>; buffer <<Usage: fhpd <PID> || fhpd <EXEFILE> || fhpd <COREFILE> [<EXEFILE>]
> 
>       -console <LOG=LEVEL,...>    Set the log LOG to level LEVEL. Can set 
>                                     multiple logs. The LEVEL can be [ OFF | 
>                                     SEVERE | WARNING | INFO | CONFIG | FINE | 
>                                     FINER | FINEST | ALL]. Example: -console 
>                                     frysk=FINEST
>       -log <LOG=LEVEL,...>        Set the log LOG to level LEVEL. Can set 
>                                     multiple logs. The LEVEL can be [ OFF | 
>                                     SEVERE | WARNING | INFO | CONFIG | FINE | 
>                                     FINER | FINEST | ALL]. Example -log 
>                                     frysk=FINE
>       -verbose                    output verbose logging messages
>       -trace <LOG=LEVEL,...>      Set the logger LOG to level LEVEL.
>                                     The LEVEL can be [ NONE | FINE | FINEST ].
>                                     Example -trace frysk=FINE
>       -noexe                      Do not attempt to read an executable for a 
>                                     corefile 
>   -s, -sysroot SysRoot-Path       Assume the executable is from a sysroot 
>                                     build 
> 
> Standard options:
>   -help       print this help, then exit
>   -version    print version number, then exit
> 
> Exception in thread "main" java.lang.RuntimeException: command not readable: /home/mark/src/frysk-obj/frysk-core/frysk/pkglibdir/test-sysroot//home/mark/src/frysk-obj/frysk-core/frysk/pkglibdir/funit-addresses
>    at frysk.bindir.fhpd$1.parseCommand(fhpd)
>    at frysk.util.CommandlineParser.doParse(fhpd)
>    at frysk.util.CommandlineParser.parse(fhpd)
>    at frysk.bindir.fhpd.main(fhpd)
> >>
> 
> I assume you have something in your tree that generates
> the /home/mark/src/frysk-obj/frysk-core/frysk/pkglibdir/test-sysroot/
> directory. But I couldn't figure out how to properly do that.
> 
> Could you take a look? And maybe add some documentation on how a sysroot
> dir should look like, how to generate one by hand?
> 
> Thanks,
> 
> Mark
> 

That sysroot directory was supposed to be created but meanwhile can be
created (and tested) via:  frysk/pkglibdir/funit-addresses-stripped;
./TestRunner frysk.hpd.TestSysRoot
That test is a little baroque.  It relies on the build process to build
a frysk-core/frysk/pkglibdir/test-sysroot directory, which simulates
building with mock and installing via a sysroot.  Then TestSysRoot tests
finding the debug and source via testing with fhpd.

What is currently there:
Added -sysroot option to fhpd.  This option sets the SYSROOT debug
variable in DbgVariables.java.  Finding the debuginfo in a sysroot is a
little tricky.   Given: /sys/root/dir/usr/bin/program
and  /sys/root/dir/usr/lib/debug/usr/bin/program.debug
Elfutils can be given an absolute or relative path to look for
program.debug.  It will look in: 
1. /sys/root/dir/usr/bin/program.debug 
2. /sys/root/dir/usr/bin/a/relative/path/program.debug 
3. /an/absolute/path/sys/root/dir/usr/bin/program.debug
It will not look in /an/absolute/path/program.debug, otherwise it could
be given /sys/root/dir/usr/lib/debug/usr/bin.  Therefore DwflCache.java
generates a relative path that has the same effect.  ListCommand.java
considers SYSROOT when looking for program.c.

What is not there yet:
The -sysroot option has not been added to fstack or other fhpd requests
yet and -sysroot needs to be added to the documentation.  The bare
minimum was done to get DbgVariables.java to support accessing variable
values not just by sysroot, but other uses as well.  More extensive
testing of sysroot needs to be done by TestSysRoot.java.


  reply	other threads:[~2008-01-14 13:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080114051518.31275.qmail@sourceware.org>
2008-01-14  9:06 ` Mark Wielaard
2008-01-14 13:17   ` Stan Cox [this message]
2008-01-14 16:50 ` /an/absolute/path/program.debug; Was: " Andrew Cagney
2008-01-14 20:27   ` Stan Cox
2008-01-14 17:09 ` Andrew Cagney
2008-01-14 20:33   ` Stan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1200316510.16575.105.camel@multics.rdu.redhat.com \
    --to=scox@redhat.com \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).