Index: /trunk/src/VBox/ValidationKit/common/utils.py
===================================================================
--- /trunk/src/VBox/ValidationKit/common/utils.py	(revision 65320)
+++ /trunk/src/VBox/ValidationKit/common/utils.py	(revision 65321)
@@ -749,4 +749,59 @@
     return fRc;
 
+def processGetInfo(uPid):
+    """
+    Tries to acquire state information of the given process.
+
+    Returns a string with the information on success or None on failure or
+    if the host is not supported.
+
+    Note that the format of the information is host system dependent and will
+    likely differ much between different hosts.
+    """
+    fRc = processExists(uPid);
+    if fRc is not True:
+        return None;
+
+    if sys.platform in ('linux2', ):
+        sGdb = '/usr/bin/gdb';
+        if not os.path.isfile(sGdb): sGdb = '/usr/local/bin/gdb';
+        if not os.path.isfile(sGdb): sGdb = 'gdb';
+        aasCmd = [
+                     [sGdb, '-batch', '-ex', 'thread apply all bt',
+                                      '-ex', 'info proc mapping',
+                                      '-ex', 'info sharedlibrary',
+                                      '-p', '%u' % (uPid,)]
+                 ];
+    elif sys.platform in ('darwin', ):
+        # LLDB doesn't work in batch mode when attaching to a process, at least
+        # with macOS Sierra (10.12). GDB might not be installed. Use the sample tool
+        # instead with a 1 second duration and 1000ms sampling interval to get one stack trace.
+        # For the process mappings use vmmap.
+        aasCmd = [ \
+                     ['/usr/bin/sample', '-mayDie', '%u' % (uPid,), '1', '1000'],
+                     ['/usr/bin/vmmap', '%u' % (uPid,)]
+                 ];
+    elif sys.platform in ('sunos5',):
+        aasCmd = [ \
+                     ['/usr/bin/pstack', '%u' % (uPid,)],
+                     ['/usr/bin/pmap', '%u' % (uPid,)]
+                 ];
+    else:
+        aasCmd = None;
+
+    sInfo = '';
+    if aasCmd is not None:
+        for asCmd in aasCmd:
+            try:
+                sThisInfo = sudoProcessOutputChecked(asCmd);
+                if sThisInfo is not None:
+                    sInfo += sThisInfo;
+            except:
+                pass;
+    if not sInfo:
+        sInfo = None;
+
+    return sInfo;
+
 
 class ProcessInfo(object):
Index: /trunk/src/VBox/ValidationKit/testdriver/vbox.py
===================================================================
--- /trunk/src/VBox/ValidationKit/testdriver/vbox.py	(revision 65320)
+++ /trunk/src/VBox/ValidationKit/testdriver/vbox.py	(revision 65321)
@@ -2580,4 +2580,10 @@
         sVgaText            = None;
         asMiscInfos         = [];
+        sHostProcessInfo    = None;
+
+        # Try to fetch the VM process info before meddling with its state.
+        if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
+            sHostProcessInfo = utils.processGetInfo(oSession.getPid());
+
         if not oSession.fHostMemoryLow:
             #
@@ -2734,4 +2740,7 @@
             reporter.addLogString(u''.join(asMiscInfos), 'info.txt', 'info/collection', 'A bunch of info items.');
 
+        # Add the host process info if we were able to retrieve it.
+        if sHostProcessInfo is not None:
+            reporter.addLogString(sHostProcessInfo, 'vmprocess.log', 'log/host/vmprocess', 'VM process state');
 
         return fRc;
Index: /trunk/src/VBox/ValidationKit/testmanager/core/testboxcontroller.py
===================================================================
--- /trunk/src/VBox/ValidationKit/testmanager/core/testboxcontroller.py	(revision 65320)
+++ /trunk/src/VBox/ValidationKit/testmanager/core/testboxcontroller.py	(revision 65321)
@@ -713,4 +713,5 @@
                           'log/uninstaller',
                           'log/guest/kernel',
+                          'log/host/vmprocess',
                           'crash/report/vm',
                           'crash/dump/vm',
Index: /trunk/src/VBox/ValidationKit/testmanager/core/testresults.py
===================================================================
--- /trunk/src/VBox/ValidationKit/testmanager/core/testresults.py	(revision 65320)
+++ /trunk/src/VBox/ValidationKit/testmanager/core/testresults.py	(revision 65321)
@@ -401,4 +401,5 @@
     ksKind_LogUninstaller       = 'log/uninstaller';
     ksKind_LogGuestKernel       = 'log/guest/kernel';
+    ksKind_LogHostVmProcess     = 'log/host/vmprocess';
     ksKind_CrashReportVm        = 'crash/report/vm';
     ksKind_CrashDumpVm          = 'crash/dump/vm';
