public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: scox@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Check debuginfo CRC.
Date: Wed, 06 Feb 2008 03:06:00 -0000	[thread overview]
Message-ID: <20080206030619.6601.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  3a82019364ca09b1f91b968064aaff746654ff33 (commit)
      from  d878fff3cc262429de21d0883ce3398016ed509d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 3a82019364ca09b1f91b968064aaff746654ff33
Author: Stan Cox <scox@redhat.com>
Date:   Tue Feb 5 22:03:02 2008 -0500

    Check debuginfo CRC.
    
    	* cni/Dwfl.cxx (Dwfl::dwflBegin): Check debuginfo CRC.
    	* DwflCache.java (getRelativeSysRoot): Use getCanonicalPath.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/dwfl/ChangeLog      |    4 ++++
 frysk-core/frysk/dwfl/DwflCache.java |   17 +++++++++++++----
 frysk-sys/lib/dwfl/ChangeLog         |    4 ++++
 frysk-sys/lib/dwfl/cni/Dwfl.cxx      |    8 +++-----
 4 files changed, 24 insertions(+), 9 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/dwfl/ChangeLog b/frysk-core/frysk/dwfl/ChangeLog
index c3c1e1f..00725db 100644
--- a/frysk-core/frysk/dwfl/ChangeLog
+++ b/frysk-core/frysk/dwfl/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-05  Stan Cox  <scox@redhat.com>
+
+	* DwflCache.java (getRelativeSysRoot): Use getCanonicalPath.
+
 2008-01-24  Stan Cox  <scox@redhat.com>
 
 	* DwflCache.java (Mod.sysroot): New.
diff --git a/frysk-core/frysk/dwfl/DwflCache.java b/frysk-core/frysk/dwfl/DwflCache.java
index 433e366..8a28320 100644
--- a/frysk-core/frysk/dwfl/DwflCache.java
+++ b/frysk-core/frysk/dwfl/DwflCache.java
@@ -42,6 +42,7 @@ package frysk.dwfl;
 import frysk.proc.Task;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Iterator;
 import java.util.WeakHashMap;
 import java.util.logging.Level;
@@ -108,10 +109,18 @@ public class DwflCache
 	File parent = new File(execFile.getParent());
 	StringBuffer relativePath = new StringBuffer("");
 	StringBuffer exePath = new StringBuffer("");
-	while (! parent.getPath().equals(sysroot.getPath())) { 
-	    exePath.insert(0, "/" + parent.getName());
-	    relativePath.append("../");
-	    parent = new File(parent.getParent());
+	String sysrootPath;
+	try {
+	    sysrootPath = sysroot.getCanonicalPath();
+	    while (! parent.getCanonicalPath().equals(sysrootPath)) { 
+		exePath.insert(0, "/" + parent.getName());
+		relativePath.append("../");
+		parent = new File(parent.getParent());
+		if (parent.getPath().equals("/"))
+		    break;
+	    }
+	} catch (IOException e) {
+	    return new File("/usr/lib/debug");
 	}
 	File debugFile = new File(relativePath + "/usr/lib/debug/" + exePath);
 	return debugFile;
diff --git a/frysk-sys/lib/dwfl/ChangeLog b/frysk-sys/lib/dwfl/ChangeLog
index 4da907a..deae9e8 100644
--- a/frysk-sys/lib/dwfl/ChangeLog
+++ b/frysk-sys/lib/dwfl/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-05  Stan Cox  <scox@redhat.com>
+
+	* cni/Dwfl.cxx (Dwfl::dwflBegin): Check debuginfo CRC.
+
 2008-01-14  Andrew Cagney  <cagney@redhat.com>
 
 	* cni/DwAttributeNotFoundException.cxx: Delete.
diff --git a/frysk-sys/lib/dwfl/cni/Dwfl.cxx b/frysk-sys/lib/dwfl/cni/Dwfl.cxx
index 8e46a3a..2126e35 100644
--- a/frysk-sys/lib/dwfl/cni/Dwfl.cxx
+++ b/frysk-sys/lib/dwfl/cni/Dwfl.cxx
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2005, Red Hat Inc.
+// Copyright 2005, 2008, Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -114,9 +114,8 @@ lib::dwfl::Dwfl::dwflBegin (jstring jsysroot, jint pid)
   char sysroot[len + 1]; 
   JvGetStringUTFRegion(jsysroot, 0, len, sysroot);
   sysroot[len] = '\0';
-  /* Default `DEFAULT_DEBUGINFO_PATH' is similar but checks its CRCs.  */
   static char* flags;
-  if (asprintf (&flags, "-:.debug:%s", sysroot) < 0)
+  if (asprintf (&flags, ".debug:%s", sysroot) < 0)
     return NULL;
 
   static Dwfl_Callbacks callbacks = {
@@ -140,9 +139,8 @@ lib::dwfl::Dwfl::dwflBegin(jstring jsysroot)
   char sysroot[len+1]; 
   JvGetStringUTFRegion(jsysroot, 0, len, sysroot);
   sysroot[len] = '\0';
-  /* Default `DEFAULT_DEBUGINFO_PATH' is similar but checks its CRCs.  */
   static char* flags;
-  if (asprintf (&flags, "-:.debug:%s", sysroot) < 0)
+  if (asprintf (&flags, ".debug:%s", sysroot) < 0)
     return NULL;
 
   static Dwfl_Callbacks callbacks = {


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2008-02-06  3:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080206030619.6601.qmail@sourceware.org \
    --to=scox@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --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).