public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: 2007-12-10 Phil Muldoon <pmuldoon@redhat.com> Date: Mon, 10 Dec 2007 23:18:00 -0000 [thread overview] Message-ID: <20071210231852.10766.qmail@sourceware.org> (raw) The branch, master has been updated via 14f35178d5566764b7d964bdddd18b5f2287a58b (commit) from b26d3ca6ff01019e0287fc89f2eedf0d6879d8ff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 14f35178d5566764b7d964bdddd18b5f2287a58b Author: Phil Muldoon <pmuldoon@redhat.com> Date: Mon Dec 10 23:18:42 2007 +0000 2007-12-10 Phil Muldoon <pmuldoon@redhat.com> * fmaps.java: Indent. * TestFmaps.java: Indent (testExeOfPid): Look only for executable name. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 5 ++ frysk-core/frysk/bindir/TestFmaps.java | 45 ++++++++--------- frysk-core/frysk/bindir/fmaps.java | 86 ++++++++++++++++---------------- 3 files changed, 70 insertions(+), 66 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index 8e19593..63c0dd4 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,8 +1,13 @@ 2007-12-10 Phil Muldoon <pmuldoon@redhat.com> + * fmaps.java: Indent. + * TestFmaps.java: Indent + (testExeOfPid): Look only for executable name. + * fmaps.java: New. * fmaps.xml: New. * TestFmaps.java: New. + 2007-11-30 Petr Machata <pmachata@redhat.com> diff --git a/frysk-core/frysk/bindir/TestFmaps.java b/frysk-core/frysk/bindir/TestFmaps.java index c4dc03e..66705be 100644 --- a/frysk-core/frysk/bindir/TestFmaps.java +++ b/frysk-core/frysk/bindir/TestFmaps.java @@ -55,28 +55,27 @@ public class TestFmaps * problems with Linux's bone-head COREFILE format storing only * the first 50 characters of the executable. */ - private Expect fmaps(String program, String[] args) { - File coreExe = Config.getPkgLibFile(program); - File coreFile = CoreFileAtSignal.constructCore(coreExe); - String[] argv = new String[args.length + 3]; - int argc = 0; - argv[argc++] = Config.getBinFile("fmaps").getAbsolutePath(); - argv[argc++] = coreFile.getAbsolutePath(); - argv[argc++] = coreExe.getAbsolutePath(); - for (int i = 0; i < args.length; i++) { - argv[argc + i] = args[i]; + private Expect fmaps(String program, String[] args) { + File coreExe = Config.getPkgLibFile(program); + File coreFile = CoreFileAtSignal.constructCore(coreExe); + String[] argv = new String[args.length + 3]; + int argc = 0; + argv[argc++] = Config.getBinFile("fmaps").getAbsolutePath(); + argv[argc++] = coreFile.getAbsolutePath(); + argv[argc++] = coreExe.getAbsolutePath(); + for (int i = 0; i < args.length; i++) { + argv[argc + i] = args[i]; + } + Expect e = new Expect(argv); + TearDownExpect.add(e); + return e; + } + + // Basic sniff test, are we getting output that looks like a map? + // getMaps is tested in the frysk-core/proc namespalce + public void testExeOfPid() { + Expect e = fmaps("funit-stack-outlined", new String[0]); + e.expect("funit-stack-outlined"); + } - Expect e = new Expect(argv); - TearDownExpect.add(e); - return e; - } - - // Basic sniff test, are we getting output that looks like a map? - // getMaps is tested in the frysk-core/proc namespalce - public void testExeOfPid() { - Expect e = fmaps("funit-stack-outlined", new String[0]); - e.expect("frysk/pkglibdir/funit-stack-outlined"); - e.expect("ld-"); - e.expect("libc"); - } } diff --git a/frysk-core/frysk/bindir/fmaps.java b/frysk-core/frysk/bindir/fmaps.java index 82766e6..d9d80c9 100644 --- a/frysk-core/frysk/bindir/fmaps.java +++ b/frysk-core/frysk/bindir/fmaps.java @@ -48,51 +48,51 @@ import java.io.File; import frysk.util.CoreExePair; public class fmaps { - - public static void main (String[] args) { - // Parse command line. Check pid provided. - CommandlineParser parser = new CommandlineParser("fexe") { + public static void main (String[] args) { + // Parse command line. Check pid provided. - public void parseCores (CoreExePair[] corePairs) { - for (int i = 0; i < corePairs.length; i++) { - File coreFile = corePairs[i].coreFile; - File exeFile = corePairs[i].exeFile; - Proc proc; - - if (exeFile == null) - proc = Util.getProcFromCoreFile(coreFile); - else - proc = Util.getProcFromCoreFile(coreFile, exeFile); - printMaps(proc.getMaps()); - } - - System.exit(0); - } + CommandlineParser parser = new CommandlineParser("fexe") { + + public void parseCores (CoreExePair[] corePairs) { + for (int i = 0; i < corePairs.length; i++) { + File coreFile = corePairs[i].coreFile; + File exeFile = corePairs[i].exeFile; + Proc proc; + + if (exeFile == null) + proc = Util.getProcFromCoreFile(coreFile); + else + proc = Util.getProcFromCoreFile(coreFile, exeFile); + printMaps(proc.getMaps()); + } + + System.exit(0); + } + + public void parsePids (ProcId[] pids) { + for (int i= 0; i< pids.length; i++) { + ProcId id = pids[i]; + Proc proc = Util.getProcFromPid(id); + printMaps(proc.getMaps()); + } + System.exit(0); + } + + private void printMaps(MemoryMap[] maps) + { + for(int i=0; i<maps.length; i++) + System.out.println(maps[i].toString()); + } + + }; - public void parsePids (ProcId[] pids) { - for (int i= 0; i< pids.length; i++) { - ProcId id = pids[i]; - Proc proc = Util.getProcFromPid(id); - printMaps(proc.getMaps()); - } - System.exit(0); - } + parser.setHeader("Usage: fmaps <PID> || fmaps <COREFILE> [<EXEFILE>]"); + parser.parse(args); - private void printMaps(MemoryMap[] maps) - { - for(int i=0; i<maps.length; i++) - System.out.println(maps[i].toString()); - } - - }; - - parser.setHeader("Usage: fmaps <PID> || fmaps <COREFILE> [<EXEFILE>]"); - parser.parse(args); - - //If we got here, we didn't find a pid. - System.err.println("Error: No PID or COREFILE."); - parser.printHelp(); - System.exit(1); - } + //If we got here, we didn't find a pid. + System.err.println("Error: No PID or COREFILE."); + parser.printHelp(); + System.exit(1); + } } hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2007-12-10 23:18 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=20071210231852.10766.qmail@sourceware.org \ --to=pmuldoon@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).