public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: scox@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Replace uses of getExe with getExeFile.
Date: Mon, 31 Mar 2008 18:38:00 -0000	[thread overview]
Message-ID: <20080331183855.20805.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  8983411653f8a41593abda4232dab5525c617e47 (commit)
      from  7cce31266c351358182feda857399c9b3142522a (commit)

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

- Log -----------------------------------------------------------------
commit 8983411653f8a41593abda4232dab5525c617e47
Author: Stan Cox <scox@redhat.com>
Date:   Mon Mar 31 14:24:13 2008 -0400

    Replace uses of getExe with getExeFile.
    
    * Proc.java (getExe): Remove in favor of getExeFile.  Replace all callers.
    * LinuxPtraceProc.java (getExe): Replace with getExeFile.
    * LinuxCoreProc.java (getExe): Remove in favor of getExeFile.  Replace all callers.
    * LinuxExeProc.java (getExe): Likewise.
    * SysRootFile.java (getSysRootedPath): New.
    * SysRoot.java (SysRoot(String)): New.
    * LoadCommand.java (interpret): Pass sysroot to createProc.
    * LinuxExeFactory.java (createProc(String[],String): New.

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

Summary of changes:
 frysk-core/frysk/bindir/TestFdebuginfo.java        |    2 +-
 frysk-core/frysk/bindir/fexe.java                  |    9 +++---
 frysk-core/frysk/debuginfo/DebugInfo.java          |    2 +-
 frysk-core/frysk/dom/DOMImage.java                 |    2 +-
 frysk-core/frysk/dwfl/DwflCache.java               |    2 +-
 frysk-core/frysk/ftrace/Ftrace.java                |    2 +-
 frysk-core/frysk/ftrace/FtraceController.java      |    4 +-
 frysk-core/frysk/ftrace/MappingGuard.java          |    2 +-
 frysk-core/frysk/ftrace/TestLtrace.java            |    2 +-
 frysk-core/frysk/hpd/ChangeLog                     |    4 +++
 frysk-core/frysk/hpd/InfoExeCommand.java           |    2 +-
 frysk-core/frysk/hpd/KillCommand.java              |    4 +-
 frysk-core/frysk/hpd/LoadCommand.java              |    6 ++--
 frysk-core/frysk/hpd/UnloadCommand.java            |    2 +-
 frysk-core/frysk/hpd/ViewsetCommand.java           |    2 +-
 .../frysk/isa/corefiles/TestLinuxElfCorefile.java  |    4 +-
 frysk-core/frysk/proc/ChangeLog                    |    4 +++
 frysk-core/frysk/proc/Host.java                    |    2 +-
 frysk-core/frysk/proc/Proc.java                    |    6 ----
 frysk-core/frysk/proc/TestProcGet.java             |    2 +-
 frysk-core/frysk/proc/dead/ChangeLog               |    7 +++++
 frysk-core/frysk/proc/dead/LinuxCoreProc.java      |    9 +-----
 frysk-core/frysk/proc/dead/LinuxExeFactory.java    |    9 ++++++-
 frysk-core/frysk/proc/dead/LinuxExeProc.java       |    4 ---
 frysk-core/frysk/proc/dead/TestCoreRegs.java       |    2 +-
 frysk-core/frysk/proc/dead/TestLinuxCore.java      |    6 ++--
 frysk-core/frysk/proc/dead/TestLinuxExe.java       |    4 +-
 frysk-core/frysk/proc/dummy/DummyProc.java         |    3 --
 frysk-core/frysk/proc/live/ChangeLog               |    4 +++
 frysk-core/frysk/proc/live/IsaFactory.java         |    2 +-
 frysk-core/frysk/proc/live/LinuxPtraceProc.java    |    2 +-
 frysk-core/frysk/proc/live/LinuxPtraceTask.java    |    2 +-
 .../frysk/proc/live/TestTaskObserverCode.java      |    2 +-
 frysk-core/frysk/solib/LinkMapFactory.java         |    2 +-
 frysk-core/frysk/sysroot/ChangeLog                 |    5 +++
 frysk-core/frysk/sysroot/SysRoot.java              |    4 +++
 frysk-core/frysk/sysroot/SysRootFile.java          |   27 ++++++++++++++++++++
 frysk-core/frysk/util/TestCommandlineParser.java   |    4 +-
 frysk-gui/frysk/gui/monitor/GuiProc.java           |    4 +-
 .../frysk/gui/monitor/filters/ProcPathFilter.java  |    2 +-
 frysk-gui/frysk/gui/sessions/WatchList.java        |    2 +-
 frysk-gui/frysk/gui/srcwin/SourceWindow.java       |    6 ++--
 42 files changed, 111 insertions(+), 66 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/TestFdebuginfo.java b/frysk-core/frysk/bindir/TestFdebuginfo.java
index 8f0406e..632f7e0 100644
--- a/frysk-core/frysk/bindir/TestFdebuginfo.java
+++ b/frysk-core/frysk/bindir/TestFdebuginfo.java
@@ -60,7 +60,7 @@ public class TestFdebuginfo extends TestLib {
 		""+task.getProc().getPid() 
 	});
 	// Look for the path of executable
