From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4306 invoked by alias); 13 Feb 2008 20:53:51 -0000 Received: (qmail 4265 invoked by uid 367); 13 Feb 2008 20:53:48 -0000 Date: Wed, 13 Feb 2008 20:53:00 -0000 Message-ID: <20080213205348.4249.qmail@sourceware.org> From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Use ProcessIdentifier in Exe. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 99f1d55715d6b214ecd85e759fdcfa557149156f X-Git-Newrev: aabf0c3969be42e6a4ac995ff36d9d168ee6f54a 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: 2008-q1/txt/msg00208.txt.bz2 The branch, master has been updated via aabf0c3969be42e6a4ac995ff36d9d168ee6f54a (commit) via bed66b8a66b32132212d1be39aebc3acbc6e7bf8 (commit) via 0e7f090638a92cab27d0dbf7a31e44c915b54155 (commit) from 99f1d55715d6b214ecd85e759fdcfa557149156f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit aabf0c3969be42e6a4ac995ff36d9d168ee6f54a Author: Andrew Cagney Date: Wed Feb 13 15:53:27 2008 -0500 Use ProcessIdentifier in Exe. frysk-core/frysk/bindir/ChangeLog 2008-02-13 Andrew Cagney * fexe.java: Update to match Exe. frysk-core/frysk/proc/live/ChangeLog 2008-02-13 Andrew Cagney * LinuxPtraceProc.java: Update to match Exe. frysk-sys/frysk/sys/proc/ChangeLog 2008-02-13 Andrew Cagney * Exe.java (get(ProcessIdentifier)): New. (get(int)): Make private. commit bed66b8a66b32132212d1be39aebc3acbc6e7bf8 Author: Andrew Cagney Date: Wed Feb 13 15:44:04 2008 -0500 Use ProcessIdentifier in CmdLineBuilder. frysk-core/frysk/isa/corefiles/ChangeLog 2008-02-13 Andrew Cagney * IA32LinuxElfCorefile.java: Update to match CmdLineBuilder. * X8664LinuxElfCorefile.java: Ditto. * PPC64LinuxElfCorefile.java: Ditto. * PPC32LinuxElfCorefile.java: Ditto. frysk-core/frysk/proc/live/ChangeLog 2008-02-13 Andrew Cagney * LinuxPtraceProc.java: Update to match CmdLineBuilder. frysk-sys/frysk/sys/proc/ChangeLog 2008-02-13 Andrew Cagney * CmdLineBuilder.java (construct(ProcessIdentifier)): New. (construct(int)): Make private. commit 0e7f090638a92cab27d0dbf7a31e44c915b54155 Author: Andrew Cagney Date: Wed Feb 13 15:25:50 2008 -0500 Use ProcessIdentifier in AuxvBuilder. frysk-core/frysk/isa/corefiles/ChangeLog 2008-02-13 Andrew Cagney * IA32LinuxElfCorefile.java: Update to match AuxvBuilder. * PPC32LinuxElfCorefile.java: Ditto. * PPC64LinuxElfCorefile.java: Ditto. * X8664LinuxElfCorefile.java: Ditto. frysk-core/frysk/proc/live/ChangeLog 2008-02-13 Andrew Cagney * LinuxPtraceProc.java: Update to match AuxvBuilder. frysk-core/prog/ChangeLog 2008-02-13 Andrew Cagney * util/auxv.java: Delete. frysk-sys/frysk/sys/proc/ChangeLog 2008-02-13 Andrew Cagney * AuxvBuilder.java (construct(int)): Make private. (construct(ProcessIdentifier)): New. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 4 + frysk-core/frysk/bindir/fexe.java | 8 ++- frysk-core/frysk/isa/corefiles/ChangeLog | 12 +++ .../frysk/isa/corefiles/IA32LinuxElfCorefile.java | 10 +- .../frysk/isa/corefiles/PPC32LinuxElfCorefile.java | 10 ++- .../frysk/isa/corefiles/PPC64LinuxElfCorefile.java | 11 ++- .../frysk/isa/corefiles/X8664LinuxElfCorefile.java | 9 +- frysk-core/frysk/proc/live/ChangeLog | 6 ++ frysk-core/frysk/proc/live/LinuxPtraceProc.java | 10 ++- frysk-core/prog/ChangeLog | 4 + frysk-core/prog/util/auxv.java | 80 -------------------- frysk-sys/frysk/sys/proc/AuxvBuilder.java | 18 +++-- frysk-sys/frysk/sys/proc/ChangeLog | 11 +++ frysk-sys/frysk/sys/proc/CmdLineBuilder.java | 15 ++-- frysk-sys/frysk/sys/proc/Exe.java | 12 ++- frysk-sys/frysk/sys/proc/cni/AuxvBuilder.cxx | 2 +- 16 files changed, 101 insertions(+), 121 deletions(-) delete mode 100644 frysk-core/prog/util/auxv.java First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index 7bf2104..4167d36 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,3 +1,7 @@ +2008-02-13 Andrew Cagney + + * fexe.java: Update to match Exe. + 2008-02-11 Petr Machata * ftrace.java: Support -stack. diff --git a/frysk-core/frysk/bindir/fexe.java b/frysk-core/frysk/bindir/fexe.java index 3abbf47..10c544d 100644 --- a/frysk-core/frysk/bindir/fexe.java +++ b/frysk-core/frysk/bindir/fexe.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2007, Red Hat Inc. +// Copyright 2007, 2008, Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -39,6 +39,8 @@ package frysk.bindir; +import frysk.sys.ProcessIdentifier; +import frysk.sys.ProcessIdentifierFactory; import frysk.util.CommandlineParser; import frysk.util.Util; import frysk.proc.Proc; @@ -76,12 +78,14 @@ public class fexe { for (int i= 0; i< pids.length; i++) { ProcId id = pids[i]; Proc proc = Util.getProcFromPid(id); + ProcessIdentifier pid + = ProcessIdentifierFactory.create(id.hashCode()); if (verbose) { System.out.println(id.hashCode() + " " + proc.getExe() + " " - + Exe.get(id.hashCode())); + + Exe.get(pid)); } else { System.out.println(proc.getExe()); } diff --git a/frysk-core/frysk/isa/corefiles/ChangeLog b/frysk-core/frysk/isa/corefiles/ChangeLog index c3dffd7..1689d3e 100644 --- a/frysk-core/frysk/isa/corefiles/ChangeLog +++ b/frysk-core/frysk/isa/corefiles/ChangeLog @@ -1,3 +1,15 @@ +2008-02-13 Andrew Cagney + + * IA32LinuxElfCorefile.java: Update to match CmdLineBuilder. + * X8664LinuxElfCorefile.java: Ditto. + * PPC64LinuxElfCorefile.java: Ditto. + * PPC32LinuxElfCorefile.java: Ditto. + + * IA32LinuxElfCorefile.java: Update to match AuxvBuilder. + * PPC32LinuxElfCorefile.java: Ditto. + * PPC64LinuxElfCorefile.java: Ditto. + * X8664LinuxElfCorefile.java: Ditto. + 2008-02-08 Andrew Cagney * IA32LinuxElfCorefile.java: Update to match Stat.ppid.` diff --git a/frysk-core/frysk/isa/corefiles/IA32LinuxElfCorefile.java b/frysk-core/frysk/isa/corefiles/IA32LinuxElfCorefile.java index adfabf5..0c59815 100644 --- a/frysk-core/frysk/isa/corefiles/IA32LinuxElfCorefile.java +++ b/frysk-core/frysk/isa/corefiles/IA32LinuxElfCorefile.java @@ -39,10 +39,10 @@ package frysk.isa.corefiles; +import frysk.sys.ProcessIdentifier; +import frysk.sys.ProcessIdentifierFactory; import inua.eio.ArrayByteBuffer; - import java.util.Iterator; - import lib.dwfl.ElfEHeader; import lib.dwfl.ElfEMachine; import lib.dwfl.ElfNhdr; @@ -63,7 +63,6 @@ import frysk.sys.proc.CmdLineBuilder; import frysk.sys.proc.Stat; import frysk.sys.proc.Status; - /** * LinuxElfCorefilex86. Extends LinuxCorefile. Fill in * specific x86 information for corefiles. @@ -153,7 +152,7 @@ public class IA32LinuxElfCorefile extends LinuxElfCorefile { } } BuildCmdLine cmdLine = new BuildCmdLine(); - cmdLine.construct(pid); + cmdLine.construct(ProcessIdentifierFactory.create(pid)); // Set it prpsInfo.setPrPsargs(cmdLine.prettyArgs); @@ -313,7 +312,8 @@ public class IA32LinuxElfCorefile extends LinuxElfCorefile { public void buildAuxiliary(int index, int type, long val) { } }; - builder.construct(proc.getPid()); + ProcessIdentifier pid = ProcessIdentifierFactory.create(proc.getPid()); + builder.construct(pid); nhdrEntry.setNhdrDesc(ElfNhdrType.NT_AUXV, prAuxv); } diff --git a/frysk-core/frysk/isa/corefiles/PPC32LinuxElfCorefile.java b/frysk-core/frysk/isa/corefiles/PPC32LinuxElfCorefile.java index b74f848..c8ac77b 100644 --- a/frysk-core/frysk/isa/corefiles/PPC32LinuxElfCorefile.java +++ b/frysk-core/frysk/isa/corefiles/PPC32LinuxElfCorefile.java @@ -1,7 +1,7 @@ // This file is part of the program FRYSK. // // Copyright 2006, 2007, IBM Corp. -// Copyright 2007, Red Hat Inc. +// Copyright 2007, 2008, Red Hat Inc. // // Contributed by // Jose Flavio Aguilar Paulino (joseflavio@gmail.com) @@ -43,8 +43,9 @@ package frysk.isa.corefiles; +import frysk.sys.ProcessIdentifier; +import frysk.sys.ProcessIdentifierFactory; import java.util.Iterator; - import inua.eio.ArrayByteBuffer; import inua.eio.ByteBuffer; import lib.dwfl.ElfEHeader; @@ -156,7 +157,7 @@ public class PPC32LinuxElfCorefile extends LinuxElfCorefile { } } BuildCmdLine cmdLine = new BuildCmdLine(); - cmdLine.construct(pid); + cmdLine.construct(ProcessIdentifierFactory.create(pid)); // Set it prpsInfo.setPrPsargs(cmdLine.prettyArgs); @@ -312,7 +313,8 @@ public class PPC32LinuxElfCorefile extends LinuxElfCorefile { public void buildAuxiliary(int index, int type, long val) { } }; - builder.construct(proc.getPid()); + ProcessIdentifier pid = ProcessIdentifierFactory.create(proc.getPid()); + builder.construct(pid); nhdrEntry.setNhdrDesc(ElfNhdrType.NT_AUXV, prAuxv); } diff --git a/frysk-core/frysk/isa/corefiles/PPC64LinuxElfCorefile.java b/frysk-core/frysk/isa/corefiles/PPC64LinuxElfCorefile.java index b3c43ba..4c5eb7e 100644 --- a/frysk-core/frysk/isa/corefiles/PPC64LinuxElfCorefile.java +++ b/frysk-core/frysk/isa/corefiles/PPC64LinuxElfCorefile.java @@ -1,7 +1,7 @@ // This file is part of the program FRYSK. // // Copyright 2006, 2007, IBM Corp. -// Copyright 2007, Red Hat Inc. +// Copyright 2007, 2008, Red Hat Inc. // // Contributed by // Jose Flavio Aguilar Paulino (joseflavio@gmail.com) @@ -43,10 +43,10 @@ package frysk.isa.corefiles; +import frysk.sys.ProcessIdentifier; +import frysk.sys.ProcessIdentifierFactory; import inua.eio.ArrayByteBuffer; - import java.util.Iterator; - import lib.dwfl.ElfEHeader; import lib.dwfl.ElfEMachine; import lib.dwfl.ElfNhdr; @@ -156,7 +156,7 @@ public class PPC64LinuxElfCorefile extends LinuxElfCorefile { } } BuildCmdLine cmdLine = new BuildCmdLine(); - cmdLine.construct(pid); + cmdLine.construct(ProcessIdentifierFactory.create(pid)); // Set it prpsInfo.setPrPsargs(cmdLine.prettyArgs); @@ -304,7 +304,8 @@ public class PPC64LinuxElfCorefile extends LinuxElfCorefile { public void buildAuxiliary(int index, int type, long val) { } }; - builder.construct(proc.getPid()); + ProcessIdentifier pid = ProcessIdentifierFactory.create(proc.getPid()); + builder.construct(pid); nhdrEntry.setNhdrDesc(ElfNhdrType.NT_AUXV, prAuxv); } diff --git a/frysk-core/frysk/isa/corefiles/X8664LinuxElfCorefile.java b/frysk-core/frysk/isa/corefiles/X8664LinuxElfCorefile.java index 94b8cce..3200ec9 100644 --- a/frysk-core/frysk/isa/corefiles/X8664LinuxElfCorefile.java +++ b/frysk-core/frysk/isa/corefiles/X8664LinuxElfCorefile.java @@ -39,10 +39,10 @@ package frysk.isa.corefiles; +import frysk.sys.ProcessIdentifier; +import frysk.sys.ProcessIdentifierFactory; import inua.eio.ArrayByteBuffer; - import java.util.Iterator; - import lib.dwfl.ElfEHeader; import lib.dwfl.ElfEMachine; import lib.dwfl.ElfNhdr; @@ -152,7 +152,7 @@ public class X8664LinuxElfCorefile extends LinuxElfCorefile { } } BuildCmdLine cmdLine = new BuildCmdLine(); - cmdLine.construct(pid); + cmdLine.construct(ProcessIdentifierFactory.create(pid)); // Set it prpsInfo.setPrPsargs(cmdLine.prettyArgs); @@ -299,7 +299,8 @@ public class X8664LinuxElfCorefile extends LinuxElfCorefile { public void buildAuxiliary(int index, int type, long val) { } }; - builder.construct(proc.getPid()); + ProcessIdentifier pid = ProcessIdentifierFactory.create(proc.getPid()); + builder.construct(pid); nhdrEntry.setNhdrDesc(ElfNhdrType.NT_AUXV, prAuxv); } diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog index fc67d84..4445f71 100644 --- a/frysk-core/frysk/proc/live/ChangeLog +++ b/frysk-core/frysk/proc/live/ChangeLog @@ -1,5 +1,11 @@ 2008-02-13 Andrew Cagney + * LinuxPtraceProc.java: Update to match Exe. + + * LinuxPtraceProc.java: Update to match CmdLineBuilder. + + * LinuxPtraceProc.java: Update to match AuxvBuilder. + * LinuxPtraceTask.java (tid): Make package private. * LinuxPtraceTaskState.java: Update to match frysk.sys.Signal. * TestProcStopped.java: Ditto. diff --git a/frysk-core/frysk/proc/live/LinuxPtraceProc.java b/frysk-core/frysk/proc/live/LinuxPtraceProc.java index 1147982..a616729 100644 --- a/frysk-core/frysk/proc/live/LinuxPtraceProc.java +++ b/frysk-core/frysk/proc/live/LinuxPtraceProc.java @@ -109,7 +109,9 @@ public class LinuxPtraceProc extends LiveProc { } } BuildAuxv auxv = new BuildAuxv (); - auxv.construct (getPid ()); + ProcessIdentifier pid + = ProcessIdentifierFactory.create(getPid()); + auxv.construct(pid); this.auxv = auxv.vec; } return auxv; @@ -167,7 +169,7 @@ public class LinuxPtraceProc extends LiveProc { } } BuildCmdLine cmdLine = new BuildCmdLine (); - cmdLine.construct (getPid ()); + cmdLine.construct(ProcessIdentifierFactory.create(getPid())); this.cmdLine = cmdLine.argv; } return cmdLine; @@ -190,7 +192,9 @@ public class LinuxPtraceProc extends LiveProc { private String exe; public String getExe() { if (exe == null) { - String exe = Exe.get(getPid()); + ProcessIdentifier pid + = ProcessIdentifierFactory.create(getPid()); + String exe = Exe.get(pid); // Linux's /proc/$$/exe can get screwed up in several // ways. Detect each here and return null. if (exe.endsWith(" (deleted)")) diff --git a/frysk-core/prog/ChangeLog b/frysk-core/prog/ChangeLog index 6be6ee6..79fc1fd 100644 --- a/frysk-core/prog/ChangeLog +++ b/frysk-core/prog/ChangeLog @@ -1,3 +1,7 @@ +2008-02-13 Andrew Cagney + + * util/auxv.java: Delete. + 2006-12-11 Andrew Cagney * util/.cvsignore: Delete. diff --git a/frysk-core/prog/util/auxv.java b/frysk-core/prog/util/auxv.java deleted file mode 100644 index 390cddb..0000000 --- a/frysk-core/prog/util/auxv.java +++ /dev/null @@ -1,80 +0,0 @@ -// This file is part of the program FRYSK. -// -// Copyright 2005, Red Hat Inc. -// -// FRYSK is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// FRYSK is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with FRYSK; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Red Hat, Inc. gives You the -// additional right to link the code of FRYSK with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of FRYSK through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Red Hat, Inc. may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the FRYSK code and other code -// used in conjunction with FRYSK except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. - -/** - * Print the auxilary vector. - */ - -package prog.util; - -import inua.util.PrintWriter; -import frysk.proc.Auxv; -import frysk.sys.proc.AuxvBuilder; - -class auxv -{ - public static void main (String[] args) - { - final PrintWriter out = new PrintWriter (System.out, true); - - if (args.length != 1) { - out.println ("Usage: auxv "); - return; - } - - AuxvBuilder builder = new AuxvBuilder () - { - public void buildBuffer (byte[] auxv) - { - // Toss. - } - public void buildDimensions (int wordSize, boolean bigEndian, - int length) - { - // Toss. - } - public void buildAuxiliary (int index, int type, - long val) - { - new Auxv (type, val).print (out); - } - }; - builder.construct (Integer.parseInt (args[0])); - } -} diff --git a/frysk-sys/frysk/sys/proc/AuxvBuilder.java b/frysk-sys/frysk/sys/proc/AuxvBuilder.java index 41e78f1..4ab0941 100644 --- a/frysk-sys/frysk/sys/proc/AuxvBuilder.java +++ b/frysk-sys/frysk/sys/proc/AuxvBuilder.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2005, Red Hat Inc. +// Copyright 2005, 2008, Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -39,26 +39,30 @@ package frysk.sys.proc; +import frysk.sys.ProcessIdentifier; + /** * The build an auxiliary vector using the contents of the file * /proc/PID/auxv. * * While this isn't a pure builder pattern, it is close enough. */ -public abstract class AuxvBuilder -{ + +public abstract class AuxvBuilder { /** * Create a AuxvBuilder; can only extend. */ - protected AuxvBuilder () - { + protected AuxvBuilder() { } /** * Scan the auxiliary vector found in /proc/PID/auxv * building up an auxv. */ - public final native boolean construct (int pid); + public boolean construct(ProcessIdentifier pid) { + return construct(pid.intValue()); + } + private native boolean construct (int pid); /** * Scan the auxiliary vector found in the AUXV byte array. Calls @@ -68,7 +72,7 @@ public abstract class AuxvBuilder /** * Called with the raw byte buffer slurped by {@link - * #construct(int)}. + * #construct(ProcessIdentifier)}. */ public abstract void buildBuffer (byte[] auxv); diff --git a/frysk-sys/frysk/sys/proc/ChangeLog b/frysk-sys/frysk/sys/proc/ChangeLog index f5770b0..5c96fbb 100644 --- a/frysk-sys/frysk/sys/proc/ChangeLog +++ b/frysk-sys/frysk/sys/proc/ChangeLog @@ -1,3 +1,14 @@ +2008-02-13 Andrew Cagney + + * Exe.java (get(ProcessIdentifier)): New. + (get(int)): Make private. + + * CmdLineBuilder.java (construct(ProcessIdentifier)): New. + (construct(int)): Make private. + + * AuxvBuilder.java (construct(int)): Make private. + (construct(ProcessIdentifier)): New. + 2008-02-08 Andrew Cagney * ProcBuilder.java (build(ProcessIdentifier)): Replace diff --git a/frysk-sys/frysk/sys/proc/CmdLineBuilder.java b/frysk-sys/frysk/sys/proc/CmdLineBuilder.java index 2a36e3a..61a9a7a 100644 --- a/frysk-sys/frysk/sys/proc/CmdLineBuilder.java +++ b/frysk-sys/frysk/sys/proc/CmdLineBuilder.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2006, Red Hat Inc. +// Copyright 2006, 2008, Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -39,26 +39,29 @@ package frysk.sys.proc; +import frysk.sys.ProcessIdentifier; + /** * The build the command line argument list from the contents of the * file /proc/PID/cmdline. * * While this isn't a pure builder pattern, it is close enough. */ -public abstract class CmdLineBuilder -{ +public abstract class CmdLineBuilder { /** * Create a CmdLineBuilder; can only extend. */ - protected CmdLineBuilder () - { + protected CmdLineBuilder() { } /** * Scan the maps file found in /proc/PID/cmdline building * up the command line. Return true if the scan was successful. hooks/post-receive -- frysk system monitor/debugger