Index: /trunk/include/iprt/cpp/xml.h
===================================================================
--- /trunk/include/iprt/cpp/xml.h	(revision 27417)
+++ /trunk/include/iprt/cpp/xml.h	(revision 27418)
@@ -164,7 +164,10 @@
 public:
 
-    EIPRTFailure (int aRC);
-
-    int rc() const { return mRC; }
+    EIPRTFailure(int aRC, const char *pcszContext, ...);
+
+    int rc() const
+    {
+        return mRC;
+    }
 
 private:
Index: /trunk/src/VBox/Runtime/r3/xml.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/xml.cpp	(revision 27417)
+++ /trunk/src/VBox/Runtime/r3/xml.cpp	(revision 27418)
@@ -149,12 +149,17 @@
 }
 
-EIPRTFailure::EIPRTFailure(int aRC)
+EIPRTFailure::EIPRTFailure(int aRC, const char *pcszContext, ...)
     : RuntimeError(NULL),
       mRC(aRC)
 {
-    char *newMsg = NULL;
-    RTStrAPrintf(&newMsg, "Runtime error: %d (%s)", aRC, RTErrGetShort(aRC));
+    char *pszContext2;
+    va_list args;
+    va_start(args, pcszContext);
+    RTStrAPrintfV(&pszContext2, pcszContext, args);
+    char *newMsg;
+    RTStrAPrintf(&newMsg, "%s: %d (%s)", pszContext2, aRC, RTErrGetShort(aRC));
     setWhat(newMsg);
     RTStrFree(newMsg);
+    RTStrFree(pszContext2);
 }
 
@@ -200,5 +205,5 @@
     int vrc = RTFileOpen(&m->handle, aFileName, flags);
     if (RT_FAILURE(vrc))
-        throw EIPRTFailure(vrc);
+        throw EIPRTFailure(vrc, "Runtime error opening '%s' for reading", aFileName);
 
     m->opened = true;
@@ -234,12 +239,12 @@
 {
     uint64_t p = 0;
-    int vrc = RTFileSeek (m->handle, 0, RTFILE_SEEK_CURRENT, &p);
-    if (RT_SUCCESS (vrc))
+    int vrc = RTFileSeek(m->handle, 0, RTFILE_SEEK_CURRENT, &p);
+    if (RT_SUCCESS(vrc))
         return p;
 
-    throw EIPRTFailure (vrc);
-}
-
-void File::setPos (uint64_t aPos)
+    throw EIPRTFailure(vrc, "Runtime error seeking in file '%s'", m->strFileName.c_str());
+}
+
+void File::setPos(uint64_t aPos)
 {
     uint64_t p = 0;
@@ -250,28 +255,28 @@
     if (((int64_t) aPos) < 0)
     {
-        vrc = RTFileSeek (m->handle, INT64_MAX, method, &p);
-        aPos -= (uint64_t) INT64_MAX;
+        vrc = RTFileSeek(m->handle, INT64_MAX, method, &p);
+        aPos -= (uint64_t)INT64_MAX;
         method = RTFILE_SEEK_CURRENT;
     }
     /* seek the rest */
-    if (RT_SUCCESS (vrc))
-        vrc = RTFileSeek (m->handle, (int64_t) aPos, method, &p);
-    if (RT_SUCCESS (vrc))
+    if (RT_SUCCESS(vrc))
+        vrc = RTFileSeek(m->handle, (int64_t) aPos, method, &p);
+    if (RT_SUCCESS(vrc))
         return;
 
-    throw EIPRTFailure (vrc);
-}
-
-int File::read (char *aBuf, int aLen)
+    throw EIPRTFailure(vrc, "Runtime error seeking in file '%s'", m->strFileName.c_str());
+}
+
+int File::read(char *aBuf, int aLen)
 {
     size_t len = aLen;
-    int vrc = RTFileRead (m->handle, aBuf, len, &len);
-    if (RT_SUCCESS (vrc))
+    int vrc = RTFileRead(m->handle, aBuf, len, &len);
+    if (RT_SUCCESS(vrc))
         return (int)len;
 
-    throw EIPRTFailure (vrc);
-}
-
-int File::write (const char *aBuf, int aLen)
+    throw EIPRTFailure(vrc, "Runtime error reading from file '%s'", m->strFileName.c_str());
+}
+
+int File::write(const char *aBuf, int aLen)
 {
     size_t len = aLen;
@@ -280,5 +285,5 @@
         return (int)len;
 
-    throw EIPRTFailure (vrc);
+    throw EIPRTFailure(vrc, "Runtime error writing to file '%s'", m->strFileName.c_str());
 
     return -1 /* failure */;
@@ -291,5 +296,5 @@
         return;
 
-    throw EIPRTFailure (vrc);
+    throw EIPRTFailure(vrc, "Runtime error truncating file '%s'", m->strFileName.c_str());
 }
 
