public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Replace Host.requestProc(ProcId,FindProc) with requestProc(int,FindProc). Date: Thu, 07 Feb 2008 18:04:00 -0000 [thread overview] Message-ID: <20080207180434.29280.qmail@sourceware.org> (raw) The branch, master has been updated via 2209847f5130a5b5d8ca5a4d5978f6d9d5f66ba8 (commit) from 104895f525b12cf31508c4a2ec3f9f24589a25e9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 2209847f5130a5b5d8ca5a4d5978f6d9d5f66ba8 Author: Andrew Cagney <cagney@redhat.com> Date: Thu Feb 7 13:03:41 2008 -0500 Replace Host.requestProc(ProcId,FindProc) with requestProc(int,FindProc). frysk-core/frysk/bindir/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * fstep.java: Update to use Host.requestProc(int,FindProc). frysk-core/frysk/ftrace/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * Ftrace.java: Update to use Host.requestProc(int,FindProc). frysk-core/frysk/hpd/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * AttachCommand.java: Update to use Host.requestProc(int,FindProc). * TestLib.java: Ditto. frysk-core/frysk/proc/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * FindProc.java (procNotFound(int)): Replace procNotFound(ProcId). * Host.java (requestProc(int,FindProc)): Replace requestProc(ProcId,FindProc). * ProcBlockAction.java (ProcBlockAction(int)): Replace ProcBlockAction(ProcId). * TestSyscallRunning.java: Update. * TestBreakpoints.java: Update. * TestFindProc.java: Update. * TestSyscallSignal.java: Update. * TestTaskSyscallObserver.java: Update. frysk-core/frysk/proc/dead/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * DeadHost.java (requestProc(int,FindProc): Update to match Host. frysk-core/frysk/proc/dummy/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * DummyHost.java (requestProc(int,FindProc)): Update to match Host. frysk-core/frysk/proc/live/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * LinuxPtraceHost.java (requestProc(int,FindProc)): Update to match host. frysk-core/frysk/testbed/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * Offspring.java: Update to match Host.requestProc(int,FindProc). frysk-core/frysk/util/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * FCatch.java: Update to match Host.requestProc(int,FindProc). * TestFCatch.java: Ditto. * Util.java: Ditto. frysk-gui/frysk/gui/srcwin/ChangeLog 2008-02-07 Andrew Cagney <cagney@redhat.com> * SourceWindowFactory.java (attachToPID(int)): Delete. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 4 + frysk-core/frysk/bindir/fstep.java | 8 +-- frysk-core/frysk/ftrace/ChangeLog | 4 + frysk-core/frysk/ftrace/Ftrace.java | 7 +- frysk-core/frysk/hpd/AttachCommand.java | 5 +- frysk-core/frysk/hpd/ChangeLog | 6 ++ frysk-core/frysk/hpd/TestLib.java | 7 +- frysk-core/frysk/proc/ChangeLog | 13 ++++ frysk-core/frysk/proc/FindProc.java | 2 +- frysk-core/frysk/proc/Host.java | 2 +- frysk-core/frysk/proc/ProcBlockAction.java | 35 +++++----- frysk-core/frysk/proc/TestBreakpoints.java | 6 +- frysk-core/frysk/proc/TestFindProc.java | 49 +++++++-------- frysk-core/frysk/proc/TestSyscallRunning.java | 65 +++++++++---------- frysk-core/frysk/proc/TestSyscallSignal.java | 66 ++++++++++---------- frysk-core/frysk/proc/TestTaskSyscallObserver.java | 44 ++++++------- frysk-core/frysk/proc/dead/ChangeLog | 4 + frysk-core/frysk/proc/dead/DeadHost.java | 9 ++- frysk-core/frysk/proc/dummy/ChangeLog | 5 ++ frysk-core/frysk/proc/dummy/DummyHost.java | 3 +- frysk-core/frysk/proc/live/ChangeLog | 3 + frysk-core/frysk/proc/live/LinuxPtraceHost.java | 8 +- frysk-core/frysk/testbed/ChangeLog | 4 + frysk-core/frysk/testbed/Offspring.java | 7 +- frysk-core/frysk/util/ChangeLog | 6 ++ frysk-core/frysk/util/FCatch.java | 7 +- frysk-core/frysk/util/TestFCatch.java | 32 ++++----- frysk-core/frysk/util/Util.java | 46 +++++++------- frysk-gui/frysk/gui/srcwin/ChangeLog | 4 + .../frysk/gui/srcwin/SourceWindowFactory.java | 23 +------- 30 files changed, 246 insertions(+), 238 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index 67d09d3..56e7592 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,3 +1,7 @@ +2008-02-07 Andrew Cagney <cagney@redhat.com> + + * fstep.java: Update to use Host.requestProc(int,FindProc). + 2008-02-06 Teresa Thomas <tthomas@redhat.com> * fdebuginfo.java: Refactor, use ProcStopUtil. diff --git a/frysk-core/frysk/bindir/fstep.java b/frysk-core/frysk/bindir/fstep.java index 05bdc6d..01d28c3 100644 --- a/frysk-core/frysk/bindir/fstep.java +++ b/frysk-core/frysk/bindir/fstep.java @@ -54,7 +54,6 @@ import gnu.classpath.tools.getopt.OptionException; import gnu.classpath.tools.getopt.Option; import java.util.Iterator; import frysk.proc.Action; -import frysk.proc.ProcId; import frysk.proc.Proc; import frysk.proc.Task; @@ -175,14 +174,13 @@ public class fstep } final fstep step = new fstep(); - if (pid != 0) - { - Manager.host.requestProc(new ProcId(pid), new FindProc() { + if (pid != 0) { + Manager.host.requestProc(pid, new FindProc() { public void procFound(Proc proc) { Task mainTask = proc.getMainTask(); mainTask.requestAddAttachedObserver(step); } - public void procNotFound(ProcId procId) { + public void procNotFound(int pid) { System.err.println("no such process: " + pid); parser.printHelp(); System.exit(-1); diff --git a/frysk-core/frysk/ftrace/ChangeLog b/frysk-core/frysk/ftrace/ChangeLog index 03a0511..904015c 100644 --- a/frysk-core/frysk/ftrace/ChangeLog +++ b/frysk-core/frysk/ftrace/ChangeLog @@ -1,3 +1,7 @@ +2008-02-07 Andrew Cagney <cagney@redhat.com> + + * Ftrace.java: Update to use Host.requestProc(int,FindProc). + 2008-01-24 Andrew Cagney <cagney@redhat.com> * MappingGuard.java: Update to match diff --git a/frysk-core/frysk/ftrace/Ftrace.java b/frysk-core/frysk/ftrace/Ftrace.java index c2b14be..d49eef1 100644 --- a/frysk-core/frysk/ftrace/Ftrace.java +++ b/frysk-core/frysk/ftrace/Ftrace.java @@ -209,11 +209,12 @@ public class Ftrace init(); for (Iterator it = tracedParents.iterator(); it.hasNext(); ){ Manager.host.requestProc - ((ProcId)it.next(), + (((ProcId)it.next()).hashCode(), new FindProc() { public void procFound(Proc proc) {} - public void procNotFound(ProcId procId) { - System.err.println("No process with ID " + procId.intValue() + " found."); + public void procNotFound(int pid) { + System.err.println("No process with ID " + + pid + " found."); Manager.eventLoop.requestStop(); } } diff --git a/frysk-core/frysk/hpd/AttachCommand.java b/frysk-core/frysk/hpd/AttachCommand.java index 60ed4f1..3202e8b 100644 --- a/frysk-core/frysk/hpd/AttachCommand.java +++ b/frysk-core/frysk/hpd/AttachCommand.java @@ -41,7 +41,6 @@ package frysk.hpd; import frysk.dwfl.DwflCache; import frysk.proc.Proc; -import frysk.proc.ProcId; import frysk.proc.Manager; import frysk.proc.FindProc; import java.util.List; @@ -59,7 +58,7 @@ class AttachCommand extends ParameterizedCommand { notifyAll(); } - public synchronized void procNotFound(ProcId procId) { + public synchronized void procNotFound(int pid) { proc = null; procSearchFinished = true; notifyAll(); @@ -102,7 +101,7 @@ class AttachCommand extends ParameterizedCommand { for (int i = 0; i < cmd.size(); i++) { int pid = Integer.parseInt(cmd.parameter(i)); ProcFinder findProc = new ProcFinder(); - Manager.host.requestProc(new ProcId(pid), findProc); + Manager.host.requestProc(pid, findProc); synchronized (findProc) { while (!findProc.procSearchFinished) { try { diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 4c62efd..da591a3 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,9 @@ +2008-02-07 Andrew Cagney <cagney@redhat.com> + + * AttachCommand.java: Update to use + Host.requestProc(int,FindProc). + * TestLib.java: Ditto. + 2008-02-06 Stan Cox <scox@redhat.com> * ListCommand.java (currentFrame): New. diff --git a/frysk-core/frysk/hpd/TestLib.java b/frysk-core/frysk/hpd/TestLib.java index a494289..0f8a95d 100644 --- a/frysk-core/frysk/hpd/TestLib.java +++ b/frysk-core/frysk/hpd/TestLib.java @@ -41,7 +41,6 @@ package frysk.hpd; import frysk.proc.Manager; import frysk.proc.Proc; -import frysk.proc.ProcId; import frysk.testbed.TearDownExpect; import frysk.sys.ProcessIdentifier; import frysk.proc.FindProc; @@ -72,14 +71,14 @@ class TestLib extends frysk.testbed.TestLib { this.proc = proc; Manager.eventLoop.requestStop(); } - public void procNotFound(ProcId procId) { - fail("Couldn't find child process"); + public void procNotFound(int pid) { + fail("Couldn't find child process " + pid); } } Finder finder = new Finder(); - Manager.host.requestProc(new ProcId(pid.hashCode()), finder); + Manager.host.requestProc(pid.intValue(), finder); Manager.eventLoop.run(); return finder.proc; } diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog index a43054f..213f63a 100644 --- a/frysk-core/frysk/proc/ChangeLog +++ b/frysk-core/frysk/proc/ChangeLog @@ -1,3 +1,16 @@ +2008-02-07 Andrew Cagney <cagney@redhat.com> + + * FindProc.java (procNotFound(int)): Replace procNotFound(ProcId). + * Host.java (requestProc(int,FindProc)): Replace + requestProc(ProcId,FindProc). + * ProcBlockAction.java (ProcBlockAction(int)): Replace + ProcBlockAction(ProcId). + * TestSyscallRunning.java: Update. + * TestBreakpoints.java: Update. + * TestFindProc.java: Update. + * TestSyscallSignal.java: Update. + * TestTaskSyscallObserver.java: Update. + 2008-01-31 Andrew Cagney <cagney@redhat.com> * Host.java (requestRefresh(Set,HostRefreshBuilder)): New. diff --git a/frysk-core/frysk/proc/FindProc.java b/frysk-core/frysk/proc/FindProc.java index 84ea46d..cb9d748 100644 --- a/frysk-core/frysk/proc/FindProc.java +++ b/frysk-core/frysk/proc/FindProc.java @@ -56,5 +56,5 @@ public interface FindProc { * The process with the given ID was not found. * @param procId the procId that was not found. */ - void procNotFound(ProcId procId); + void procNotFound(int pid); } diff --git a/frysk-core/frysk/proc/Host.java b/frysk-core/frysk/proc/Host.java index 38be802..addd620 100644 --- a/frysk-core/frysk/proc/Host.java +++ b/frysk-core/frysk/proc/Host.java @@ -137,7 +137,7 @@ public abstract class Host { /** * Find a specifc process from its Id. */ - public abstract void requestProc(ProcId procId, FindProc finder); + public abstract void requestProc(int pid, FindProc finder); /** * Given a set of knownProcesses and knownDaemons (children of diff --git a/frysk-core/frysk/proc/ProcBlockAction.java b/frysk-core/frysk/proc/ProcBlockAction.java index 83f410c..049f81f 100644 --- a/frysk-core/frysk/proc/ProcBlockAction.java +++ b/frysk-core/frysk/proc/ProcBlockAction.java @@ -50,8 +50,10 @@ import frysk.event.Event; import frysk.proc.dead.LinuxCoreHost; /** - * This class blocks all of the threads in a process and performs a given action - * defined by the method existingTask(Task task) on each task. + * This class blocks all of the threads in a process and performs a + * given action defined by the method existingTask(Task task) on each + * task. + * * Extensions of this class must implement existingTask(), and * allExistingTasksCompleted() which is called when existingTask() has been * called on all tasks. @@ -150,21 +152,20 @@ public class ProcBlockAction requestAdd(); } - public ProcBlockAction (ProcId procId) - { - logger.log(Level.FINE, "{0} new\n", this); - - Manager.host.requestProc(procId, new FindProc() { - public void procFound(Proc proc) { - ProcBlockAction.this.proc = proc; - taskList = proc.getTasks(); - requestAdd(); - } - public void procNotFound(ProcId procId) { - throw new RuntimeException("Proc not found " + procId.intValue()); - } - }); - } + public ProcBlockAction(int pid) { + logger.log(Level.FINE, "{0} new\n", this); + Manager.host.requestProc(pid, new FindProc() { + public void procFound(Proc proc) { + ProcBlockAction.this.proc = proc; + taskList = proc.getTasks(); + requestAdd(); + } + public void procNotFound(int pid) { + // This is not at all friendly! + throw new RuntimeException("Proc not found " + pid); + } + }); + } public ProcBlockAction (File coreFile) { LinuxCoreHost core = new LinuxCoreHost(Manager.eventLoop, coreFile); diff --git a/frysk-core/frysk/proc/TestBreakpoints.java b/frysk-core/frysk/proc/TestBreakpoints.java index 51ccafb..683d4fc 100644 --- a/frysk-core/frysk/proc/TestBreakpoints.java +++ b/frysk-core/frysk/proc/TestBreakpoints.java @@ -95,14 +95,14 @@ public class TestBreakpoints // Make sure the core knows about it. Manager.host.requestProc - (new ProcId(process.pid.hashCode()), + (process.pid.intValue(), new FindProc() { public void procFound(Proc proc) { TestBreakpoints.this.proc = proc; Manager.eventLoop.requestStop(); } - public void procNotFound(ProcId procId) { - fail("proc not found"); + public void procNotFound(int pid) { + fail("proc not found " + pid); } }); assertRunUntilStop("finding proc"); diff --git a/frysk-core/frysk/proc/TestFindProc.java b/frysk-core/frysk/proc/TestFindProc.java index 45c5229..2819c87 100644 --- a/frysk-core/frysk/proc/TestFindProc.java +++ b/frysk-core/frysk/proc/TestFindProc.java @@ -66,19 +66,18 @@ public class TestFindProc } class MyFinder implements FindProc { - private final ProcId expectedId; - public MyFinder (ProcId pid) { + private final int expectedId; + public MyFinder(int pid) { expectedId = pid; } public void procFound(Proc proc) { logger.log(Level.FINE, "proc: {0} proc parent: {1} \n", new Object[] { proc, proc.getParent() }); - assertEquals("procId", expectedId, proc.getId()); + assertEquals("procId", expectedId, proc.getPid()); Manager.eventLoop.requestStop(); } - public void procNotFound(ProcId procId) { - logger.log(Level.FINE, "{0} procId\n", procId); - fail("Could not find process with ID" + procId.id); + public void procNotFound(int pid) { + fail("Could not find process with ID" + pid); } } @@ -121,8 +120,8 @@ public class TestFindProc * Find out how many processes are associated with the test process. * Should be just the one. */ - FindProc finder = new MyFinder(new ProcId(ackProc.getPid())); - Manager.host.requestProc(new ProcId(ackProc.getPid()), finder); + FindProc finder = new MyFinder(ackProc.getPid()); + Manager.host.requestProc(ackProc.getPid(), finder); assertRunUntilStop("testFindProc"); int postFind = o.getCount(); @@ -131,25 +130,21 @@ public class TestFindProc } - public void testFindAndRefreshFailed () - { - FindProc finder = new FindProc() - { - public void procFound(Proc proc) { - logger.log(Level.FINE, "{0} procId\n", proc); - fail("Found proc 0, should have failed."); - } - - public void procNotFound(ProcId procId) { - logger.log(Level.FINE, "{0} procId\n", procId); - Manager.eventLoop.requestStop(); - } - }; - - Manager.host.requestProc(new ProcId(0), finder); - assertRunUntilStop("testFindFailed"); - - } + public void testFindAndRefreshFailed() { + FindProc finder = new FindProc() { + public void procFound(Proc proc) { + logger.log(Level.FINE, "{0} procId\n", proc); + fail("Found proc 0, should have failed."); + } + public void procNotFound(int pid) { + logger.log(Level.FINE, "{0} procId\n", new Integer(pid)); + assertEquals("pid", 0, pid); + Manager.eventLoop.requestStop(); + } + }; + Manager.host.requestProc(0, finder); + assertRunUntilStop("testFindFailed"); + } public void testFindUsingRefresh () diff --git a/frysk-core/frysk/proc/TestSyscallRunning.java b/frysk-core/frysk/proc/TestSyscallRunning.java index 725a617..78d80b5 100644 --- a/frysk-core/frysk/proc/TestSyscallRunning.java +++ b/frysk-core/frysk/proc/TestSyscallRunning.java @@ -71,40 +71,37 @@ public class TestSyscallRunning BufferedReader in; DataOutputStream out; - /** - * Launch our test program and setup clean environment with a runner - * eventloop. - */ - public void setUp() - { - // Make sure everything is setup so spawned processes are recognized - // and destroyed in tearDown(). - super.setUp(); - - // Create a process that we will communicate with through stdin/out. - DaemonPipePair process - = new DaemonPipePair(new String[] { - Config.getPkgLibFile("funit-syscall-running").getPath() - }); - TearDownProcess.add(process.pid); - - in = new BufferedReader(new InputStreamReader(process.in.getInputStream())); - out = new DataOutputStream(process.out.getOutputStream()); - - // Make sure the core knows about it. - Manager.host.requestProc(new ProcId(process.pid.hashCode()), - new FindProc() - { - public void procFound(Proc p) { - proc = p; - Manager.eventLoop.requestStop(); - } - public void procNotFound(ProcId procId) { - fail("proc not found"); - } - }); - assertRunUntilStop("finding proc"); - } + /** + * Launch our test program and setup clean environment with a runner + * eventloop. + */ + public void setUp() { + // Make sure everything is setup so spawned processes are + // recognized and destroyed in tearDown(). + super.setUp(); + + // Create a process that we will communicate with through stdin/out. + DaemonPipePair process + = new DaemonPipePair(new String[] { + Config.getPkgLibFile("funit-syscall-running").getPath() + }); + TearDownProcess.add(process.pid); + + in = new BufferedReader(new InputStreamReader(process.in.getInputStream())); + out = new DataOutputStream(process.out.getOutputStream()); + + // Make sure the core knows about it. + Manager.host.requestProc(process.pid.intValue(), new FindProc() { + public void procFound(Proc p) { + proc = p; + Manager.eventLoop.requestStop(); + } + public void procNotFound(int pid) { + fail("proc not found " + pid); + } + }); + assertRunUntilStop("finding proc"); + } public void testSyscallRunning() throws IOException { diff --git a/frysk-core/frysk/proc/TestSyscallSignal.java b/frysk-core/frysk/proc/TestSyscallSignal.java index 279d917..4cf5f44 100644 --- a/frysk-core/frysk/proc/TestSyscallSignal.java +++ b/frysk-core/frysk/proc/TestSyscallSignal.java @@ -71,40 +71,38 @@ public class TestSyscallSignal BufferedReader in; DataOutputStream out; - /** - * Launch our test program and setup clean environment with a runner - * eventloop. - */ - public void setUp() - { - // Make sure everything is setup so spawned processes are recognized - // and destroyed in tearDown(). - super.setUp(); - - // Create a process that we will communicate with through stdin/out. - DaemonPipePair process - = new DaemonPipePair(new String[] { - Config.getPkgLibFile("funit-syscall-signal") - .getPath() - }); - pid = process.pid; - TearDownProcess.add(pid); - in = new BufferedReader(new InputStreamReader(process.in.getInputStream())); - out = new DataOutputStream(process.out.getOutputStream()); - - // Make sure the core knows about it. - Manager.host.requestProc(new ProcId(pid.hashCode()), new FindProc() - { - public void procFound(Proc p) { - proc = p; - Manager.eventLoop.requestStop(); - } - public void procNotFound (ProcId procId) { - fail("proc not found"); - } - }); - assertRunUntilStop("finding proc"); - } + /** + * Launch our test program and setup clean environment with a + * runner eventloop. + */ + public void setUp() { + // Make sure everything is setup so spawned processes are + // recognized and destroyed in tearDown(). + super.setUp(); + + // Create a process that we will communicate with through stdin/out. + DaemonPipePair process + = new DaemonPipePair(new String[] { + Config.getPkgLibFile("funit-syscall-signal") + .getPath() + }); + pid = process.pid; + TearDownProcess.add(pid); + in = new BufferedReader(new InputStreamReader(process.in.getInputStream())); + out = new DataOutputStream(process.out.getOutputStream()); + + // Make sure the core knows about it. + Manager.host.requestProc(pid.intValue(), new FindProc() { + public void procFound(Proc p) { + proc = p; + Manager.eventLoop.requestStop(); + } + public void procNotFound(int pid) { + fail("proc not found " + pid); + } + }); + assertRunUntilStop("finding proc"); + } hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-02-07 18:04 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=20080207180434.29280.qmail@sourceware.org \ --to=cagney@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: linkBe 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).