From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6645 invoked by alias); 6 Feb 2008 03:06:19 -0000 Received: (qmail 6616 invoked by uid 440); 6 Feb 2008 03:06:19 -0000 Date: Wed, 06 Feb 2008 03:06:00 -0000 Message-ID: <20080206030619.6601.qmail@sourceware.org> From: scox@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Check debuginfo CRC. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d878fff3cc262429de21d0883ce3398016ed509d X-Git-Newrev: 3a82019364ca09b1f91b968064aaff746654ff33 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00158.txt.bz2 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 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 + + * DwflCache.java (getRelativeSysRoot): Use getCanonicalPath. + 2008-01-24 Stan Cox * 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 + + * cni/Dwfl.cxx (Dwfl::dwflBegin): Check debuginfo CRC. + 2008-01-14 Andrew Cagney * 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