From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15345 invoked by alias); 11 Dec 2007 10:09:41 -0000 Received: (qmail 15300 invoked by uid 9514); 11 Dec 2007 10:09:34 -0000 Date: Tue, 11 Dec 2007 10:09:00 -0000 Message-ID: <20071211100934.15285.qmail@sourceware.org> From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Add fauxv command. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 14f35178d5566764b7d964bdddd18b5f2287a58b X-Git-Newrev: 5f078697788883be959202a9643d29430587e182 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2007-q4/txt/msg00561.txt.bz2 The branch, master has been updated via 5f078697788883be959202a9643d29430587e182 (commit) from 14f35178d5566764b7d964bdddd18b5f2287a58b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 5f078697788883be959202a9643d29430587e182 Author: Phil Muldoon Date: Tue Dec 11 10:09:26 2007 +0000 Add fauxv command. 2007-12-11 Phil Muldoon * faux.java: New. * TestFauxv.java: New. * faux.xml: New. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 7 +++ .../bindir/{TestFmaps.java => TestFauxv.java} | 53 +++++++++++--------- frysk-core/frysk/bindir/{fmaps.java => fauxv.java} | 30 ++++++++--- frysk-core/frysk/bindir/{fmaps.xml => fauxv.xml} | 14 +++--- 4 files changed, 65 insertions(+), 39 deletions(-) copy frysk-core/frysk/bindir/{TestFmaps.java => TestFauxv.java} (64%) copy frysk-core/frysk/bindir/{fmaps.java => fauxv.java} (81%) copy frysk-core/frysk/bindir/{fmaps.xml => fauxv.xml} (93%) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index 63c0dd4..3dae751 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,3 +1,10 @@ +2007-12-11 Phil Muldoon + + + * faux.java: New. + * TestFauxv.java: New. + * faux.xml: New. + 2007-12-10 Phil Muldoon * fmaps.java: Indent. diff --git a/frysk-core/frysk/bindir/TestFmaps.java b/frysk-core/frysk/bindir/TestFauxv.java similarity index 64% copy from frysk-core/frysk/bindir/TestFmaps.java copy to frysk-core/frysk/bindir/TestFauxv.java index 66705be..060361a 100644 --- a/frysk-core/frysk/bindir/TestFmaps.java +++ b/frysk-core/frysk/bindir/TestFauxv.java @@ -44,38 +44,45 @@ import frysk.expunit.Expect; import frysk.Config; import java.io.File; import frysk.testbed.TearDownExpect; -import frysk.testbed.CoreFileAtSignal; -public class TestFmaps - extends TestCase +public class TestFauxv + extends TestCase { - - /** - * Start fmaps with both a core file and an executable; avoids - * 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]; + + private Expect fauxv(File coreFile) { + String[] argv = new String[2]; int argc = 0; - argv[argc++] = Config.getBinFile("fmaps").getAbsolutePath(); + argv[argc++] = Config.getBinFile("fauxv").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); + System.out.println(argv[0]+" " +argv[1]); 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"); + // Basic sniff test, are we getting output that looks like a auuv? + // getAuxv is tested in the frysk-core/proc namespace/ + public void testAuxvCore() { + Expect e = fauxv(Config.getPkgDataFile("test-core-x86")); + + e.expect("AT_SYSINFO \\(SYSINFO\\) : 6464512"); + e.expect("AT_SYSINFO_EHDR \\(SYSINFO EHDR\\) : 0x62a000"); + e.expect("AT_HWCAP \\(Machine dependent hints about\\) : 0xafe9f1bf"); + e.expect("AT_PAGESZ \\(System page size\\) : 4096"); + e.expect("AT_CLKTCK \\(Frequency of times\\(\\)\\) : 100"); + e.expect("AT_PHDR \\(Program headers for program\\) : 0x8048034"); + e.expect("AT_PHENT \\(Size of program header entry\\) : 32"); + e.expect("AT_PHNUM \\(Number of program headers\\) : 8"); + e.expect("AT_BASE \\(Base address of interpreter\\) : 0"); + e.expect("AT_FLAGS \\(Flags\\) : 0"); + e.expect("AT_ENTRY \\(Entry point of program\\) : 0x80483e0"); + e.expect("AT_UID \\(Real uid\\) : 500"); + e.expect("AT_EUID \\(Effective uid\\) : 500"); + e.expect("AT_GID \\(Real gid\\) : 500"); + e.expect("AT_EGID \\(Effective gid\\) : 500"); + e.expect("AT_0x17 \\(AT_0x17\\) : 0"); + e.expect("AT_PLATFORM \\(String identifying platform.\\) : 0xbfcfee4b"); + e.expect("AT_NULL \\(End of vector\\) : 0"); } } diff --git a/frysk-core/frysk/bindir/fmaps.java b/frysk-core/frysk/bindir/fauxv.java similarity index 81% copy from frysk-core/frysk/bindir/fmaps.java copy to frysk-core/frysk/bindir/fauxv.java index d9d80c9..8930bb0 100644 --- a/frysk-core/frysk/bindir/fmaps.java +++ b/frysk-core/frysk/bindir/fauxv.java @@ -41,18 +41,19 @@ package frysk.bindir; import frysk.util.CommandlineParser; import frysk.util.Util; +import frysk.util.AuxvStringBuilder; import frysk.proc.Proc; import frysk.proc.ProcId; -import frysk.proc.MemoryMap; +import frysk.proc.Auxv; import java.io.File; import frysk.util.CoreExePair; -public class fmaps { +public class fauxv { public static void main (String[] args) { // Parse command line. Check pid provided. - CommandlineParser parser = new CommandlineParser("fexe") { + CommandlineParser parser = new CommandlineParser("fauxv") { public void parseCores (CoreExePair[] corePairs) { for (int i = 0; i < corePairs.length; i++) { @@ -64,7 +65,7 @@ public class fmaps { proc = Util.getProcFromCoreFile(coreFile); else proc = Util.getProcFromCoreFile(coreFile, exeFile); - printMaps(proc.getMaps()); + printAuxv(proc.getAuxv()); } System.exit(0); @@ -74,20 +75,31 @@ public class fmaps { for (int i= 0; i< pids.length; i++) { ProcId id = pids[i]; Proc proc = Util.getProcFromPid(id); - printMaps(proc.getMaps()); + printAuxv(proc.getAuxv()); } System.exit(0); } - private void printMaps(MemoryMap[] maps) + private void printAuxv(Auxv[] auxv) { - for(int i=0; i || fmaps []"); + parser.setHeader("Usage: fauxv || fmaps []"); parser.parse(args); //If we got here, we didn't find a pid. diff --git a/frysk-core/frysk/bindir/fmaps.xml b/frysk-core/frysk/bindir/fauxv.xml similarity index 93% copy from frysk-core/frysk/bindir/fmaps.xml copy to frysk-core/frysk/bindir/fauxv.xml index ec08dad..54b5e6e 100644 --- a/frysk-core/frysk/bindir/fmaps.xml +++ b/frysk-core/frysk/bindir/fauxv.xml @@ -51,18 +51,18 @@ - fmaps + fauxv December 10 2007 - fmaps + fauxv 1 fmaps - Prints out a process or a corefile's maps. + Prints out a process or a corefile's auxv data. @@ -83,9 +83,9 @@ DESCRIPTION - fmaps Executes the frysk map dump utility. + fmaps Executes the frysk axuv dump utility. - fmaps is a utility that prints out a process or a corefile's maps. + fmaps is a utility that prints out a process or a corefile's auxv data. @@ -126,7 +126,7 @@ EXAMPLE - fcore pid [...] + fauxv pid [...]