public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix cache check for live maps. Maps change all the time. Date: Mon, 14 Jan 2008 14:34:00 -0000 [thread overview] Message-ID: <20080114143452.25025.qmail@sourceware.org> (raw) 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
reply other threads:[~2008-01-14 14:34 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=20080114143452.25025.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).