Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 10943)
+++ trunk/ippTools/src/chiptool.c	(revision 11002)
@@ -33,4 +33,5 @@
 static bool pendingimfileMode(pxConfig *config);
 static bool addprocessedimfileMode(pxConfig *config);
+static bool faultimfileMode(pxConfig *config);
 static bool blockMode(pxConfig *config);
 static bool maskedMode(pxConfig *config);
@@ -58,4 +59,5 @@
         MODECASE(P2TOOL_MODE_PENDINGIMFILE,         pendingimfileMode);
         MODECASE(P2TOOL_MODE_ADDPROCESSEDIMFILE,    addprocessedimfileMode);
+        MODECASE(P2TOOL_MODE_FAULTIMFILE,           faultimfileMode);
         MODECASE(P2TOOL_MODE_BLOCK,                 blockMode);
         MODECASE(P2TOOL_MODE_MASKED,                maskedMode);
@@ -174,4 +176,17 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
+    bool status = false;
+    psU64 limit = psMetadataLookupU64(&status, config->args, "-limit");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -limit");
+        return false;
+    }
+
+    bool faulted = psMetadataLookupU64(&status, config->args, "-faulted");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -faulted");
+        return false;
+    }
+
     // XXX does this need to be constrained so that it won't return any results
     // if a match p2PendingExp hasn't been registered?
@@ -197,4 +212,19 @@
     }
 
+    if (faulted) {
+        // list only faulted rows
+        psStringAppend(&query, " %s", "AND p2PendingImfile.fault != 0");
+    } else {
+        // don't list faulted rows
+        psStringAppend(&query, " %s", "AND p2PendingImfile.fault = 0");
+    }
+
+    // treat limit == 0 as "no limit"
+    if (limit) {
+        psString limitString = psDBGenerateLimitSQL(limit);
+        psStringAppend(&query, " %s", limitString);
+        psFree(limitString);
+    }
+
     if (!p_psDBRunQuery(config->dbh, query)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -401,4 +431,25 @@
     return true;
 }
+
+
+static bool faultimfileMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    bool status = false;
+    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
+        return false;
+    }
+
+    if (!pxSetFaultCode(config->dbh, "p2PendingImfile", config->where, code)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
+        return false;
+    }
+
+    return true;
+}
+
 
 static bool blockMode(pxConfig *config)
