[SCM] master: maps/auxv null data checks and handling.

pmuldoon@sourceware.org pmuldoon@sourceware.org
Thu Dec 13 11:58:00 GMT 2007


The branch, master has been updated
       via  e6384876e3801336d0ae446a434c6ca1c0949d8d (commit)
      from  6e336c8e877a60dc82d621ae7f06f0c8dcb01099 (commit)

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

- Log -----------------------------------------------------------------
commit e6384876e3801336d0ae446a434c6ca1c0949d8d
Author: Phil Muldoon <pmuldoon@redhat.com>
Date:   Thu Dec 13 11:57:34 2007 +0000

    maps/auxv null data checks and handling.
    
    2007-12-13  Phil Muldoon  <pmuldoon@redhat.com>
    
            * AuxvCommand.java (interpret): Check for null auxv data.
            * MapsCommand.java (interpret): Check for null maps data.

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

Summary of changes:
 frysk-core/frysk/hpd/AuxvCommand.java |   11 ++++++++---
 frysk-core/frysk/hpd/ChangeLog        |    5 +++++
 frysk-core/frysk/hpd/MapsCommand.java |   12 ++++++++----
 3 files changed, 21 insertions(+), 7 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/AuxvCommand.java b/frysk-core/frysk/hpd/AuxvCommand.java
index 33b6554..5f59145 100644
--- a/frysk-core/frysk/hpd/AuxvCommand.java
+++ b/frysk-core/frysk/hpd/AuxvCommand.java
@@ -65,14 +65,19 @@ public class AuxvCommand extends ParameterizedCommand {
   void interpret(CLI cli, Input cmd, Object options) {
     PTSet ptset = cli.getCommandPTSet(cmd);
     Iterator taskDataIterator = ptset.getTaskData();
-    if (taskDataIterator.hasNext() == false)
-    {
+    if (taskDataIterator.hasNext() == false) {
       cli.addMessage("Cannot find main task. Cannot print out auxv", Message.TYPE_ERROR);
       return;
     }
     Proc mainProc = ((TaskData) taskDataIterator.next()).getTask().getProc();
     Auxv[] liveAux = mainProc.getAuxv();
-    
+
+    if (liveAux == null) {
+	cli.addMessage("No Auxv data to print for this process",
+		       Message.TYPE_WARNING);
+	
+	return;
+    }
     class BuildAuxv extends AuxvStringBuilder {
       
       public StringBuffer auxvData = new StringBuffer();
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 4313944..eca9cb0 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-13  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* AuxvCommand.java (interpret): Check for null auxv data.
+	* MapsCommand.java (interpret): Check for null maps data.
+
 2007-12-12  Rick Moseley  <rmoseley@redhat.com>
 
 	* TestHpdTestHarness.java: New for testing bz #5480.
diff --git a/frysk-core/frysk/hpd/MapsCommand.java b/frysk-core/frysk/hpd/MapsCommand.java
index 1c1b212..278c9dc 100644
--- a/frysk-core/frysk/hpd/MapsCommand.java
+++ b/frysk-core/frysk/hpd/MapsCommand.java
@@ -57,14 +57,18 @@ public class MapsCommand extends ParameterizedCommand {
   void interpret(CLI cli, Input cmd, Object options) {
     PTSet ptset = cli.getCommandPTSet(cmd);
     Iterator taskDataIterator = ptset.getTaskData();
-    if (taskDataIterator.hasNext() == false)
-    {
+    if (taskDataIterator.hasNext() == false)  {
       cli.addMessage("Cannot find main task. Cannot print out process maps.", Message.TYPE_ERROR);
       return;
     }
     Proc mainProc = ((TaskData) taskDataIterator.next()).getTask().getProc();
     MemoryMap[] maps = mainProc.getMaps();
-    
+
+    if (maps == null) {
+	cli.addMessage("No maps data to print for this process", 
+		       Message.TYPE_WARNING);
+	return;
+    }
     for (int i=0; i<maps.length; i++)
     	cli.outWriter.println(maps[i].toString());
   }
@@ -73,4 +77,4 @@ public class MapsCommand extends ParameterizedCommand {
     return -1;
   }
   
-}
\ No newline at end of file
+}


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



More information about the Frysk-cvs mailing list