Index: /trunk/doc/manual/en_US/man_VBoxManage-debugvm.xml
===================================================================
--- /trunk/doc/manual/en_US/man_VBoxManage-debugvm.xml	(revision 61936)
+++ /trunk/doc/manual/en_US/man_VBoxManage-debugvm.xml	(revision 61937)
@@ -39,10 +39,4 @@
       <arg>--filename=<replaceable>name</replaceable></arg>
     </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-dumpgueststack">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">dumpgueststack</arg>
-      <arg>--cpu=<replaceable>id</replaceable></arg>
-    </cmdsynopsis>
     <cmdsynopsis id="synopsis-vboxmanage-debugvm-info">
       <command>VBoxManage debugvm</command>
@@ -114,4 +108,10 @@
       <group><arg>--human-readable</arg><arg>--sh-export</arg><arg>--sh-eval</arg><arg>--cmd-set</arg></group>
       <arg rep="repeat"><replaceable>settings-item</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-stack">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">stack</arg>
+      <arg>--cpu=<replaceable>id</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis id="synopsis-vboxmanage-debugvm-statistics">
@@ -569,4 +569,20 @@
     </refsect2>
 
+    <refsect2 id="vboxmanage-debugvm-stack">
+      <title>debugvm stack</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Unwinds the guest CPU stacks to the best of our ability.  For Windows
+        guest it is recommended to first run the <command>osdetect</command> command.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><option>--cpu <replaceable>id</replaceable></option></term>
+          <listitem><para>Selects a single guest CPU to display the stack for.  The default is all CPUs.</para> </listitem>
+        </varlistentry>
+      </variablelist>
+
+    </refsect2>
+
     <refsect2 id="vboxmanage-debugvm-statistics">
       <title>debugvm statistics</title>
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp	(revision 61936)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp	(revision 61937)
@@ -28,4 +28,5 @@
 #include <VBox/com/VirtualBox.h>
 
+#include <VBox/types.h>
 #include <iprt/ctype.h>
 #include <VBox/err.h>
