public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: frysk-core/frysk/bindir/ChangeLog Date: Tue, 26 Feb 2008 20:15:00 -0000 [thread overview] Message-ID: <20080226201537.1880.qmail@sourceware.org> (raw) The branch, master has been updated via b9720029b5f6033a9b07693a5b9d019eee9aeb71 (commit) from 4124bcd68eec6a7f0765153b6b4f61b43a664385 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit b9720029b5f6033a9b07693a5b9d019eee9aeb71 Author: Andrew Cagney <cagney@redhat.com> Date: Tue Feb 26 15:11:13 2008 -0500 frysk-core/frysk/bindir/ChangeLog 2008-02-26 Andrew Cagney <cagney@redhat.com> * fcatch.java: Update to match CommandlineParser. * fstack.java: Ditto. * ftrace.java: Ditto. * fstep.java: Ditto. * fhpd.java: Ditto. frysk-core/frysk/hpd/ChangeLog 2008-02-26 Andrew Cagney <cagney@redhat.com> * LoadCommand.java: Update to match LinuxExeFactory. frysk-core/frysk/proc/dead/ChangeLog 2008-02-26 Andrew Cagney <cagney@redhat.com> * LinuxExeFactory.java (createProc(File,String[])): Replace createProc(EventLoop,File,String[]). (createProc(String[])): New. * TestLinuxExe.java: Update. frysk-core/frysk/util/ChangeLog 2008-02-26 Andrew Cagney <cagney@redhat.com> * CommandlineParser.java parseCommandFIXME(String[]): Replace parseCommand(String[]). (parseCommand(Proc)): New. (parseCoresFIXME(CoreExePair[])): Replace parseCores(CoreExePair[]). (parseCores(Proc[])): New. * TestCommandlineParser.java: Update. * ProcStopUtil.java: Update to match LinuxExeFactory and above. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 8 ++++ frysk-core/frysk/bindir/fcatch.java | 2 +- frysk-core/frysk/bindir/fhpd.java | 4 +- frysk-core/frysk/bindir/fstack.java | 3 +- frysk-core/frysk/bindir/fstep.java | 5 +- frysk-core/frysk/bindir/ftrace.java | 2 +- frysk-core/frysk/hpd/ChangeLog | 4 ++ frysk-core/frysk/hpd/LoadCommand.java | 4 +- frysk-core/frysk/proc/dead/ChangeLog | 7 +++ frysk-core/frysk/proc/dead/LinuxExeFactory.java | 8 ++- frysk-core/frysk/proc/dead/TestLinuxExe.java | 4 +- frysk-core/frysk/util/ChangeLog | 10 +++++ frysk-core/frysk/util/CommandlineParser.java | 45 +++++++++++++++++---- frysk-core/frysk/util/ProcStopUtil.java | 8 +-- frysk-core/frysk/util/TestCommandlineParser.java | 43 ++++++++++++--------- 15 files changed, 107 insertions(+), 50 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index ffad219..b361474 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,3 +1,11 @@ +2008-02-26 Andrew Cagney <cagney@redhat.com> + + * fcatch.java: Update to match CommandlineParser. + * fstack.java: Ditto. + * ftrace.java: Ditto. + * fstep.java: Ditto. + * fhpd.java: Ditto. + 2008-02-26 Phil Muldoon <pmuldoon@redhat.com> * fcore.java (addOptions): Rename to diff --git a/frysk-core/frysk/bindir/fcatch.java b/frysk-core/frysk/bindir/fcatch.java index 4e0d871..069c0b0 100644 --- a/frysk-core/frysk/bindir/fcatch.java +++ b/frysk-core/frysk/bindir/fcatch.java @@ -65,7 +65,7 @@ public class fcatch { } //@Override - public void parseCommand(String[] command) { + public void parseCommandFIXME(String[] command) { System.err.println("Entered parseCommand"); argString = new StringBuffer(command[0]); for (int i = 1; i < command.length; i++) diff --git a/frysk-core/frysk/bindir/fhpd.java b/frysk-core/frysk/bindir/fhpd.java index f59240b..ab55c52 100644 --- a/frysk-core/frysk/bindir/fhpd.java +++ b/frysk-core/frysk/bindir/fhpd.java @@ -145,7 +145,7 @@ public class fhpd { public static void main (String[] args) { CommandlineParser parser = new CommandlineParser ("fhpd") { //@Override - public void parseCommand (String[] command) { + public void parseCommandFIXME(String[] command) { execFile = new File (command[0]); if (execFile.canRead() == false) { printHelp(); @@ -158,7 +158,7 @@ public class fhpd { fhpd.procs = procs; } - public void parseCores(CoreExePair[] corePairs) { + public void parseCoresFIXME(CoreExePair[] corePairs) { core = corePairs[0].coreFile; exeFile = corePairs[0].exeFile; } diff --git a/frysk-core/frysk/bindir/fstack.java b/frysk-core/frysk/bindir/fstack.java index 9f7bbca..b25b682 100644 --- a/frysk-core/frysk/bindir/fstack.java +++ b/frysk-core/frysk/bindir/fstack.java @@ -157,8 +157,7 @@ public final class fstack parser = new CommandlineParser("fstack") { //@Override - public void parseCores (CoreExePair[] coreExePairs) - { + public void parseCoresFIXME(CoreExePair[] coreExePairs) { for (int i = 0; i < coreExePairs.length; i++) stackCore(coreExePairs[i]); } diff --git a/frysk-core/frysk/bindir/fstep.java b/frysk-core/frysk/bindir/fstep.java index 01d28c3..e8a783a 100644 --- a/frysk-core/frysk/bindir/fstep.java +++ b/frysk-core/frysk/bindir/fstep.java @@ -92,9 +92,8 @@ public class fstep final CommandlineParser parser = new CommandlineParser("fstep") { - public void parseCommand (String[] command) - { - fstep.command = command; + public void parseCommandFIXME(String[] command) { + fstep.command = command; } }; diff --git a/frysk-core/frysk/bindir/ftrace.java b/frysk-core/frysk/bindir/ftrace.java index c9fcfec..98d66e0 100644 --- a/frysk-core/frysk/bindir/ftrace.java +++ b/frysk-core/frysk/bindir/ftrace.java @@ -700,7 +700,7 @@ class ftrace } //@Override - public void parseCommand (String[] command) + public void parseCommandFIXME(String[] command) { commandAndArguments = new ArrayList(); diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 9410dcb..4f2a902 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,7 @@ +2008-02-26 Andrew Cagney <cagney@redhat.com> + + * LoadCommand.java: Update to match LinuxExeFactory. + 2008-02-25 Rick Moseley <rmoseley@redhat.com> * Input.java (getFullCommand): New. diff --git a/frysk-core/frysk/hpd/LoadCommand.java b/frysk-core/frysk/hpd/LoadCommand.java index 4bc03ae..f1b3b64 100644 --- a/frysk-core/frysk/hpd/LoadCommand.java +++ b/frysk-core/frysk/hpd/LoadCommand.java @@ -46,7 +46,6 @@ import frysk.debuginfo.DebugInfo; import frysk.debuginfo.DebugInfoFrame; import frysk.debuginfo.DebugInfoStackFactory; import frysk.dwfl.DwflCache; -import frysk.proc.Manager; import frysk.proc.Proc; import frysk.proc.Task; import java.util.List; @@ -108,8 +107,7 @@ public class LoadCommand extends ParameterizedCommand { ("File does not exist or is not readable or is not a file."); } - Proc exeProc = LinuxExeFactory.createProc(Manager.eventLoop, - executableFile, + Proc exeProc = LinuxExeFactory.createProc(executableFile, cmd.stringArrayValue()); int procID; diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog index eef2273..9f6b5ef 100644 --- a/frysk-core/frysk/proc/dead/ChangeLog +++ b/frysk-core/frysk/proc/dead/ChangeLog @@ -1,3 +1,10 @@ +2008-02-26 Andrew Cagney <cagney@redhat.com> + + * LinuxExeFactory.java (createProc(File,String[])): Replace + createProc(EventLoop,File,String[]). + (createProc(String[])): New. + * TestLinuxExe.java: Update. + 2008-02-26 Teresa Thomas <tthomas@redhat.com> * TestLinuxCore.java: Update imports. diff --git a/frysk-core/frysk/proc/dead/LinuxExeFactory.java b/frysk-core/frysk/proc/dead/LinuxExeFactory.java index 28d0082..3165f4f 100644 --- a/frysk-core/frysk/proc/dead/LinuxExeFactory.java +++ b/frysk-core/frysk/proc/dead/LinuxExeFactory.java @@ -46,11 +46,9 @@ import lib.dwfl.Elf; import lib.dwfl.ElfCommand; import lib.dwfl.ElfEHeader; import frysk.proc.MemoryMap; -import frysk.event.EventLoop; public class LinuxExeFactory { - public static LinuxExeProc createProc(EventLoop eventLoop, - final File exeFile, + public static LinuxExeProc createProc(final File exeFile, String[] args) { Elf exeElf = null; try { @@ -85,4 +83,8 @@ public class LinuxExeFactory { exeElf.close(); } } + + public static LinuxExeProc createProc(String[] args) { + return createProc(new File(args[0]), args); + } } diff --git a/frysk-core/frysk/proc/dead/TestLinuxExe.java b/frysk-core/frysk/proc/dead/TestLinuxExe.java index c105800..8219926 100644 --- a/frysk-core/frysk/proc/dead/TestLinuxExe.java +++ b/frysk-core/frysk/proc/dead/TestLinuxExe.java @@ -45,13 +45,11 @@ import inua.eio.ByteBuffer; import frysk.proc.Task; import frysk.proc.Proc; import frysk.testbed.TestLib; -import frysk.proc.Manager; public class TestLinuxExe extends TestLib { public void testLinuxTaskMemory() { Proc proc - = LinuxExeFactory.createProc(Manager.eventLoop, - Config.getPkgDataFile("test-exe-x86"), + = LinuxExeFactory.createProc(Config.getPkgDataFile("test-exe-x86"), new String[0]); assertNotNull("Proc exists in exefile", proc); assertNotNull("Executable file Host is Null?",proc.getHost()); diff --git a/frysk-core/frysk/util/ChangeLog b/frysk-core/frysk/util/ChangeLog index 8e20a6b..0e3552a 100644 --- a/frysk-core/frysk/util/ChangeLog +++ b/frysk-core/frysk/util/ChangeLog @@ -1,3 +1,13 @@ +2008-02-26 Andrew Cagney <cagney@redhat.com> + + * CommandlineParser.java parseCommandFIXME(String[]): Replace + parseCommand(String[]). + (parseCommand(Proc)): New. + (parseCoresFIXME(CoreExePair[])): Replace parseCores(CoreExePair[]). + (parseCores(Proc[])): New. + * TestCommandlineParser.java: Update. + * ProcStopUtil.java: Update to match LinuxExeFactory and above. + 2008-02-26 Teresa Thomas <tthomas@redhat.com> * TestCoredumpAction.java: Move to frysk.testbed. diff --git a/frysk-core/frysk/util/CommandlineParser.java b/frysk-core/frysk/util/CommandlineParser.java index 472c8fe..529b68c 100644 --- a/frysk-core/frysk/util/CommandlineParser.java +++ b/frysk-core/frysk/util/CommandlineParser.java @@ -49,6 +49,8 @@ import gnu.classpath.tools.getopt.OptionException; import gnu.classpath.tools.getopt.Parser; import frysk.Config; import frysk.EventLogger; +import frysk.proc.dead.LinuxCoreFactory; +import frysk.proc.dead.LinuxExeFactory; import frysk.proc.Proc; /** @@ -76,7 +78,6 @@ public class CommandlineParser { */ public void parsePids(Proc[] pids) { System.err.println("Error: Pids not supported."); - printHelp(); System.exit(1); } @@ -87,21 +88,47 @@ public class CommandlineParser { * @param coreFiles The array of core files passed on the command * line. */ - public void parseCores(CoreExePair[] coreExePairs) { - System.err.println("Error: Cores not supported."); - printHelp(); + public void parseCoresFIXME(CoreExePair[] coreExePairs) { + Proc[] procs = new Proc[coreExePairs.length]; + for (int i = 0; i < coreExePairs.length; i++) { + CoreExePair pair = coreExePairs[i]; + if (pair.exeFile == null) + procs[i] = LinuxCoreFactory.createProc(pair.coreFile); + else + procs[i] = LinuxCoreFactory.createProc(pair.coreFile, + pair.exeFile); + } + parseCores(procs); + } + /** + * Callback function. Gives an array of core files if core files + * were detected on the command line. + * + * @param coreFiles The array of core files passed on the command + * line. + */ + public void parseCores(Proc[] cores) { + System.err.println("Error: Corefiles not supported."); System.exit(1); } /** * Callback function. Gives a string array represented a parsed - * command. + * command. Clients should instead accept the parsed and verified + * Proc. + * + * @param command The parsed command. + */ + public void parseCommandFIXME(String[] command) { + parseCommand(LinuxExeFactory.createProc(command)); + } + /** + * Callback function. Gives a Proc represented a parsed command. * * @param command The parsed command. */ - public void parseCommand(String[] command) { + public void parseCommand(Proc command) { System.err.println("Error: Commands not supported."); - printHelp(); System.exit(1); } @@ -163,12 +190,12 @@ public class CommandlineParser { } CoreExePair[] coreExePairs = new CoreExePair[coreExeFiles.size()]; coreExeFiles.toArray(coreExePairs); - parseCores(coreExePairs); + parseCoresFIXME(coreExePairs); return result; } // If not above, then this is an executable command. - parseCommand(result); + parseCommandFIXME(result); return result; } diff --git a/frysk-core/frysk/util/ProcStopUtil.java b/frysk-core/frysk/util/ProcStopUtil.java index 6a12b32..869f37f 100644 --- a/frysk-core/frysk/util/ProcStopUtil.java +++ b/frysk-core/frysk/util/ProcStopUtil.java @@ -81,8 +81,7 @@ public class ProcStopUtil } //@Override - public void parseCores (CoreExePair[] coreExePairs) - { + public void parseCoresFIXME(CoreExePair[] coreExePairs) { for (int i = 0; i < coreExePairs.length; i++) { proc = Util.getProcFromCoreExePair(coreExePairs[i]); @@ -92,7 +91,7 @@ public class ProcStopUtil } //@Override - public void parseCommand(String[] command) { + public void parseCommandFIXME(String[] command) { File exeFile = new File(command[0]); if (!exeFile.exists() || !exeFile.canRead() || !exeFile.isFile()) { @@ -101,8 +100,7 @@ public class ProcStopUtil System.exit(1); } else { Manager.eventLoop.start(); - proc = LinuxExeFactory.createProc(Manager.eventLoop, - exeFile, command); + proc = LinuxExeFactory.createProc(exeFile, command); failIfProcNull(proc); procEvent.executeDead(proc, null); } diff --git a/frysk-core/frysk/util/TestCommandlineParser.java b/frysk-core/frysk/util/TestCommandlineParser.java index f039dca..78425bc 100644 --- a/frysk-core/frysk/util/TestCommandlineParser.java +++ b/frysk-core/frysk/util/TestCommandlineParser.java @@ -47,20 +47,30 @@ import frysk.proc.Proc; public class TestCommandlineParser extends TestLib { + private File exe; + private File core; + public void setUp() { + super.setUp(); + exe = Config.getPkgLibFile("funit-hello"); + core = CorefileFactory.constructCoreAtSignal(exe); + } + public void tearDown() { + exe = null; + core = null; + super.tearDown(); + } + public void testCoreExe() { - final File exe = Config.getPkgLibFile("funit-hello"); - final File core = CorefileFactory.constructCoreAtSignal(exe); CommandlineParser parser = new CommandlineParser("test") { - public void parseCommand(String[] command) { + public void parseCommand(Proc command) { fail("Shoudn't have a command"); } - public void parseCores(CoreExePair[] coreExePairs) { - assertEquals("Should have one pair", - coreExePairs.length, 1); - assertEquals("Core file is correct", - coreExePairs[0].coreFile, core); - assertEquals("Exe file is correct", - coreExePairs[0].exeFile, exe); + public void parseCores(Proc[] cores) { + assertEquals("Should have one pair", cores.length, 1); + assertEquals("Core file is correct", core.getName(), + cores[0].getHost().getName()); + assertEquals("Exe file is correct", exe.getPath(), + cores[0].getExe()); } public void parsePids(Proc[] procs) { fail("Shouldn't have a pid"); @@ -74,17 +84,14 @@ public class TestCommandlineParser extends TestLib { } public void testCore() { - final File exe = Config.getPkgLibFile("funit-hello"); - final File core = CorefileFactory.constructCoreAtSignal(exe); CommandlineParser parser = new CommandlineParser("test") { - public void parseCommand(String[] command) { + public void parseCommand(Proc command) { fail("Shoudn't have a command"); } - public void parseCores(CoreExePair[] coreExePairs) { - assertEquals("Should have one pair", - coreExePairs.length, 1); - assertEquals("Core file is correct", - coreExePairs[0].coreFile, core); + public void parseCores(Proc[] cores) { + assertEquals("Should have one pair", cores.length, 1); + assertEquals("Core file is correct", core.getName(), + cores[0].getHost().getName()); } public void parsePids(Proc[] procs) { fail("Shouldn't have a pid"); hooks/post-receive -- frysk system monitor/debugger
next reply other threads:[~2008-02-26 20:15 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-02-26 20:15 cagney [this message] -- strict thread matches above, loose matches on Subject: below -- 2008-02-19 16:19 cagney 2008-01-25 17:32 cagney
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=20080226201537.1880.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).