public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Add 'info' command to fhpd. Date: Thu, 20 Dec 2007 10:43:00 -0000 [thread overview] Message-ID: <20071220104355.17679.qmail@sourceware.org> (raw) The branch, master has been updated via e77830491c7108b55f832ead5087f4decf54077f (commit) from 033a6a74b58a3e0980b748360755ee13d9601a61 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit e77830491c7108b55f832ead5087f4decf54077f Author: Phil Muldoon <pmuldoon@redhat.com> Date: Thu Dec 20 10:43:40 2007 +0000 Add 'info' command to fhpd. 2007-12-20 Phil Muldoon <pmuldoon@redhat.com> * InfoCommand.java: New. Add auxv, maps, debuginfo. * TopLevelCommand.java(TopLevelCommand): Add InfoCommand. Remove auxv, maps, debuginfo. * TestRegs.java (testRegsCommand): Add 'info regs' to test. * TestMapsCommand.java (testMapsCommand): Send 'info maps' to expect instead of 'maps'. * TestAuxvCommand.java (testAuxVCoreCommand): Send 'info auxv' to expect instead of 'auxv'. * TestHelp.java (TestHelp): Remove debuginfo, add info to array. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 14 +++++ .../{DebuginfoCommand.java => InfoCommand.java} | 57 +++++++++++--------- frysk-core/frysk/hpd/TestAuxvCommand.java | 2 +- frysk-core/frysk/hpd/TestHelp.java | 2 +- frysk-core/frysk/hpd/TestMapsCommand.java | 2 +- frysk-core/frysk/hpd/TestRegs.java | 25 +++++---- frysk-core/frysk/hpd/TopLevelCommand.java | 4 +- 7 files changed, 64 insertions(+), 42 deletions(-) copy frysk-core/frysk/hpd/{DebuginfoCommand.java => InfoCommand.java} (68%) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 789cd32..3dfa4e7 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,17 @@ +2007-12-20 Phil Muldoon <pmuldoon@redhat.com> + + * InfoCommand.java: New. Add auxv, maps, debuginfo. + * TopLevelCommand.java(TopLevelCommand): Add InfoCommand. + Remove auxv, maps, debuginfo. + * TestRegs.java (testRegsCommand): Add 'info regs' + to test. + * TestMapsCommand.java (testMapsCommand): Send 'info maps' + to expect instead of 'maps'. + * TestAuxvCommand.java (testAuxVCoreCommand): Send 'info auxv' + to expect instead of 'auxv'. + * TestHelp.java (TestHelp): Remove debuginfo, add + info to array. + 2007-12-18 Rick Moseley <rmoseley@redhat.com> * TestLoadCommand.java: Fix regex symbols. diff --git a/frysk-core/frysk/hpd/DebuginfoCommand.java b/frysk-core/frysk/hpd/InfoCommand.java similarity index 68% copy from frysk-core/frysk/hpd/DebuginfoCommand.java copy to frysk-core/frysk/hpd/InfoCommand.java index 51c89b6..d8529cd 100644 --- a/frysk-core/frysk/hpd/DebuginfoCommand.java +++ b/frysk-core/frysk/hpd/InfoCommand.java @@ -36,34 +36,41 @@ // modification, you must delete this exception statement from your // version and license this file solely under the GPL without // exception. - package frysk.hpd; -import java.util.Iterator; -import frysk.proc.Task; -import frysk.util.DebuginfoPaths; import java.util.List; -class DebuginfoCommand extends ParameterizedCommand { - - DebuginfoCommand() { - super("Displays debuginfo install paths of a process.", "debuginfo", - "The debuginfo command lists the debuginfo paths " - + "for a process and its shared modules."); +public class InfoCommand extends MultiLevelCommand { + + private class Help extends Command { + Help() { + super("Display this help message.", "help [command]", + "Display help (possibly for a command.)"); + } + + public void interpret(CLI cli, Input cmd) { + InfoCommand.this.help(cli, cmd); + } + + /** + * Complete the line, throw problem back at the top level + * command. + */ + int complete(CLI cli, Input buffer, int cursor, List candidates) { + return InfoCommand.this.complete(cli, buffer, cursor, + candidates); + } } - - int completer(CLI cli, Input input, int cursor, List completions) { - return -1; - } - - void interpret(CLI cli, Input cmd, Object options) { - PTSet ptset = cli.getCommandPTSet(cmd); - Iterator taskIter = ptset.getTasks(); - while (taskIter.hasNext()) { - Task task = (Task) taskIter.next(); - DebuginfoPaths dbg = new DebuginfoPaths(task); - String dInfo = dbg.getDebuginfo(); - cli.outWriter.println(dInfo); - } + + + InfoCommand() { + super("info command", "info <subcommand>", + "The info command displays useful information about " + + "various system and process level systems."); + add(new Help(), "help"); + add(new RegsCommand(),"regs"); + add(new DebuginfoCommand(),"debuginfo"); + add(new MapsCommand(),"maps"); + add(new AuxvCommand(),"auxv"); } -} \ No newline at end of file +} diff --git a/frysk-core/frysk/hpd/TestAuxvCommand.java b/frysk-core/frysk/hpd/TestAuxvCommand.java index 3b566b7..8434d36 100644 --- a/frysk-core/frysk/hpd/TestAuxvCommand.java +++ b/frysk-core/frysk/hpd/TestAuxvCommand.java @@ -75,7 +75,7 @@ public class TestAuxvCommand extends TestLib { e.send("core " + core.getPath() + " -noexe\n"); e.expect("Attached to core file.*"); - e.send("auxv\n"); + e.send("info auxv\n"); Iterator i = buildAuxv.auxvData.iterator(); while (i.hasNext()) e.equals((String)i.next()); diff --git a/frysk-core/frysk/hpd/TestHelp.java b/frysk-core/frysk/hpd/TestHelp.java index fd34afe..cb9414d 100644 --- a/frysk-core/frysk/hpd/TestHelp.java +++ b/frysk-core/frysk/hpd/TestHelp.java @@ -56,7 +56,6 @@ public class TestHelp "attach", "break", "core", - "debuginfo", "defset", "delete", "detach", @@ -72,6 +71,7 @@ public class TestHelp "go", "halt", "help", + "info", "list", "load", "next", diff --git a/frysk-core/frysk/hpd/TestMapsCommand.java b/frysk-core/frysk/hpd/TestMapsCommand.java index 51380af..3ac9e70 100644 --- a/frysk-core/frysk/hpd/TestMapsCommand.java +++ b/frysk-core/frysk/hpd/TestMapsCommand.java @@ -52,7 +52,7 @@ public class TestMapsCommand extends TestLib { e = new HpdTestbed(); e.send("attach " + proc.getPid() +"\n"); - e.send("maps\n"); + e.send("info maps\n"); for (int i=0; i< liveMaps.length; i++) e.equals(liveMaps[i].toString()); e.close(); diff --git a/frysk-core/frysk/hpd/TestRegs.java b/frysk-core/frysk/hpd/TestRegs.java index c3e90c2..46add1d 100644 --- a/frysk-core/frysk/hpd/TestRegs.java +++ b/frysk-core/frysk/hpd/TestRegs.java @@ -51,20 +51,23 @@ public class TestRegs extends TestLib { File exe = Config.getPkgLibFile("hpd-c"); ISA isa = ElfMap.getISA(exe); + String[] commandSet = {"regs\n", "info regs\n"}; // Regs - e.send("regs\n"); - - // Match the first register (with two values) and the last - // register. - if (isa == ISA.IA32) - e.expectPrompt("eax:\t[0-9][^\t]*\t0x.*esp:.*"); - else if (isa == ISA.X8664) - e.expectPrompt("rax:\t[0-9][^\t]*\t0x.*rip:.*"); - else - fail("Architecture " + isa + " unhandled"); + for (int i=0; i < commandSet.length; i++) { + e.send(commandSet[i]); + + // Match the first register (with two values) and the last + // register. + if (isa == ISA.IA32) + e.expectPrompt("eax:\t[0-9][^\t]*\t0x.*esp:.*"); + else if (isa == ISA.X8664) + e.expectPrompt("rax:\t[0-9][^\t]*\t0x.*rip:.*"); + else + fail("Architecture " + isa + " unhandled"); + } e.close(); } - + public void testRegsBlah() { e = HpdTestbed.attachXXX("hpd-c"); e.sendCommandExpectPrompt("regs blah", diff --git a/frysk-core/frysk/hpd/TopLevelCommand.java b/frysk-core/frysk/hpd/TopLevelCommand.java index f85e691..009ec4c 100644 --- a/frysk-core/frysk/hpd/TopLevelCommand.java +++ b/frysk-core/frysk/hpd/TopLevelCommand.java @@ -80,12 +80,10 @@ public class TopLevelCommand extends MultiLevelCommand { add(new AliasCommands.Alias(), "alias"); add(new AliasCommands.Unalias(), "unalias"); add(new AttachCommand(), "attach"); - add(new AuxvCommand(), "auxv"); add(new BreakpointCommand(), "b|reak"); add(new CoreCommand(), "core"); add(new DbgVariableCommands.Set(), "set"); add(new DbgVariableCommands.Unset(), "unset"); - add(new DebuginfoCommand(), "debuginfo"); add(new DetachCommand(), "detach"); add(new DisassembleCommand(), "disassemble"); add(new DisplayCommand(), "display"); @@ -95,10 +93,10 @@ public class TopLevelCommand extends MultiLevelCommand { add(new GoCommand(), "g|o"); add(new HaltCommand(), "h|alt"); add(new Help(), "help"); + add(new InfoCommand(), "info"); add(new KillCommand(), "k|ill"); add(new ListCommand(), "l|ist"); add(new LoadCommand(), "load"); - add(new MapsCommand(), "maps"); add(new PeekCommand(), "peek"); Command quit = new QuitCommand(); add(quit, "exit"); hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2007-12-20 10:43 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=20071220104355.17679.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).