Index: /trunk/doc/manual/en_US/user_VBoxManage.xml
===================================================================
--- /trunk/doc/manual/en_US/user_VBoxManage.xml	(revision 35507)
+++ /trunk/doc/manual/en_US/user_VBoxManage.xml	(revision 35508)
@@ -1397,8 +1397,8 @@
     cable on a physical machine, and should be avoided if possible.</para>
   </sect1>
-  
+
   <sect1>
     <title>VBoxManage adoptstate</title>
-    
+
     <para>If you have a saved state file (<computeroutput>.sav</computeroutput>)
     that is seperate from the VM configuration, you can use this command to
@@ -1723,5 +1723,5 @@
       </glosslist></para>
   </sect1>
-  
+
   <sect1 id="vboxmanage-storagectl">
     <title>VBoxManage storagectl</title>
@@ -2777,4 +2777,22 @@
           will have the standard ELF core format (with custom sections); see
           <xref linkend="guestcoreformat" />.</para>
+
+          <para>This corresponds to the
+          <computeroutput>writecore</computeroutput> command in the debugger.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>The <computeroutput>info</computeroutput> command is used to
+          display info items relating to the VMM, device emulations and
+          associated drivers.  This command takes one or two arguments: the
+          name of the info item, optionally followed by a string containing
+          arguments specific to the info item.
+          The <computeroutput>help</computeroutput> info item provides a
+          listning of the available items and hints about any optional
+          arguments.</para>
+
+          <para>This corresponds to the <computeroutput>info</computeroutput>
+          command in the debugger.</para>
         </listitem>
 
@@ -2786,4 +2804,56 @@
           operating system. Do not use unless you know what you're
           doing.</para>
+        </listitem>
+
+        <listitem>
+          <para>The <computeroutput>osdetect</computeroutput> command makes the
+          VMM's debugger facility (re-)detection the guest operation
+          system.</para>
+
+          <para>This corresponds to the <computeroutput>detect</computeroutput>
+          command in the debugger.</para>
+        </listitem>
+
+        <listitem>
+          <para>The <computeroutput>osinfo</computeroutput> command is used to
+          display info about the operating system (OS) detected by the VMM's
+          debugger facility.</para>
+        </listitem>
+
+        <listitem>
+          <para>The <computeroutput>getregisters</computeroutput> command is
+          used to display CPU and device registers.  The command takes a list
+          of registers, each having one of the following forms:
+          <itemizedlist>
+            <listitem><computeroutput>register-set.register-name.sub-field</computeroutput></listitem>
+            <listitem><computeroutput>register-set.register-name</computeroutput></listitem>
+            <listitem><computeroutput>cpu-register-name.sub-field</computeroutput></listitem>
+            <listitem><computeroutput>cpu-register-name</computeroutput></listitem>
+            <listitem><computeroutput>all</computeroutput></listitem>
+          </itemizedlist>
+          The <computeroutput>all</computeroutput> form will cause all
+          registers to be shown (no sub-fields).  The registers names are
+          case-insensitive.  When requesting a CPU register the register set
+          can be omitted, it will be selected using the value of the
+          <computeroutput>--cpu</computeroutput> option (defaulting to 0).
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>The <computeroutput>setregisters</computeroutput> command is
+          used to change CPU and device registers.  The command takes a list
+          of register assignments, each having one of the following forms:
+          <itemizedlist>
+            <listitem><computeroutput>register-set.register-name.sub-field=value</computeroutput></listitem>
+            <listitem><computeroutput>register-set.register-name=value</computeroutput></listitem>
+            <listitem><computeroutput>cpu-register-name.sub-field=value</computeroutput></listitem>
+            <listitem><computeroutput>cpu-register-name=value</computeroutput></listitem>
+          </itemizedlist>
+          The value format should be in the same style as what
+          <computeroutput>getregisters</computeroutput> displays, with the
+          exception that both octal and decimal can be used instead of
+          hexadecimal.  The register naming and the default CPU register set
+          are handled the same way as with the
+          <computeroutput>getregisters</computeroutput> command.</para>
         </listitem>
 
@@ -2799,5 +2869,5 @@
       </itemizedlist></para>
   </sect1>
-  
+
   <sect1>
     <title id="metrics">VBoxManage metrics</title>
@@ -2954,8 +3024,8 @@
     </glosslist>
   </sect1>
-  
+
   <sect1>
     <title>VBoxManage hostonlyif</title>
