test - Do not report bogus object pointer in vmpageinfo
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 27 Dec 2011 22:18:34 +0000 (14:18 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 27 Dec 2011 22:18:34 +0000 (14:18 -0800)
* If m.object is NULL do not report the previously loaded object's
  data in the output.

test/debug/vmpageinfo.c

index cbebb0d..9215b01 100644 (file)
@@ -182,28 +182,32 @@ main(int ac, char **av)
                m.busy,
                qstr
            );
-           switch(obj.type) {
-           case OBJT_DEFAULT:
-               ostr = "default";
-               break;
-           case OBJT_SWAP:
-               ostr = "swap";
-               break;
-           case OBJT_VNODE:
-               ostr = "vnode";
-               break;
-           case OBJT_DEVICE:
-               ostr = "device";
-               break;
-           case OBJT_PHYS:
-               ostr = "phys";
-               break;
-           case OBJT_DEAD:
-               ostr = "dead";
-               break;
-           default:
-               ostr = "unknown";
-               break;
+           if (m.object) {
+               switch(obj.type) {
+               case OBJT_DEFAULT:
+                   ostr = "default";
+                   break;
+               case OBJT_SWAP:
+                   ostr = "swap";
+                   break;
+               case OBJT_VNODE:
+                   ostr = "vnode";
+                   break;
+               case OBJT_DEVICE:
+                   ostr = "device";
+                   break;
+               case OBJT_PHYS:
+                   ostr = "phys";
+                   break;
+               case OBJT_DEAD:
+                   ostr = "dead";
+                   break;
+               default:
+                   ostr = "unknown";
+                   break;
+               }
+           } else {
+               ostr = "-";
            }
            printf(" %-7s", ostr);
            if (m.flags & PG_BUSY)