@@ -640,4 +641,75 @@
 
 /**
+ * Handles the stack sub-command.
+ *
+ * @returns Suitable exit code.
+ * @param   pArgs               The handler arguments.
+ * @param   pDebugger           Pointer to the debugger interface.
+ */
+static RTEXITCODE handleDebugVM_Stack(HandlerArg *pArgs, IMachineDebugger *pDebugger)
+{
+    /*
+     * Parse arguments.
+     */
+    VMCPUID                     idCpu = VMCPUID_ALL;
+
+    RTGETOPTSTATE               GetState;
+    RTGETOPTUNION               ValueUnion;
+    static const RTGETOPTDEF    s_aOptions[] =
+    {
+        { "--cpu", 'c', RTGETOPT_REQ_UINT32 },
+    };
+    int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, RTGETOPTINIT_FLAGS_OPTS_FIRST);
+    AssertRCReturn(rc, RTEXITCODE_FAILURE);
+
+    while ((rc = RTGetOpt(&GetState, &ValueUnion)) != 0)
+    {
+        switch (rc)
+        {
+            case 'c':
+                idCpu = ValueUnion.u32;
+                break;
+
+            default:
+                return errorGetOpt(rc, &ValueUnion);
+        }
+    }
+
+    /*
+     * Dump stack.
+     */
+    com::Bstr bstrGuestStack;
+    if (idCpu != VMCPUID_ALL)
+    {
+        /* Single CPU */
+        CHECK_ERROR2I_RET(pDebugger, DumpGuestStack(idCpu, bstrGuestStack.asOutParam()), RTEXITCODE_FAILURE);
+        RTPrintf("%ls\n", bstrGuestStack.raw());
+    }
+    else
+    {
+        /* All CPUs. */
+        ComPtr<IMachine> ptrMachine;
+        CHECK_ERROR2I_RET(pArgs->session, COMGETTER(Machine)(ptrMachine.asOutParam()), RTEXITCODE_FAILURE);
+        ULONG cCpus;
+        CHECK_ERROR2I_RET(ptrMachine, COMGETTER(CPUCount)(&cCpus), RTEXITCODE_FAILURE);
+
+        for (idCpu = 0; idCpu < (VMCPUID)cCpus; idCpu++)
+        {
+            CHECK_ERROR2I_RET(pDebugger, DumpGuestStack(idCpu, bstrGuestStack.asOutParam()), RTEXITCODE_FAILURE);
+            if (cCpus > 1)
+            {
+                if (idCpu > 0)
+                    RTPrintf("\n");
+                RTPrintf("====================== CPU #%u ======================\n", idCpu);
+            }
+            RTPrintf("%ls\n", bstrGuestStack.raw());
+        }
+    }
+
+
+    return RTEXITCODE_SUCCESS;
+}
+
+/**
  * Handles the statistics sub-command.
  *
@@ -713,46 +785,4 @@
 }
 
-/**
- * Handles the dumpgueststack sub-command.
- *
- * @returns Suitable exit code.
- * @param   pArgs               The handler arguments.
- * @param   pDebugger           Pointer to the debugger interface.
- */
-static RTEXITCODE handleDebugVM_DumpGuestStack(HandlerArg *pArgs, IMachineDebugger *pDebugger)
-{
-    ULONG                       idCpu = 0;
-
-    RTGETOPTSTATE               GetState;
-    RTGETOPTUNION               ValueUnion;
-    static const RTGETOPTDEF    s_aOptions[] =
-    {
-        { "--cpu", 'c', RTGETOPT_REQ_UINT32 },
-    };
-    int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, RTGETOPTINIT_FLAGS_OPTS_FIRST);
-    AssertRCReturn(rc, RTEXITCODE_FAILURE);
-
-    while ((rc = RTGetOpt(&GetState, &ValueUnion)) != 0)
-    {
-        switch (rc)
-        {
-            case 'c':
-                idCpu = ValueUnion.u32;
-                break;
-
-            default:
-                return errorGetOpt(rc, &ValueUnion);
-        }
-    }
-
-    com::Bstr bstrGuestStack;
-    CHECK_ERROR2I_RET(pDebugger, DumpGuestStack(idCpu, bstrGuestStack.asOutParam()),
-                      RTEXITCODE_FAILURE);
-
-    RTPrintf("%ls\n", bstrGuestStack.raw());
-
-    return RTEXITCODE_SUCCESS;
-}
-
 RTEXITCODE handleDebugVM(HandlerArg *pArgs)
 {
@@ -771,14 +801,14 @@
      * Get the associated console and machine debugger.
      */
-    HRESULT rc;
+    HRESULT hrc;
     ComPtr<IConsole> ptrConsole;
-    CHECK_ERROR(pArgs->session, COMGETTER(Console)(ptrConsole.asOutParam()));
-    if (SUCCEEDED(rc))
+    CHECK_ERROR2(hrc, pArgs->session, COMGETTER(Console)(ptrConsole.asOutParam()));
+    if (SUCCEEDED(hrc))
     {
         if (ptrConsole.isNotNull())
         {
             ComPtr<IMachineDebugger> ptrDebugger;
-            CHECK_ERROR(ptrConsole, COMGETTER(Debugger)(ptrDebugger.asOutParam()));
-            if (SUCCEEDED(rc))
+            CHECK_ERROR2(hrc, ptrConsole, COMGETTER(Debugger)(ptrDebugger.asOutParam()));
+            if (SUCCEEDED(hrc))
             {
                 /*
@@ -846,13 +876,13 @@
                     rcExit = handleDebugVM_Show(pArgs, ptrDebugger);
                 }
+                else if (!strcmp(pszSubCmd, "stack"))
+                {
+                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_STACK);
+                    rcExit = handleDebugVM_Stack(pArgs, ptrDebugger);
+                }
                 else if (!strcmp(pszSubCmd, "statistics"))
                 {
                     setCurrentSubcommand(HELP_SCOPE_DEBUGVM_STATISTICS);
                     rcExit = handleDebugVM_Statistics(pArgs, ptrDebugger);
-                }
-                else if (!strcmp(pszSubCmd, "dumpgueststack"))
-                {
-                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_DUMPGUESTSTACK);
-                    rcExit = handleDebugVM_DumpGuestStack(pArgs, ptrDebugger);
                 }
                 else
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 61936)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 61937)
@@ -1274,28 +1274,4 @@
 #endif /* VBOX_WITH_GUEST_CONTROL defined */
 
-    if (fCategory & USAGE_DEBUGVM)
-    {
-        RTStrmPrintf(pStrm,
-                           "%s debugvm %s         <uuid|vmname>\n"
-                     "                            dumpvmcore --filename <name> |\n"
-                     "                            dumpgueststack [--cpu <id>]\n"
-                     "                            info <item> [args] |\n"
-                     "                            injectnmi |\n"
-                     "                            log [--release|--debug] <settings> ...|\n"
-                     "                            logdest [--release|--debug] <settings> ...|\n"
-                     "                            logflags [--release|--debug] <settings> ...|\n"
-                     "                            osdetect |\n"
-                     "                            osinfo |\n"
-                     "                            osdmesg [--lines|-n <N>] |\n"
-                     "                            getregisters [--cpu <id>] <reg>|all ... |\n"
-                     "                            setregisters [--cpu <id>] <reg>=<value> ... |\n"
-                     "                            show [--human-readable|--sh-export|--sh-eval|\n"
-                     "                                  --cmd-set] \n"
-                     "                                <logdbg-settings|logrel-settings>\n"
-                     "                                [[opt] what ...] |\n"
-                     "                            statistics [--reset] [--pattern <pattern>]\n"
-                     "                            [--descriptions]\n"
-                     "\n", SEP);
-    }
     if (fCategory & USAGE_METRICS)
         RTStrmPrintf(pStrm,
@@ -1406,11 +1382,11 @@
         {
             PCREFENTRY pHelp = g_apHelpEntries[i];
-            RTStrmPrintf(pStrm, "  %c%s:\n", RT_C_TO_UPPER(pHelp->pszBrief[0]), pHelp->pszBrief + 1);
-            cPendingBlankLines = printStringTable(pStrm, &pHelp->Synopsis, REFENTRYSTR_SCOPE_GLOBAL, cPendingBlankLines);
-            if (!cPendingBlankLines)
-                cPendingBlankLines = 1;
+            while (cPendingBlankLines-- > 0)
+                RTStrmPutCh(pStrm, '\n');
+            RTStrmPrintf(pStrm, " %c%s:\n", RT_C_TO_UPPER(pHelp->pszBrief[0]), pHelp->pszBrief + 1);
+            cPendingBlankLines = printStringTable(pStrm, &pHelp->Synopsis, REFENTRYSTR_SCOPE_GLOBAL, 0);
+            cPendingBlankLines = RT_MAX(cPendingBlankLines, 1);
         }
     }
-
 #endif
 }
