The branch, master has been updated
via 6c524b69dd8d33075e37886dafaf69f492c0a30f (commit)
from db09f6ef565b9afe958f9e248c918f01a02c2144 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 6c524b69dd8d33075e37886dafaf69f492c0a30f
Author: Andrew Cagney <cagney@redhat.com>
Date: Wed Jan 2 23:54:09 2008 -0500
Rename Linux Host/Proc/Task to Linux Core/Ptrace Host/Proc/Task.
frysk-core/frysk/hpd/ChangeLog
2008-01-02 Andrew Cagney <cagney@redhat.com>
* CoreCommand.java: Update; frysk.proc.dead.LinuxHost renamed to
.LinuxCoreHost.
frysk-core/frysk/proc/ChangeLog
2008-01-02 Andrew Cagney <cagney@redhat.com>
frysk.proc.live.LinuxHost renamed to .LinuxPtraceHost and
frysk.proc.dead.LinuxHost renamed to .LinuxCoreHost.
* Manager.java: Update.
* ProcBlockAction.java: Update.
frysk-core/frysk/proc/dead/ChangeLog
2008-01-02 Andrew Cagney <cagney@redhat.com>
* LinuxCoreHost.java: Rename LinuxHost.java.
* LinuxCoreProc.java: Rename LinuxProc.java.
* LinuxCoreTask.java: Rename LinuxTask.java.
* TestLinuxCore.java: Update.
frysk-core/frysk/proc/live/ChangeLog
2008-01-02 Andrew Cagney <cagney@redhat.com>
* LinuxPtraceHost.java: Rename LinuxHost.java.
* LinuxPtraceProc.java: Rename LinuxProc.java.
* LinuxPtraceTask.java: Rename LinuxTask.java.
* LinuxPtraceProcState.java: Rename LinuxProcState.java.
* LinuxPtraceTaskState.java: Rename LinuxTaskState.java.
* LinuxWaitBuilder.java: Update.
frysk-core/frysk/util/ChangeLog
2008-01-02 Andrew Cagney <cagney@redhat.com>
* TestCoredumpAction.java: Update frysk.proc.dead.LinuxHost
renamed to .LinuxCoreHost.
* TestStackTraceAction.java: Ditto.
* Util.java: Ditto.
frysk-gui/frysk/gui/srcwin/ChangeLog
2008-01-02 Andrew Cagney <cagney@redhat.com>
* SourceWindow.java: Update; frysk.proc.dead.LinuxProc renamed to
.LinuxCoreProc.
-----------------------------------------------------------------------
Summary of changes:
frysk-core/frysk/hpd/ChangeLog | 5 +
frysk-core/frysk/hpd/CoreCommand.java | 16 +-
frysk-core/frysk/proc/ChangeLog | 5 +
frysk-core/frysk/proc/Manager.java | 8 +-
frysk-core/frysk/proc/ProcBlockAction.java | 7 +-
frysk-core/frysk/proc/dead/ChangeLog | 5 +
frysk-core/frysk/proc/dead/LinuxCoreHost.java | 232 ++++++
frysk-core/frysk/proc/dead/LinuxCoreProc.java | 771 ++++++++++++++++++
.../dead/{LinuxTask.java => LinuxCoreTask.java} | 136 ++--
frysk-core/frysk/proc/dead/LinuxHost.java | 234 ------
frysk-core/frysk/proc/dead/LinuxProc.java | 856 --------------------
frysk-core/frysk/proc/dead/TestLinuxCore.java | 12 +-
frysk-core/frysk/proc/live/ChangeLog | 7 +
.../live/{LinuxHost.java => LinuxPtraceHost.java} | 29 +-
.../live/{LinuxProc.java => LinuxPtraceProc.java} | 14 +-
...nuxProcState.java => LinuxPtraceProcState.java} | 7 +-
.../live/{LinuxTask.java => LinuxPtraceTask.java} | 14 +-
...nuxTaskState.java => LinuxPtraceTaskState.java} | 9 +-
frysk-core/frysk/proc/live/LinuxWaitBuilder.java | 38 +-
frysk-core/frysk/util/ChangeLog | 7 +
frysk-core/frysk/util/TestCoredumpAction.java | 12 +-
frysk-core/frysk/util/TestStackTraceAction.java | 4 +-
frysk-core/frysk/util/Util.java | 6 +-
frysk-gui/frysk/gui/srcwin/ChangeLog | 5 +
frysk-gui/frysk/gui/srcwin/SourceWindow.java | 5 +-
25 files changed, 1187 insertions(+), 1257 deletions(-)
create mode 100644 frysk-core/frysk/proc/dead/LinuxCoreHost.java
create mode 100644 frysk-core/frysk/proc/dead/LinuxCoreProc.java
rename frysk-core/frysk/proc/dead/{LinuxTask.java => LinuxCoreTask.java} (55%)
delete mode 100644 frysk-core/frysk/proc/dead/LinuxHost.java
delete mode 100644 frysk-core/frysk/proc/dead/LinuxProc.java
rename frysk-core/frysk/proc/live/{LinuxHost.java => LinuxPtraceHost.java} (92%)
rename frysk-core/frysk/proc/live/{LinuxProc.java => LinuxPtraceProc.java} (95%)
rename frysk-core/frysk/proc/live/{LinuxProcState.java => LinuxPtraceProcState.java} (99%)
rename frysk-core/frysk/proc/live/{LinuxTask.java => LinuxPtraceTask.java} (95%)
rename frysk-core/frysk/proc/live/{LinuxTaskState.java => LinuxPtraceTaskState.java} (99%)
First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 8a026a6..75c2749 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-02 Andrew Cagney <cagney@redhat.com>
+
+ * CoreCommand.java: Update; frysk.proc.dead.LinuxHost renamed to
+ .LinuxCoreHost.
+
2008-01-02 Tim Moore <timoore@redhat.com>
* TestBreakpoints.java (testBreakOnStructMemberName): New test.
diff --git a/frysk-core/frysk/hpd/CoreCommand.java b/frysk-core/frysk/hpd/CoreCommand.java
index 000dbe3..ed2f2b7 100644
--- a/frysk-core/frysk/hpd/CoreCommand.java
+++ b/frysk-core/frysk/hpd/CoreCommand.java
@@ -49,7 +49,7 @@ import frysk.debuginfo.DebugInfoStackFactory;
import frysk.proc.Manager;
import frysk.proc.Proc;
import frysk.proc.Task;
-import frysk.proc.dead.LinuxHost;
+import frysk.proc.dead.LinuxCoreHost;
public class CoreCommand extends ParameterizedCommand {
@@ -74,7 +74,7 @@ public class CoreCommand extends ParameterizedCommand {
void interpret(CLI cli, Input cmd, Object options) {
Proc coreProc;
- LinuxHost coreHost = null;
+ LinuxCoreHost coreHost = null;
// If > 2 parameter, then too many parameters.
if (cmd.size() > 2) {
@@ -143,21 +143,21 @@ public class CoreCommand extends ParameterizedCommand {
}
// Build Correct Host on options.
- private LinuxHost getHost(File coreFile, File executable, boolean loadExe) {
- LinuxHost coreHost = null;
+ private LinuxCoreHost getHost(File coreFile, File executable, boolean loadExe) {
+ LinuxCoreHost coreHost = null;
if (executable == null)
if (!loadExe)
- coreHost = new LinuxHost(Manager.eventLoop, coreFile);
+ coreHost = new LinuxCoreHost(Manager.eventLoop, coreFile);
else
- coreHost = new LinuxHost(Manager.eventLoop, coreFile, null);
+ coreHost = new LinuxCoreHost(Manager.eventLoop, coreFile, null);
else
- coreHost = new LinuxHost(Manager.eventLoop, coreFile, executable);
+ coreHost = new LinuxCoreHost(Manager.eventLoop, coreFile, executable);
return coreHost;
}
// From a Host, get a Proc
- private Proc getProc(LinuxHost coreHost) {
+ private Proc getProc(LinuxCoreHost coreHost) {
// Get an iterator to the one process
Iterator i = coreHost.getProcIterator();
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index f5d5c4f..bec7198 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,5 +1,10 @@
2008-01-02 Andrew Cagney <cagney@redhat.com>
+ frysk.proc.live.LinuxHost renamed to .LinuxPtraceHost and
+ frysk.proc.dead.LinuxHost renamed to .LinuxCoreHost.
+ * Manager.java: Update.
+ * ProcBlockAction.java: Update.
+
* Task.java (set(TaskState)): Delete.
(Task(TaskId,Proc,Task)): Replace Task(TaskId,Proc,Task,TaskState).
diff --git a/frysk-core/frysk/proc/Manager.java b/frysk-core/frysk/proc/Manager.java
index 1e5e2e3..b8d8075 100644
--- a/frysk-core/frysk/proc/Manager.java
+++ b/frysk-core/frysk/proc/Manager.java
@@ -40,7 +40,7 @@
package frysk.proc;
import frysk.event.EventLoop;
-import frysk.proc.live.LinuxHost;
+import frysk.proc.live.LinuxPtraceHost;
/**
* Manager of all operations within the proc model.
@@ -53,12 +53,12 @@ public class Manager
{
// The host (for moment only the local native host).
- // XXX: Should have the LinuxHost, along with any other host
+ // XXX: Should have the LinuxPtraceHost, along with any other host
// types, register themselves and then have HOST set itself to the
// most appropriate.
public static EventLoop eventLoop = EventLoop.factory ();
- public static Host host = new LinuxHost (eventLoop);
+ public static Host host = new LinuxPtraceHost (eventLoop);
/**
* XXX: For testing, resets the Manager back to it's default
@@ -67,7 +67,7 @@ public class Manager
public static Host resetXXX ()
{
eventLoop = EventLoop.factory ();
- host = new LinuxHost (eventLoop);
+ host = new LinuxPtraceHost(eventLoop);
return host;
}
}
diff --git a/frysk-core/frysk/proc/ProcBlockAction.java b/frysk-core/frysk/proc/ProcBlockAction.java
index fef1fb3..080b92e 100644
--- a/frysk-core/frysk/proc/ProcBlockAction.java
+++ b/frysk-core/frysk/proc/ProcBlockAction.java
@@ -47,7 +47,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import frysk.event.Event;
-import frysk.proc.dead.LinuxHost;
+import frysk.proc.dead.LinuxCoreHost;
/**
* This class blocks all of the threads in a process and performs a given action
@@ -173,9 +173,8 @@ public class ProcBlockAction
}
- public ProcBlockAction (File coreFile)
- {
- LinuxHost core = new LinuxHost(Manager.eventLoop, coreFile);
+ public ProcBlockAction (File coreFile) {
+ LinuxCoreHost core = new LinuxCoreHost(Manager.eventLoop, coreFile);
core.requestRefreshXXX();
Manager.eventLoop.runPending();
diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog
index 61dfe43..9488b1f 100644
--- a/frysk-core/frysk/proc/dead/ChangeLog
+++ b/frysk-core/frysk/proc/dead/ChangeLog
@@ -1,5 +1,10 @@
2008-01-02 Andrew Cagney <cagney@redhat.com>
+ * LinuxCoreHost.java: Rename LinuxHost.java.
+ * LinuxCoreProc.java: Rename LinuxProc.java.
+ * LinuxCoreTask.java: Rename LinuxTask.java.
+ * TestLinuxCore.java: Update.
+
* DeadTask.java (set(TaskState)): Delete.
* LinuxTaskState.java: Delete.
diff --git a/frysk-core/frysk/proc/dead/LinuxCoreHost.java b/frysk-core/frysk/proc/dead/LinuxCoreHost.java
new file mode 100644
index 0000000..c9b1e43
--- /dev/null
+++ b/frysk-core/frysk/proc/dead/LinuxCoreHost.java
@@ -0,0 +1,232 @@
+// This file is part of the program FRYSK.
+//
+// Copyright 2007 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
+// the Free Software Foundation; version 2 of the License.
+//
+// FRYSK is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with FRYSK; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// In addition, as a special exception, Red Hat, Inc. gives You the
+// additional right to link the code of FRYSK with code not covered
+// under the GNU General Public License ("Non-GPL Code") and to
+// distribute linked combinations including the two, subject to the
+// limitations in this paragraph. Non-GPL Code permitted under this
+// exception must only link to the code of FRYSK through those well
+// defined interfaces identified in the file named EXCEPTION found in
+// the source code files (the "Approved Interfaces"). The files of
+// Non-GPL Code may instantiate templates or use macros or inline
+// functions from the Approved Interfaces without causing the
+// resulting work to be covered by the GNU General Public
+// License. Only Red Hat, Inc. may make changes or additions to the
+// list of Approved Interfaces. You must obey the GNU General Public
+// License in all respects for all of the FRYSK code and other code
+// used in conjunction with FRYSK except the Non-GPL Code covered by
+// this exception. If you modify this file, you may extend this
+// exception to your version of the file, but you are not obligated to
+// do so. If you do not wish to provide this exception without
+// modification, you must delete this exception statement from your
+// version and license this file solely under the GPL without
+// exception.
+
+package frysk.proc.dead;
+
+import frysk.event.Event;
+import frysk.event.EventLoop;
+import java.util.LinkedList;
+import java.util.List;
+import java.io.File;
+import java.util.Iterator;
+
+import lib.dwfl.Elf;
+import lib.dwfl.ElfCommand;
+import lib.dwfl.ElfData;
+import lib.dwfl.ElfEHeader;
+import lib.dwfl.ElfPHeader;
+import lib.dwfl.ElfPrpsinfo;
+import frysk.proc.Proc;
+import frysk.proc.ProcId;
+import frysk.proc.TaskObserver;
+import frysk.proc.FindProc;
+
+public class LinuxCoreHost extends DeadHost {
+
+ CorefileStatus status = new CorefileStatus();
+
+ boolean hasRefreshed = false;
+
+ boolean exeSetToNull = false;
+
+ protected File coreFile = null;
+
+ protected File exeFile = null;
+
+ Elf corefileElf;
+
+ EventLoop eventLoop;
+
+ private LinuxCoreHost(EventLoop eventLoop, File coreFile, boolean doRefresh) {
+ this.coreFile = coreFile;
+ this.eventLoop = eventLoop;
+ try {
+ this.corefileElf = new Elf(coreFile.getPath(),
+ ElfCommand.ELF_C_READ);
+ } catch (Exception e) {
+ throw new RuntimeException("Corefile " + this.coreFile + " is "
+ + "not a valid ELF core file.");
+ }
+
+ if ((corefileElf.getEHeader() == null) ||
+ (corefileElf.getEHeader().type != ElfEHeader.PHEADER_ET_CORE)) {
+ this.corefileElf.close();
+ throw new RuntimeException("'" + this.coreFile.getAbsolutePath()
+ + "' is not a corefile.");
+ }
+
+ if (doRefresh)
+ this.sendRefresh(true);
+ }
+
+ public LinuxCoreHost(EventLoop eventLoop, File coreFile) {
+ this(eventLoop, coreFile, true);
+ }
+
+ public LinuxCoreHost(EventLoop eventLoop, File coreFile, File exeFile) {
+ this(eventLoop, coreFile, false);
+ if (exeFile == null)
+ exeSetToNull = true;
+
+ if (exeSetToNull == false)
+ if (exeFile.canRead() && exeFile.exists()) {
+ this.exeFile = exeFile;
+ 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";
+ }
+ this.sendRefresh(true);
+ }
+
+ public CorefileStatus getStatus() {
+ return status;
+ }
+
+ protected void sendRefresh(boolean refreshAll) {
+
+ if (this.hasRefreshed)
+ return;
+ // Iterate (build) the /proc tree, passing each found PID to
+ // procChanges where it can update the /proc tree.
+ new DeconstructCoreFile(this.corefileElf);
+ // Changes individual process.
+ for (Iterator i = procPool.values().iterator(); i.hasNext();) {
+ LinuxCoreProc proc = (LinuxCoreProc) i.next();
+ proc.sendRefresh();
+ }
+ this.hasRefreshed = true;
+ }
+
+ protected void sendRefresh(final ProcId procId, final FindProc finder) {
+
+ // Core files nevers never change
+ if (!(procPool.containsKey(procId))) {
+ eventLoop.add(new Event() {
+ public void execute() {
+ finder.procNotFound(procId, new RuntimeException(
+ "Couldn't find the proc" + procId));
+ }
+ });
+ return;
+ }
+
+ LinuxCoreProc proc = (LinuxCoreProc) getProc(procId);
+ proc.sendRefresh();
+
+ eventLoop.add(new Event() {
+ public void execute() {
+ finder.procFound(procId);
+ }
+ });
+
+ }
+
+ protected void sendCreateAttachedProc(String stdin, String stdout,
+ String stderr, String[] args, TaskObserver.Attached attached) {
+ }
+
+ protected Proc sendrecSelf() {
+ return null;
+ }
+
+ private class DeconstructCoreFile {
+ List addedProcs = new LinkedList();
+
+ //HashMap removedProcs = (HashMap) ((HashMap) procPool).clone();
+ Elf coreFileElf;
+
+ ElfData noteData = null;
+
+ DeconstructCoreFile(Elf coreFileElf) {
+ this.coreFileElf = coreFileElf;
+ status.coreName = coreFile.getAbsolutePath();
+ ElfEHeader eHeader = this.coreFileElf.getEHeader();
+
+ // Get number of program header entries.
+ long phSize = eHeader.phnum;
+ for (int i = 0; i < phSize; i++) {
+ // Test if pheader is of types notes..
+ ElfPHeader pHeader = coreFileElf.getPHeader(i);
+ if (pHeader.type == ElfPHeader.PTYPE_NOTE) {
+ // if so, copy, break an leave.
+ noteData = coreFileElf.getRawData(pHeader.offset,
+ pHeader.filesz);
+ break;
+ }
+ }
+
+ if (noteData != null)
+ update(noteData);
+ }
+
+ Proc update(ElfData proc_pid) {
+ final ElfPrpsinfo coreProc = ElfPrpsinfo.decode(proc_pid);
+ final ProcId procId = new ProcId(coreProc.getPrPid());
+ // Currently there can only be one process per core file.
+ // What happens when we have two core files denoting the same
+ // process/pid? Leave the test here for now.
+
+ Proc proc = (Proc) procPool.get(procId);
+ if (proc == null) {
+ // core file processes have no parents as thy are captured
+ // in isolation, and reconstructed.
+ proc = new LinuxCoreProc(proc_pid, LinuxCoreHost.this, procId);
+ }
+
+ addedProcs.add(proc);
+
+ if (exeFile == null)
+ status.hasExe = false;
+ else {
+ status.hasExe = true;
+ status.exeName = exeFile.getAbsolutePath();
+ }
+ return proc;
+ }
+
+ }
+
+ protected void finalize() throws Throwable {
+ corefileElf = null;
+ }
+}
diff --git a/frysk-core/frysk/proc/dead/LinuxCoreProc.java b/frysk-core/frysk/proc/dead/LinuxCoreProc.java
new file mode 100644
index 0000000..ed8a492
--- /dev/null
+++ b/frysk-core/frysk/proc/dead/LinuxCoreProc.java
@@ -0,0 +1,771 @@
+// This file is part of the program FRYSK.
+//
+// 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
+// the Free Software Foundation; version 2 of the License.
+//
+// FRYSK is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with FRYSK; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// In addition, as a special exception, Red Hat, Inc. gives You the
+// additional right to link the code of FRYSK with code not covered
+// under the GNU General Public License ("Non-GPL Code") and to
+// distribute linked combinations including the two, subject to the
+// limitations in this paragraph. Non-GPL Code permitted under this
+// exception must only link to the code of FRYSK through those well
+// defined interfaces identified in the file named EXCEPTION found in
+// the source code files (the "Approved Interfaces"). The files of
+// Non-GPL Code may instantiate templates or use macros or inline
+// functions from the Approved Interfaces without causing the
+// resulting work to be covered by the GNU General Public
+// License. Only Red Hat, Inc. may make changes or additions to the
+// list of Approved Interfaces. You must obey the GNU General Public
+// License in all respects for all of the FRYSK code and other code
+// used in conjunction with FRYSK except the Non-GPL Code covered by
+// this exception. If you modify this file, you may extend this
+// exception to your version of the file, but you are not obligated to
+// do so. If you do not wish to provide this exception without
+// modification, you must delete this exception statement from your
+// version and license this file solely under the GPL without
+// exception.
+
+package frysk.proc.dead;
+
+import lib.dwfl.Elf;
+import lib.dwfl.ElfData;
+import lib.dwfl.ElfException;
+import lib.dwfl.ElfPrpsinfo;
+import lib.dwfl.ElfPrAuxv;
+import lib.dwfl.ElfEHeader;
+import lib.dwfl.ElfPrstatus;
+import lib.dwfl.ElfPHeader;
+import lib.dwfl.ElfCommand;
+import lib.dwfl.ElfSection;
+import lib.dwfl.ElfPrFPRegSet;
+import lib.dwfl.ElfPrXFPRegSet;
+import frysk.sys.proc.AuxvBuilder;
+import java.util.logging.Level;
+import java.util.Iterator;
+import java.io.File;
+import java.util.ArrayList;
+import frysk.proc.ProcId;
+import frysk.proc.Task;
+import frysk.proc.Auxv;
+import frysk.proc.Isa;
+import frysk.proc.IsaFactory;
+import frysk.proc.MemoryMap;
+import frysk.isa.ISA;
+import frysk.isa.ElfMap;
+
+public class LinuxCoreProc extends DeadProc {
+
+ private ElfData elfData = null;
+ private ElfPrpsinfo elfProc = null;
+ private CorefileByteBuffer memory = null;
+ private File corefileBackEnd = null;
+ private File exefileBackEnd = null;
+
+ // Segment and solib metadata
+ private MapAddressHeader metaData[];
+ private boolean metaDataBuilt = false;
+
+
+ public LinuxCoreProc(ElfData data, LinuxCoreHost host, ProcId procId ) {
+ super(host, null, procId);
+ this.elfData = data;
+ this.elfProc = ElfPrpsinfo.decode(elfData);
+ this.corefileBackEnd = host.coreFile;
+
+ // Executable is null (non-specified), find the executable
+ // as it is written in the corefile.
+ if ((host.exeFile == null) && (host.exeSetToNull == false)) {
+ File exeFileName = new File(sendrecExe());
+ if ((exeFileName.exists()) && (exeFileName.canRead()))
+ host.exeFile = exeFileName;
+
+ }
+ this.exefileBackEnd = host.exeFile;
+ }
+
+ protected String sendrecCommand() {
+ return elfProc.getPrFname();
+ }
+
hooks/post-receive
--
frysk system monitor/debugger