public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: tthomas@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Refactor fmaps to use ProcStopUtil. Date: Thu, 07 Feb 2008 19:24:00 -0000 [thread overview] Message-ID: <20080207192456.17979.qmail@sourceware.org> (raw) The branch, master has been updated via 0fb13e7cc5f975675b50a0e349db34cbcdb0470d (commit) from ec5156efde7f08f2adc5c459155e5abf4ea8477f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0fb13e7cc5f975675b50a0e349db34cbcdb0470d Author: Teresa Thomas <tthomas@redhat.com> Date: Thu Feb 7 13:58:58 2008 -0500 Refactor fmaps to use ProcStopUtil. frysk-core/frysk/bindir/ChangeLog 2008-02-07 Teresa Thomas <tthomas@redhat.com> * fmaps.java: Refactor to use ProcStopUtil. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 8 +++- frysk-core/frysk/bindir/fmaps.java | 65 +++++++++--------------------------- 2 files changed, 22 insertions(+), 51 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index 56e7592..5525a65 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,7 +1,11 @@ -2008-02-07 Andrew Cagney <cagney@redhat.com> +2008-02-07 Teresa Thomas <tthomas@redhat.com> - * fstep.java: Update to use Host.requestProc(int,FindProc). + * fmaps.java: Refactor to use ProcStopUtil. +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/fmaps.java b/frysk-core/frysk/bindir/fmaps.java index d9d80c9..7a328b1 100644 --- a/frysk-core/frysk/bindir/fmaps.java +++ b/frysk-core/frysk/bindir/fmaps.java @@ -39,60 +39,27 @@ package frysk.bindir; -import frysk.util.CommandlineParser; -import frysk.util.Util; +import frysk.util.ProcStopUtil; +import frysk.event.ProcEvent; import frysk.proc.Proc; -import frysk.proc.ProcId; import frysk.proc.MemoryMap; -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 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()); - } - - }; - - 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); + ProcStopUtil fmaps = new ProcStopUtil("fmaps", args, + new PrintMapsEvent()); + fmaps.setUsage("Usage: fmaps <PID> || fmaps <EXEFILE> " + + "|| fmaps <COREFILE> [<EXEFILE>]"); + fmaps.execute(); + } + + private static class PrintMapsEvent implements ProcEvent + { + public void execute(Proc proc) { + MemoryMap[] maps = proc.getMaps(); + for(int i=0; i<maps.length; i++) + System.out.println(maps[i].toString()); + } } } hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-02-07 19:24 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=20080207192456.17979.qmail@sourceware.org \ --to=tthomas@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).