From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20653 invoked by alias); 8 Feb 2008 11:54:39 -0000 Received: (qmail 20628 invoked by uid 9514); 8 Feb 2008 11:54:39 -0000 Date: Fri, 08 Feb 2008 11:54:00 -0000 Message-ID: <20080208115439.20613.qmail@sourceware.org> From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Use CanonicalFile X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 5db106debc079cc8005316d5b2b6ce5806921994 X-Git-Newrev: 12ad3f3bda382725291d9d8d5bed2f26ae2f4282 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/msg00175.txt.bz2 The branch, master has been updated via 12ad3f3bda382725291d9d8d5bed2f26ae2f4282 (commit) from 5db106debc079cc8005316d5b2b6ce5806921994 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 12ad3f3bda382725291d9d8d5bed2f26ae2f4282 Author: Phil Muldoon Date: Fri Feb 8 11:54:33 2008 +0000 Use CanonicalFile 2008-02-08 Phil Muldoon * LinuxCoreHost.java: Use CanonicalFile() througout. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/proc/dead/ChangeLog | 4 +++ frysk-core/frysk/proc/dead/LinuxCoreHost.java | 26 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog index cbb951b..35fb5b6 100644 --- a/frysk-core/frysk/proc/dead/ChangeLog +++ b/frysk-core/frysk/proc/dead/ChangeLog @@ -1,3 +1,7 @@ +2008-02-08 Phil Muldoon + + * LinuxCoreHost.java: Use CanonicalFile() througout. + 2008-02-07 Andrew Cagney * DeadHost.java (requestRefreshXXX()): Delete. diff --git a/frysk-core/frysk/proc/dead/LinuxCoreHost.java b/frysk-core/frysk/proc/dead/LinuxCoreHost.java index b0c2870..10078d3 100644 --- a/frysk-core/frysk/proc/dead/LinuxCoreHost.java +++ b/frysk-core/frysk/proc/dead/LinuxCoreHost.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2007 Red Hat Inc. +// Copyright 2007, 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 @@ -43,6 +43,7 @@ import frysk.event.EventLoop; import java.util.LinkedList; import java.util.List; import java.io.File; +import java.io.IOException; import java.util.Iterator; import lib.dwfl.Elf; @@ -71,7 +72,12 @@ public class LinuxCoreHost extends DeadHost { EventLoop eventLoop; private LinuxCoreHost(EventLoop eventLoop, File coreFile, boolean doRefresh) { - this.coreFile = coreFile; + + try { + this.coreFile = coreFile.getCanonicalFile(); + } catch (IOException e) { + throw new RuntimeException(e); + } this.eventLoop = eventLoop; try { this.corefileElf = new Elf(coreFile.getPath(), @@ -84,7 +90,7 @@ public class LinuxCoreHost extends DeadHost { if ((corefileElf.getEHeader() == null) || (corefileElf.getEHeader().type != ElfEHeader.PHEADER_ET_CORE)) { this.corefileElf.close(); - throw new RuntimeException("'" + this.coreFile.getAbsolutePath() + throw new RuntimeException("'" + this.getName() + "' is not a corefile."); } @@ -103,15 +109,21 @@ public class LinuxCoreHost extends DeadHost { if (exeSetToNull == false) if (exeFile.canRead() && exeFile.exists()) { - this.exeFile = exeFile; + try { + this.exeFile = exeFile.getCanonicalFile(); + } catch (IOException e) { + status.hasExe = false; + status.hasExeProblem = true; + } status.hasExe = true; status.hasExeProblem = false; } else { status.hasExe = false; status.hasExeProblem = true; status.message = "The user provided executable: " - + exeFile.getAbsolutePath() + " could not be accessed"; + + exeFile.getName() + " could not be accessed"; } + this.sendRefresh(); } @@ -143,7 +155,7 @@ public class LinuxCoreHost extends DeadHost { DeconstructCoreFile(Elf coreFileElf) { this.coreFileElf = coreFileElf; - status.coreName = coreFile.getAbsolutePath(); + status.coreName = coreFile.getName(); ElfEHeader eHeader = this.coreFileElf.getEHeader(); // Get number of program header entries. @@ -183,7 +195,7 @@ public class LinuxCoreHost extends DeadHost { status.hasExe = false; else { status.hasExe = true; - status.exeName = exeFile.getAbsolutePath(); + status.exeName = exeFile.getName(); } return proc; } hooks/post-receive -- frysk system monitor/debugger