-	e.expect(task.getProc().getExe());	
+	e.expect(task.getProc().getExeFile().getSysRootedPath());	
     }
 
     public void testNoArguments() {
diff --git a/frysk-core/frysk/bindir/fexe.java b/frysk-core/frysk/bindir/fexe.java
index 08c3e73..2bcb374 100644
--- a/frysk-core/frysk/bindir/fexe.java
+++ b/frysk-core/frysk/bindir/fexe.java
@@ -79,7 +79,8 @@ public class fexe
 	    if (sysRoot.compareTo("/") == 0)
 		sysRootedPath= "";
 	    else 
-		sysRootedPath = "\n(" + proc.getExe() + ")";
+		sysRootedPath = "\n(" + proc.getExeFile().getSysRootedPath() + ")";
+	    proc.getExeFile().getSysRootedPath();
 	    if (verbose) {
 		ProcessIdentifier pid
 		= ProcessIdentifierFactory.create(proc.getPid());
@@ -91,7 +92,7 @@ public class fexe
 			           + " "
 			           + sysRootedPath);
 	    } else 
-		System.out.println(proc.getExe());
+		System.out.println(proc.getExeFile().getSysRootedPath());
 	}
 	
 	public void executeDead(Proc proc) {
@@ -100,7 +101,7 @@ public class fexe
 	    if (sysRoot.compareTo("/") == 0)
 		sysRootedPath= "";
 	    else 
-		sysRootedPath = "\n(" + proc.getExe() + ")";
+		sysRootedPath = "\n(" + proc.getExeFile().getSysRootedFile() + ")";
 	    if (verbose) {
 		System.out.println(proc.getHost().getName()
 			           + " "
@@ -108,7 +109,7 @@ public class fexe
 			           + " "
 			           + sysRootedPath);
 	    } else {
-		System.out.println(proc.getExe());
+		System.out.println(proc.getExeFile().getSysRootedPath());
 	    }
 	}
     }