-    
+
     <para>With "hostonlyif" you can change the IP configuration of a host-only
     network interface. For a description of host-only networking, please
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp	(revision 35507)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp	(revision 35508)
@@ -44,4 +44,69 @@
 
 /**
+ * Handles the getregisters sub-command.
+ *
+ * @returns Suitable exit code.
+ * @param   pArgs               The handler arguments.
+ * @param   pDebugger           Pointer to the debugger interface.
+ */
+static RTEXITCODE handleDebugVM_GetRegisters(HandlerArg *pArgs, IMachineDebugger *pDebugger)
+{
+    /*
+     * We take a list of register names (case insensitive).  If 'all' is
+     * encountered we'll dump all registers.
+     */
+    ULONG                       idCpu = 0;
+    unsigned                    cRegisters = 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;
+
+            case VINF_GETOPT_NOT_OPTION:
+                if (!RTStrICmp(ValueUnion.psz, "all"))
+                {
+                    com::SafeArray<BSTR> aBstrNames;
+                    com::SafeArray<BSTR> aBstrValues;
+                    CHECK_ERROR2_RET(pDebugger, GetRegisters(idCpu, ComSafeArrayAsOutParam(aBstrNames), ComSafeArrayAsOutParam(aBstrValues)),
+                                     RTEXITCODE_FAILURE);
+                    Assert(aBstrNames.size() == aBstrValues.size());
+
+                    for (size_t i = 0; i < aBstrNames.size(); i++)
+                        RTPrintf("%ls = %ls\n", aBstrNames[i], aBstrValues[i]);
+                }
+                else
+                {
+                    com::Bstr bstrName = ValueUnion.psz;
+                    com::Bstr bstrValue;
+                    CHECK_ERROR2_RET(pDebugger, GetRegister(idCpu, bstrName.raw(), bstrValue.asOutParam()), RTEXITCODE_FAILURE);
+                    RTPrintf("%s = %ls\n", ValueUnion.psz, bstrValue.raw());
+                }
+                cRegisters++;
+                break;
+
+            default:
+                return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
+        }
+    }
+
+    if (!cRegisters)
+        return errorSyntax(USAGE_DEBUGVM, "The getregisters sub-command takes at least one register name");
+    return RTEXITCODE_SUCCESS;
+}
+
+/**
  * Handles the info sub-command.
  *
@@ -175,4 +240,84 @@
     RTPrintf("Name:    %ls\n", bstrName.raw());
     RTPrintf("Version: %ls\n", bstrVersion.raw());
+    return RTEXITCODE_SUCCESS;
+}
+
+/**
+ * Handles the setregisters sub-command.
+ *
+ * @returns Suitable exit code.
+ * @param   pArgs               The handler arguments.
+ * @param   pDebugger           Pointer to the debugger interface.
+ */
+static RTEXITCODE handleDebugVM_SetRegisters(HandlerArg *pArgs, IMachineDebugger *pDebugger)
+{
+    /*
+     * We take a list of register assignments, that is register=value.
+     */
+    ULONG                       idCpu = 0;
+    com::SafeArray<IN_BSTR>     aBstrNames;
+    com::SafeArray<IN_BSTR>     aBstrValues;
+
+    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;
+
+            case VINF_GETOPT_NOT_OPTION:
+            {
+                const char *pszEqual = strchr(ValueUnion.psz, '=');
+                if (!pszEqual)
+                    return errorSyntax(USAGE_DEBUGVM, "setregisters expects input on the form 'register=value' got '%s'", ValueUnion.psz);
+                try
+                {
+                    com::Bstr bstrName(ValueUnion.psz, pszEqual - ValueUnion.psz);
+                    com::Bstr bstrValue(pszEqual + 1);
+                    if (   !aBstrNames.push_back(bstrName.raw())
+                        || !aBstrValues.push_back(bstrValue.raw()))
+                        throw std::bad_alloc();
+                }
+                catch (std::bad_alloc)
+                {
+                    RTMsgError("Out of memory\n");
+                    return RTEXITCODE_FAILURE;
+                }
+                break;
+            }
+
+            default:
+                return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
+        }
+    }
+
+    if (!aBstrNames.size())
+        return errorSyntax(USAGE_DEBUGVM, "The setregisters sub-command takes at least one register name");
+
+    /*
+     * If it is only one register, use the single register method just so
+     * we expose it and can test it from the command line.
+     */
+    if (aBstrNames.size() == 1)
+    {
+        CHECK_ERROR2_RET(pDebugger, SetRegister(idCpu, aBstrNames[0], aBstrValues[0]), RTEXITCODE_FAILURE);
+        RTPrintf("Successfully set %ls\n", aBstrNames[0]);
+    }
+    else
+    {
+        CHECK_ERROR2_RET(pDebugger, SetRegisters(idCpu, ComSafeArrayAsInParam(aBstrNames), ComSafeArrayAsInParam(aBstrValues)), RTEXITCODE_FAILURE);
+        RTPrintf("Successfully set %u registers\n", aBstrNames.size());
+    }
+
     return RTEXITCODE_SUCCESS;
 }
@@ -283,4 +428,6 @@
             if (!strcmp(pszSubCmd, "dumpguestcore"))
                 rcExit = handleDebugVM_DumpVMCore(pArgs, ptrDebugger);
+            else if (!strcmp(pszSubCmd, "getregisters"))
+                rcExit = handleDebugVM_GetRegisters(pArgs, ptrDebugger);
             else if (!strcmp(pszSubCmd, "info"))
                 rcExit = handleDebugVM_Info(pArgs, ptrDebugger);
@@ -291,4 +438,6 @@
             else if (!strcmp(pszSubCmd, "osinfo"))
                 rcExit = handleDebugVM_OSInfo(pArgs, ptrDebugger);
+            else if (!strcmp(pszSubCmd, "setregisters"))
+                rcExit = handleDebugVM_SetRegisters(pArgs, ptrDebugger);
             else if (!strcmp(pszSubCmd, "statistics"))
                 rcExit = handleDebugVM_Statistics(pArgs, ptrDebugger);
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 35507)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 35508)
@@ -616,4 +616,6 @@
                      "                            osdetect |\n"
                      "                            osinfo |\n"
+                     "                            getregisters [--cpu <id>] <reg>|all ... |\n"
+                     "                            setregisters [--cpu <id>] <reg>=<value> ... |\n"
                      "                            statistics [--reset] [--pattern <pattern>]\n"
                      "                            [--descriptions]\n"
