public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Check debuginfo CRC.
@ 2008-02-06  3:06 scox
  0 siblings, 0 replies; only message in thread
From: scox @ 2008-02-06  3:06 UTC (permalink / raw)
  To: frysk-cvs

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-06  3:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-06  3:06 [SCM] master: Check debuginfo CRC scox

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).