public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@redhat.com>
To: Stan Cox <scox@redhat.com>
Cc: frysk@sourceware.org
Subject: Re: [SCM]  master: Add -sysroot option to fhpd.
Date: Mon, 14 Jan 2008 17:09:00 -0000	[thread overview]
Message-ID: <478B96A6.3090509@redhat.com> (raw)
In-Reply-To: <20080114051518.31275.qmail@sourceware.org>

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

  parent reply	other threads:[~2008-01-14 17:09 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
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 [this message]
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=478B96A6.3090509@redhat.com \
    --to=cagney@redhat.com \
    --cc=frysk@sourceware.org \
    --cc=scox@redhat.com \
    /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).