public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Fix cache check for live maps. Maps change all the time.
@ 2008-01-14 14:34 pmuldoon
  0 siblings, 0 replies; only message in thread
From: pmuldoon @ 2008-01-14 14:34 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  e89a4ee2697f66d023e8cb11b8e069e5f0c1e2ee (commit)
      from  3711e3c9678398de190c012d3a0d28089d00e3d2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit e89a4ee2697f66d023e8cb11b8e069e5f0c1e2ee
Author: Phil Muldoon <pmuldoon@redhat.com>
Date:   Mon Jan 14 14:34:45 2008 +0000

    Fix cache check for live maps. Maps change all the time.
    
    2008-01-14  Phil Muldoon  <pmuldoon@redhat.com>
    
            * LinuxPtraceProc.java (getMaps): Remove if maps == null.
            Rewrite using better variable names.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/proc/live/ChangeLog            |    5 ++
 frysk-core/frysk/proc/live/LinuxPtraceProc.java |   64 ++++++++++++-----------
 2 files changed, 38 insertions(+), 31 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index ee234d3..3d07a50 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-14  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* LinuxPtraceProc.java (getMaps): Remove if maps == null.
+	Rewrite using better variable names.
+
 2008-01-11  Andrew Cagney  <cagney@redhat.com>
 
 	* TestTaskObserverCode.java: Move from
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceProc.java b/frysk-core/frysk/proc/live/LinuxPtraceProc.java
index 4c36cb8..032ca03 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceProc.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceProc.java
@@ -112,40 +112,42 @@ public class LinuxPtraceProc extends LiveProc {
     }
 
     private MemoryMap[] maps;
+
     public MemoryMap[] getMaps() {
-	if (maps == null) {
-	    class BuildMaps extends MapsBuilder {
-		ArrayList  maps = new ArrayList();
-		byte[] mapsLocal;
-		public void buildBuffer (byte[] maps) {
-		    mapsLocal = maps;
-		    maps[maps.length - 1] = 0;
-		}
-		public void buildMap (long addressLow, long addressHigh,
-				      boolean permRead, boolean permWrite,
-				      boolean permExecute, boolean shared,
-				      long offset, int devMajor, int devMinor,
-				      int inode, int pathnameOffset,
-				      int pathnameLength) {
-		    byte[] filename = new byte[pathnameLength];
-		    System.arraycopy(mapsLocal, pathnameOffset, filename, 0,
-				     pathnameLength);
-		    MemoryMap map = new MemoryMap(addressLow, addressHigh,
-						  permRead, permWrite,
-						  permExecute, shared, offset,
-						  devMajor, devMinor, inode,
-						  pathnameOffset,
-						  pathnameLength, new
-						  String(filename));
-		    maps.add(map);
-		}
+
+	class BuildMaps extends MapsBuilder {
+
+	    ArrayList mapsList = new ArrayList();
+	    byte[] mapsLocalArray;
+
+	    public void buildBuffer(byte[] mapsArray) {
+		mapsLocalArray = mapsArray;
+		mapsArray[mapsArray.length - 1] = 0;
+	    }
+
+	    public void buildMap(long addressLow, long addressHigh,
+		    boolean permRead, boolean permWrite, boolean permExecute,
+		    boolean shared, long offset, int devMajor, int devMinor,
+		    int inode, int pathnameOffset, int pathnameLength) {
+	
+		byte[] mapFilename = new byte[pathnameLength];
+		System.arraycopy(mapsLocalArray, pathnameOffset, mapFilename, 0,
+			pathnameLength);
+		
+		MemoryMap map = new MemoryMap(addressLow, addressHigh,
+			permRead, permWrite, permExecute, shared, offset,
+			devMajor, devMinor, inode, pathnameOffset,
+			pathnameLength, new String(mapFilename));
+		mapsList.add(map);
 	    }
-	    BuildMaps constructedMaps = new BuildMaps ();
-	    constructedMaps.construct(getPid ());
-	    MemoryMap arrayMaps[] = new MemoryMap[constructedMaps.maps.size()];
-	    constructedMaps.maps.toArray(arrayMaps);
-	    this.maps = arrayMaps;
 	}
+	
+	BuildMaps constructedMaps = new BuildMaps();
+	constructedMaps.construct(getPid());
+	MemoryMap arrayMaps[] = new MemoryMap[constructedMaps.mapsList.size()];
+	constructedMaps.mapsList.toArray(arrayMaps);
+	this.maps = arrayMaps;
+
 	return maps;
     }
 


hooks/post-receive
--
frysk system monitor/debugger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-14 14:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-14 14:34 [SCM] master: Fix cache check for live maps. Maps change all the time pmuldoon

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).