From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17544 invoked by alias); 17 Jan 2008 19:57:21 -0000 Received: (qmail 17519 invoked by uid 9519); 17 Jan 2008 19:57:21 -0000 Date: Thu, 17 Jan 2008 19:57:00 -0000 Message-ID: <20080117195721.17504.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Reurn null when cannot get ISA. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 86fc26f68c285f6f5740351cfffea9cbb96733c4 X-Git-Newrev: 0ca8a85014ea151d6fcb01676cacd86841da3af4 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/msg00082.txt.bz2 The branch, master has been updated via 0ca8a85014ea151d6fcb01676cacd86841da3af4 (commit) from 86fc26f68c285f6f5740351cfffea9cbb96733c4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0ca8a85014ea151d6fcb01676cacd86841da3af4 Author: Rick Moseley Date: Thu Jan 17 13:56:46 2008 -0600 Reurn null when cannot get ISA. * IsaFactory.java: Return null when can't get ISA. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/proc/live/ChangeLog | 1 + frysk-core/frysk/proc/live/IsaFactory.java | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog index 2888dee..98df95a 100644 --- a/frysk-core/frysk/proc/live/ChangeLog +++ b/frysk-core/frysk/proc/live/ChangeLog @@ -2,6 +2,7 @@ * LinuxWaitBuilder.java: Catch error when process is gone. * LinuxPtraceTaskState.java: Handle null ISA return. + * IsaFactory.java: Return null when can't get ISA. 2008-01-17 Andrew Cagney diff --git a/frysk-core/frysk/proc/live/IsaFactory.java b/frysk-core/frysk/proc/live/IsaFactory.java index ae454b3..2c262ab 100644 --- a/frysk-core/frysk/proc/live/IsaFactory.java +++ b/frysk-core/frysk/proc/live/IsaFactory.java @@ -56,6 +56,7 @@ public class IsaFactory private static IsaFactory factory; static final Logger logger = Logger.getLogger("frysk"); private Hashtable isaHash; + private String MESSAGE = "getting task's executable"; IsaFactory() { isaHash = new Hashtable(); @@ -96,16 +97,16 @@ public class IsaFactory try { exe = new File("/proc/" + pid + "/exe").getCanonicalPath(); } catch (java.io.IOException e) { - throw new RuntimeException("getting task's executable", e); + throw new RuntimeException(MESSAGE, e); } Elf elfFile; try { elfFile = new Elf(exe, ElfCommand.ELF_C_READ); } catch (ElfFileException e) { - throw new RuntimeException ("getting task's executable", e); + throw new RuntimeException (MESSAGE, e); } catch (ElfException e) { - throw new RuntimeException ("getting task's executable", e); + throw new RuntimeException (MESSAGE, e); } try { @@ -145,10 +146,13 @@ public class IsaFactory return isa; } - public Isa getIsa(int pid) - { - return getIsa(pid, null); - } + public Isa getIsa(int pid) { + try { + return getIsa(pid, null); + } catch (Exception e) { + return null; + } + } public Isa getIsa(Task task) { hooks/post-receive -- frysk system monitor/debugger