diff --git a/frysk-core/frysk/debuginfo/DebugInfo.java b/frysk-core/frysk/debuginfo/DebugInfo.java
index 314fda8..cf9a713 100644
--- a/frysk-core/frysk/debuginfo/DebugInfo.java
+++ b/frysk-core/frysk/debuginfo/DebugInfo.java
@@ -67,7 +67,7 @@ public class DebugInfo {
     public DebugInfo (DebugInfoFrame frame) {
 	Proc proc = frame.getTask().getProc();
 	try {
-	    elf = new Elf(new File(proc.getExe()), ElfCommand.ELF_C_READ);
+	    elf = new Elf(new File(proc.getExeFile().getSysRootedPath()), ElfCommand.ELF_C_READ);
 	    dwarf = new Dwarf(elf, DwarfCommand.READ, null);
 	}
 	catch (lib.dwfl.ElfException ignore) {
diff --git a/frysk-core/frysk/dom/DOMImage.java b/frysk-core/frysk/dom/DOMImage.java
index 41e2837..a23bedf 100644
--- a/frysk-core/frysk/dom/DOMImage.java
+++ b/frysk-core/frysk/dom/DOMImage.java
@@ -124,7 +124,7 @@ public class DOMImage
     public DOMSource addSource (Proc proc, SourceLocation line, DOMFrysk dom) throws IOException
     {
 //    Get the list of include file paths associated with this image
-      ArrayList arrayincpaths = DOMCommon.getIncludePaths(proc.getExe());
+      ArrayList arrayincpaths = DOMCommon.getIncludePaths(proc.getExeFile().getSysRootedPath());
       String includepaths[] = (String[]) arrayincpaths.toArray(new String[0]);
       File file = line.getFile();
       String sourcefile = file.getPath();
diff --git a/frysk-core/frysk/dwfl/DwflCache.java b/frysk-core/frysk/dwfl/DwflCache.java
index b9366e4..6f70aa0 100644
--- a/frysk-core/frysk/dwfl/DwflCache.java
+++ b/frysk-core/frysk/dwfl/DwflCache.java
@@ -131,7 +131,7 @@ public class DwflCache {
 	if (!modMap.containsKey(task)) {
 	    fine.log("creating new dwfl for task", task);
 	    File sysrootFile = (File)SysRootCache.getSysRoot(task);
-	    File relativeSysroot = getRelativeSysRoot(task.getProc().getExe(), sysrootFile);
+	    File relativeSysroot = getRelativeSysRoot(task.getProc().getExeFile().getSysRootedPath(), sysrootFile);
 	    Dwfl dwfl = new Dwfl(relativeSysroot.getPath());
 	    DwflFactory.updateDwfl(dwfl, task);
 	    Mod mod = new Mod(dwfl, task.getMod());
diff --git a/frysk-core/frysk/ftrace/Ftrace.java b/frysk-core/frysk/ftrace/Ftrace.java
index dd5defa..d66e470 100644
--- a/frysk-core/frysk/ftrace/Ftrace.java
+++ b/frysk-core/frysk/ftrace/Ftrace.java
@@ -271,7 +271,7 @@ public class Ftrace {
 
 	new ProcRemovedObserver(proc);
 
-	reporter.eventSingle(task, "attached " + proc.getExe());
+	reporter.eventSingle(task, "attached " + proc.getExeFile().getSysRootedPath());
 	++numProcesses;
     }
 
diff --git a/frysk-core/frysk/ftrace/FtraceController.java b/frysk-core/frysk/ftrace/FtraceController.java
index 8de39fe..dc8048c 100644
--- a/frysk-core/frysk/ftrace/FtraceController.java
+++ b/frysk-core/frysk/ftrace/FtraceController.java
@@ -190,9 +190,9 @@ public class FtraceController
 
 	    // MAIN is meta-soname meaning "main executable".
 	    if ((rule.sonamePattern.pattern().equals("MAIN")
-		 && task.getProc().getExe().equals(objf.getFilename().getPath()))
+		 && task.getProc().getExeFile().getSysRootedPath().equals(objf.getFilename().getPath()))
 		|| (rule.sonamePattern.pattern().equals("INTERP")
-		    && isInterpOf(objf, task.getProc().getExe()))
+		    && isInterpOf(objf, task.getProc().getExeFile().getSysRootedPath()))
 		|| rule.sonamePattern.matcher(objf.getSoname()).matches())
 	    {
 		if (!candidatesInited) {
diff --git a/frysk-core/frysk/ftrace/MappingGuard.java b/frysk-core/frysk/ftrace/MappingGuard.java
index 3cee536..691ba55 100644
--- a/frysk-core/frysk/ftrace/MappingGuard.java
+++ b/frysk-core/frysk/ftrace/MappingGuard.java
@@ -370,7 +370,7 @@ class MappingGuard
     {
 	fine.log("Entering....");
 
-	File f = new File(task.getProc().getExe());
+	File f = new File(task.getProc().getExeFile().getSysRootedPath());
 	ObjectFile objf = ObjectFile.buildFromFile(f);
 	String interp = objf.getInterp();
 	if (interp == null) {
diff --git a/frysk-core/frysk/ftrace/TestLtrace.java b/frysk-core/frysk/ftrace/TestLtrace.java
index 603a374..5759418 100644
--- a/frysk-core/frysk/ftrace/TestLtrace.java
+++ b/frysk-core/frysk/ftrace/TestLtrace.java
@@ -74,7 +74,7 @@ public class TestLtrace
     static abstract class ObserverCreator {
 	abstract FunctionObserver createObserver();
 	public boolean shouldAcceptMapping(Task task, String name) {
-	    return task.getProc().getExe().equals(name);
+	    return task.getProc().getExeFile().getSysRootedPath().equals(name);
 	}
 	public boolean acceptTracepoint(Task task, TracePoint tp) {
 	    return tp.origin == TracePointOrigin.PLT;
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 12e6daa..60da6c0 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-31  Stan Cox  <scox@redhat.com>
+
+	* LoadCommand.java (interpret): Pass sysroot to createProc.
+
 2008-03-31  Rick Moseley  <rmoseley@redhat.com>
 
 	* StartRun.java: Add ability to start/run with hpd notation.
diff --git a/frysk-core/frysk/hpd/InfoExeCommand.java b/frysk-core/frysk/hpd/InfoExeCommand.java
index e774c0c..3500b69 100644
--- a/frysk-core/frysk/hpd/InfoExeCommand.java
+++ b/frysk-core/frysk/hpd/InfoExeCommand.java
@@ -57,7 +57,7 @@ class InfoExeCommand extends ParameterizedCommand {
 	    TaskData td = (TaskData) taskDataIter.next();
 	    Proc proc = td.getTask().getProc();
 	    td.printHeader(cli.outWriter);
-	    cli.outWriter.println(proc.getExe());
+	    cli.outWriter.println(proc.getExeFile().getSysRootedPath());
 	}
     }
 
diff --git a/frysk-core/frysk/hpd/KillCommand.java b/frysk-core/frysk/hpd/KillCommand.java
index 26f11b2..c667bb6 100644
--- a/frysk-core/frysk/hpd/KillCommand.java
+++ b/frysk-core/frysk/hpd/KillCommand.java
@@ -130,12 +130,12 @@ public class KillCommand extends ParameterizedCommand {
 	    if ((proc.getPid() != procPID && pid < 0) ||
 		    proc.getPid() == pid) {
 		cli.addMessage("Killing process " + proc.getPid()
-			+ " that was created from " + proc.getExe(),
+			+ " that was created from " + proc.getExeFile().getSysRootedPath(),
 			Message.TYPE_NORMAL);
 		cli.outWriter.flush();
 		// Save the procs we are killing so we can re-load them later
 		saveProcs.put(new Integer(taskData.getParentID()), proc
-			.getExe());
+			.getExeFile().getSysRootedPath());
 		procPID = proc.getPid();
 		// Now, call the Proc object to kill off the executable(s)
 		proc.requestKill();
diff --git a/frysk-core/frysk/hpd/LoadCommand.java b/frysk-core/frysk/hpd/LoadCommand.java
index 936611f..dd953d5 100644
--- a/frysk-core/frysk/hpd/LoadCommand.java
+++ b/frysk-core/frysk/hpd/LoadCommand.java
@@ -115,7 +115,7 @@ public class LoadCommand extends ParameterizedCommand {
 		(new File(o.executable), cmd.stringArrayValue());
 	} else {
 	    SysRootCache.setSysroot(cmd.stringArrayValue()[0], o.sysroot);
-	    exeProc = LinuxExeFactory.createProc(cmd.stringArrayValue());
+	    exeProc = LinuxExeFactory.createProc(cmd.stringArrayValue(), o.sysroot);
 	}
 
 	load(exeProc, cli, o.sysroot);
@@ -149,7 +149,7 @@ public class LoadCommand extends ParameterizedCommand {
 	}
 
 	cli.addMessage("[" + procID + ".0] Loaded executable file: " + 
-		exeProc.getExe(), Message.TYPE_NORMAL);
+		exeProc.getExeFile().getSysRootedPath(), Message.TYPE_NORMAL);
     }
     
     /**
@@ -171,7 +171,7 @@ public class LoadCommand extends ParameterizedCommand {
 	    Map.Entry me = (Map.Entry) foo.next();
 	    Proc proc = (Proc) me.getKey();
 	    Integer taskid = (Integer) me.getValue();
-	    listing.add("[" + taskid.intValue() + ".0]\t\t" + proc.getExe());
+	    listing.add("[" + taskid.intValue() + ".0]\t\t" + proc.getExeFile().getSysRootedPath());
 	}
 	String alphaListing[] = (String[]) listing.toArray(new String[listing.size()]);
 	java.util.Arrays.sort(alphaListing);
diff --git a/frysk-core/frysk/hpd/UnloadCommand.java b/frysk-core/frysk/hpd/UnloadCommand.java
index efdf38c..fd423f4 100644
--- a/frysk-core/frysk/hpd/UnloadCommand.java
+++ b/frysk-core/frysk/hpd/UnloadCommand.java
@@ -118,7 +118,7 @@ public class UnloadCommand extends ParameterizedCommand {
 	while (foo.hasNext()) {
 	    Map.Entry me = (Map.Entry) foo.next();
 	    Proc newProc = (Proc) me.getKey();
-	    if (proc.getExe().equals(newProc.getExe())) {
+	    if (proc.getExeFile().getSysRootedPath().equals(newProc.getExeFile().getSysRootedPath())) {
 		synchronized (cli) {
 		    foo.remove();
 		}
diff --git a/frysk-core/frysk/hpd/ViewsetCommand.java b/frysk-core/frysk/hpd/ViewsetCommand.java
index 1ab1e41..078ce00 100644
--- a/frysk-core/frysk/hpd/ViewsetCommand.java
+++ b/frysk-core/frysk/hpd/ViewsetCommand.java
@@ -115,7 +115,7 @@ class ViewsetCommand extends ParameterizedCommand {
 		cli.outWriter.print(task.getTid());
 		cli.outWriter.print("\t");
 		if (parent != temptd.getParentID()) {
-		    cli.outWriter.println(temptd.getTask().getProc().getExe());
+		    cli.outWriter.println(temptd.getTask().getProc().getExeFile().getSysRootedPath());
 		    parent = temptd.getParentID();
 		}
 		else {
diff --git a/frysk-core/frysk/isa/corefiles/TestLinuxElfCorefile.java b/frysk-core/frysk/isa/corefiles/TestLinuxElfCorefile.java
index ea6e64c..d4a8de5 100644
--- a/frysk-core/frysk/isa/corefiles/TestLinuxElfCorefile.java
+++ b/frysk-core/frysk/isa/corefiles/TestLinuxElfCorefile.java
@@ -166,7 +166,7 @@ public class TestLinuxElfCorefile
 
     // Model the corefile, and get the Process.
     Proc coreProc = LinuxCoreFactory.createProc(testCore,
-						new File(ackProc.getExe()));
+						new File(ackProc.getExeFile().getSysRootedPath()));
     assertNotNull("Checking core file process", coreProc);    
    
     MemoryMap[] coreMaps = coreProc.getMaps();
@@ -241,7 +241,7 @@ public class TestLinuxElfCorefile
 
     // Model the corefile, and get the Process.
     Proc coreProc = LinuxCoreFactory.createProc(new File(core.getConstructedFileName()),
-						new File(ackProc.getExe()));
+						new File(ackProc.getExeFile().getSysRootedPath()));
     assertNotNull("Checking core file process", coreProc);    
    
     MemoryMap[] coreMaps = coreProc.getMaps();
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index 17134d9..defd251 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-31  Stan Cox  <scox@redhat.com>
+
+	* Proc.java (getExe): Remove in favor of getExeFile.  Replace all callers.
+
 2008-03-27  Stan Cox  <scox@redhat.com>
 
 	* Proc.java (getExeFile): New.
diff --git a/frysk-core/frysk/proc/Host.java b/frysk-core/frysk/proc/Host.java
index 0acd51b..612162a 100644
--- a/frysk-core/frysk/proc/Host.java
+++ b/frysk-core/frysk/proc/Host.java
@@ -121,7 +121,7 @@ public abstract class Host implements Comparable {
 					  TaskAttachedObserverXXX attachedObserver) {
 	fine.log(this, "requestCreateAttachedProc template", template,
 		 "observer", attachedObserver);
-	requestCreateAttachedProc(new File(template.getExe()),
+	requestCreateAttachedProc(new File(template.getExeFile().getSysRootedPath()),
 				  null, null, null,
 				  template.getCmdLine(),
 				  attachedObserver);
diff --git a/frysk-core/frysk/proc/Proc.java b/frysk-core/frysk/proc/Proc.java
index 4266b4d..cbeb823 100644
--- a/frysk-core/frysk/proc/Proc.java
+++ b/frysk-core/frysk/proc/Proc.java
@@ -90,12 +90,6 @@ public abstract class Proc implements Comparable {
     public abstract String getCommand();
 
     /**
-     * Return the full path of the program that this process is
-     * running.
-     */
-    public abstract String getExe();
-    
-    /**
      * Return the SysRoot path of the program that this process is
      * running.
      */
diff --git a/frysk-core/frysk/proc/TestProcGet.java b/frysk-core/frysk/proc/TestProcGet.java
index f70c16d..34b777a 100644
--- a/frysk-core/frysk/proc/TestProcGet.java
+++ b/frysk-core/frysk/proc/TestProcGet.java
@@ -194,6 +194,6 @@ public class TestProcGet
 	ExecOffspring child = new ExecOffspring(cmd);
 	String file = new File(cmd.argv[0]).getCanonicalPath();
 	Proc proc = child.assertRunToFindProc();
-	assertEquals("exe", proc.getExe(), file);
+	assertEquals("exe", proc.getExeFile().getSysRootedPath(), file);
     }
 }
diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog
index dce5aa2..d3a18a7 100644
--- a/frysk-core/frysk/proc/dead/ChangeLog
+++ b/frysk-core/frysk/proc/dead/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-31  Stan Cox  <scox@redhat.com>
+
+	* LinuxExeFactory.java (createProc(String[],String): New.
+	* LinuxCoreProc.java (getExe): Remove in favor of getExeFile.  Replace all callers.
+	* LinuxExeProc.java (getExe): Likewise.
+	
+
 2008-03-27  Stan Cox  <scox@redhat.com>
 
 	* TestLinuxExe.java (testSysRootedProc): New.
diff --git a/frysk-core/frysk/proc/dead/LinuxCoreProc.java b/frysk-core/frysk/proc/dead/LinuxCoreProc.java
index 9d05b3b..7a46b8d 100644
--- a/frysk-core/frysk/proc/dead/LinuxCoreProc.java
+++ b/frysk-core/frysk/proc/dead/LinuxCoreProc.java
@@ -71,14 +71,9 @@ public class LinuxCoreProc extends DeadProc {
         return command;
     }
 
-    public String getExe() {
-	String exe = info.exeFile.getPath();
-	fine.log(this, "getExe()", exe);
-	return exe;
-    }
-
     public SysRootFile getExeFile() {
-	String exe = getExe();
+	String exe = info.exeFile.getPath();
+	fine.log(this, "getExeFile()", exe);
 	File exeFile = new File(exe);
 	return new SysRootFile(SysRootCache.getSysRoot(exeFile.getName()), exeFile); 
     }
diff --git a/frysk-core/frysk/proc/dead/LinuxExeFactory.java b/frysk-core/frysk/proc/dead/LinuxExeFactory.java
index 5c29441..2e2c55b 100644
--- a/frysk-core/frysk/proc/dead/LinuxExeFactory.java
+++ b/frysk-core/frysk/proc/dead/LinuxExeFactory.java
@@ -75,7 +75,7 @@ public class LinuxExeFactory {
 		    metaData.add(new MemoryMap(addrLow, addrHigh, permRead,
 					       permWrite, permExecute, false,
 					       offset, -1, -1, -1,
-					       sysRootFile.getSysRootedFile().getAbsolutePath()));
+					       sysRootFile.getSysRootedPath()));
 		}
 		MemoryMap[] getMemoryMaps() {
 		    MemoryMap[] memoryMaps = new MemoryMap[metaData.size()];
@@ -134,4 +134,11 @@ public class LinuxExeFactory {
 	fine.log("createProc exe", exe);
 	return createProc(exe, args);
     }
+    
+    public static DeadProc createProc(String[] args, String sysroot) {
+	SysRoot sysRoot = new SysRoot(sysroot);
+	File exe = sysRoot.getPathViaSysRoot(args[0]).getFile();
+	fine.log("createProc exe", exe);
+	return createProc(exe, args);
+    }
 }
diff --git a/frysk-core/frysk/proc/dead/LinuxExeProc.java b/frysk-core/frysk/proc/dead/LinuxExeProc.java
index 9e69566..a7342e1 100644
--- a/frysk-core/frysk/proc/dead/LinuxExeProc.java
+++ b/frysk-core/frysk/proc/dead/LinuxExeProc.java
@@ -82,10 +82,6 @@ public class LinuxExeProc extends DeadProc {
 	return exeFile.getFile().getName();
     }
 
-    public String getExe() {
-	return exeFile.getSysRootedFile().getAbsolutePath();
-    }
-
     public SysRootFile getExeFile() {
 	return exeFile;
     }
diff --git a/frysk-core/frysk/proc/dead/TestCoreRegs.java b/frysk-core/frysk/proc/dead/TestCoreRegs.java
index c738c5e..35aefa4 100644
--- a/frysk-core/frysk/proc/dead/TestCoreRegs.java
+++ b/frysk-core/frysk/proc/dead/TestCoreRegs.java
@@ -55,7 +55,7 @@ public class TestCoreRegs extends RegsCase {
 	super.setUp();
 	// Replace the live task with a dead one.
 	Proc proc = task().getProc();
-	File exe = new File(proc.getExe());
+	File exe = new File(proc.getExeFile().getSysRootedPath());
 	File core = CorefileFactory.constructCore(proc);
 	Proc coreProc = LinuxCoreFactory.createProc(core, exe);
 	setTask(coreProc.getMainTask());
diff --git a/frysk-core/frysk/proc/dead/TestLinuxCore.java b/frysk-core/frysk/proc/dead/TestLinuxCore.java
index fa393c9..4e272f4 100644
--- a/frysk-core/frysk/proc/dead/TestLinuxCore.java
+++ b/frysk-core/frysk/proc/dead/TestLinuxCore.java
@@ -100,7 +100,7 @@ public class TestLinuxCore extends TestLib {
 	}
 
 	// Build relative exe path, and model core.
-	countPath = new File(relativeIntro+ackProc.getExe());
+	countPath = new File(relativeIntro+ackProc.getExeFile().getSysRootedPath());
 	Proc coreProc = LinuxCoreFactory.createProc(coreFileName, countPath);
 
 	// Guard: Build a stack trace. If a relative path is not being
@@ -291,7 +291,7 @@ public class TestLinuxCore extends TestLib {
 	assertEquals("PID", 26799, coreProc.getPid());
 	assertEquals("getParent", null, coreProc.getParent());
 	assertEquals("getCommand", "segfault", coreProc.getCommand());
-	assertEquals("getExe", "/home/pmuldoon/segfault", coreProc.getExe());
+	assertEquals("getExe", "/home/pmuldoon/segfault", coreProc.getExeFile().getSysRootedPath());
 	assertEquals("getUID", 500, coreProc.getUID());
 	assertEquals("getGID", 500, coreProc.getGID());
 	assertEquals("getMainTask", 26799, coreProc.getMainTask().getTid());
@@ -436,7 +436,7 @@ public class TestLinuxCore extends TestLib {
     
     // Create a teardown file
     TearDownFile xtestCore = new TearDownFile(coreFileName);
-    Proc coreProc = LinuxCoreFactory.createProc(xtestCore, new File(ackProc.getExe()));
+    Proc coreProc = LinuxCoreFactory.createProc(xtestCore, new File(ackProc.getExeFile().getSysRootedPath()));
     Task coreTask = coreProc.getMainTask();
 
     // Check that the breakpoint isn't visible.
diff --git a/frysk-core/frysk/proc/dead/TestLinuxExe.java b/frysk-core/frysk/proc/dead/TestLinuxExe.java
index 21e1456..c2025d6 100644
--- a/frysk-core/frysk/proc/dead/TestLinuxExe.java
+++ b/frysk-core/frysk/proc/dead/TestLinuxExe.java
@@ -110,13 +110,13 @@ public class TestLinuxExe extends TestLib {
 		Config.getBinFile("fdebugrpm").getPath(),
 		"arg"
 	    });
-	assertEquals("exe", "/bin/bash", proc.getExe());
+	assertEquals("exe", "/bin/bash", proc.getExeFile().getSysRootedPath());
     }
     
     public void testSysRootedProc() {
 	SysRootCache.setSysroot("funit-addresses", Config.getPkgLibFile("test-sysroot").getAbsolutePath());
 	Proc proc = LinuxExeFactory.createProc(new String[] {"funit-addresses", ""});
-	int testValue = proc.getExe().compareTo(Config.getPkgLibFile("test-sysroot").getAbsolutePath()
+	int testValue = proc.getExeFile().getSysRootedPath().compareTo(Config.getPkgLibFile("test-sysroot").getAbsolutePath()
 		+ "/usr/bin/funit-addresses");
 	assertEquals("exe", 0, testValue); 
 	testValue = proc.getExeFile().getFile().getAbsolutePath().compareTo("/usr/bin/funit-addresses");
diff --git a/frysk-core/frysk/proc/dummy/DummyProc.java b/frysk-core/frysk/proc/dummy/DummyProc.java
index 0cf4525..0c6b76c 100644
--- a/frysk-core/frysk/proc/dummy/DummyProc.java
+++ b/frysk-core/frysk/proc/dummy/DummyProc.java
@@ -60,9 +60,6 @@ public class DummyProc extends Proc {
     public String getCommand() {
 	return "Foo";
     }
-    public String getExe() {
-	return null;
-    }
     public SysRootFile getExeFile() {
 	return null;
     }
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index 0820243..1a63ddd 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-31  Stan Cox  <scox@redhat.com>
+
+	* LinuxPtraceProc.java (getExe): Replace with getExeFile.
+
 2008-03-27  Stan Cox  <scox@redhat.com>
 
 	* LinuxPtraceProc.java (getExeFile): New.
diff --git a/frysk-core/frysk/proc/live/IsaFactory.java b/frysk-core/frysk/proc/live/IsaFactory.java
index a6f332b..f929777 100644
--- a/frysk-core/frysk/proc/live/IsaFactory.java
+++ b/frysk-core/frysk/proc/live/IsaFactory.java
@@ -86,7 +86,7 @@ public class IsaFactory {
     Isa getIsa(ProcessIdentifier pid) {
 	fine.log(this, "getIsa", pid);
 	
-	// FIXME: This should use task.proc.getExe().  Only that


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


                 reply	other threads:[~2008-03-31 18:38 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=20080331183855.20805.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).