Index: /trunk/src/VBox/VMM/VMMGC/SELMGC.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMGC/SELMGC.cpp	(revision 1326)
+++ /trunk/src/VBox/VMM/VMMGC/SELMGC.cpp	(revision 1327)
@@ -45,5 +45,5 @@
  * Synchronizes one GDT entry (guest -> shadow).
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   pRegFrame   Trap register frame.
@@ -153,5 +153,5 @@
  * \#PF Virtual Handler callback for Guest write access to the Guest's own GDT.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode  CPU Error code.
@@ -226,5 +226,5 @@
  * \#PF Virtual Handler callback for Guest write access to the Guest's own LDT.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode   CPU Error code.
@@ -249,5 +249,5 @@
  * \#PF Virtual Handler callback for Guest write access to the Guest's own current TSS.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode  CPU Error code.
@@ -302,5 +302,5 @@
  * \#PF Virtual Handler callback for Guest write access to the VBox shadow GDT.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode   CPU Error code.
@@ -320,5 +320,5 @@
  * \#PF Virtual Handler callback for Guest write access to the VBox shadow LDT.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode   CPU Error code.
@@ -339,5 +339,5 @@
  * \#PF Virtual Handler callback for Guest write access to the VBox shadow TSS.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode   CPU Error code.
Index: /trunk/src/VBox/VMM/VMMGC/TRPMGC.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMGC/TRPMGC.cpp	(revision 1326)
+++ /trunk/src/VBox/VMM/VMMGC/TRPMGC.cpp	(revision 1327)
@@ -94,5 +94,5 @@
  * \#PF Virtual Handler callback for Guest write access to the Guest's own current IDT.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode   CPU Error code.
@@ -105,4 +105,14 @@
 TRPMGCDECL(int) trpmgcGuestIDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, void *pvFault, void *pvRange, uintptr_t offRange)
 {
+    uint16_t    cbIDT;
+    RTGCPTR     GCPtrIDT    = (RTGCPTR)CPUMGetGuestIDTR(pVM, &cbIDT);
+#ifdef VBOX_STRICT
+    RTGCPTR     GCPtrIDTEnd = (RTGCPTR)((RTGCUINTPTR)GCPtrIDT + cbIDT + 1);
+    uint32_t    iTrap       = ((RTGCUINTPTR)pvFault - (RTGCUINTPTR)GCPtrIDT)/sizeof(VBOXIDTE);
+#endif
+
+    Assert(pvFault >= GCPtrIDT && pvFault < GCPtrIDTEnd);
+    Log(("trpmgcGuestIDTWriteHandler: write to gate %x\n", iTrap));
+
     ////LogCom(("trpmgcGuestIDTWriteHandler: eip=%08X pvFault=%08X pvRange=%08X\r\n", pRegFrame->eip, pvFault, pvRange));
     VM_FF_SET(pVM, VM_FF_TRPM_SYNC_IDT);
@@ -117,5 +127,5 @@
  * \#PF Virtual Handler callback for Guest write access to the VBox shadow IDT.
  *
- * @returns VBox status code (appropritate for trap handling and GC return).
+ * @returns VBox status code (appropriate for trap handling and GC return).
  * @param   pVM         VM Handle.
  * @param   uErrorCode   CPU Error code.
