Index: /trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py	(revision 52569)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py	(revision 52570)
@@ -30,6 +30,14 @@
 static void crUnpackExtendDbg(void);
 
-/*#define CR_UNPACK_DEBUG_OPCODES*/
-/*#define CR_UNPACK_DEBUG_LAST_OPCODES*/
+#if 0 //def DEBUG_misha
+//# define CR_UNPACK_DEBUG_OPCODES
+# define CR_UNPACK_DEBUG_LAST_OPCODES
+# define CR_UNPACK_DEBUG_PREV_OPCODES
+#endif
+
+#ifdef CR_UNPACK_DEBUG_PREV_OPCODES
+static GLenum g_VBoxDbgCrPrevOpcode = 0;
+static GLenum g_VBoxDbgCrPrevExtendOpcode = 0;
+#endif
 """
 
@@ -256,4 +264,7 @@
     
         /*crDebug(\"Unpacking opcode \%d\", *unpack_opcodes);*/
+#ifdef CR_UNPACK_DEBUG_PREV_OPCODES
+        g_VBoxDbgCrPrevOpcode = *unpack_opcodes;
+#endif
         switch( *unpack_opcodes )
         {"""
@@ -323,4 +334,8 @@
 print '\tGLenum extend_opcode = %s;' % ReadData( 4, 'GLenum' );
 print ''
+print '#ifdef CR_UNPACK_DEBUG_PREV_OPCODES'
+print '\tg_VBoxDbgCrPrevExtendOpcode = extend_opcode;'
+print '#endif'
+print ''
 print '\t/*crDebug(\"Unpacking extended opcode \%d", extend_opcode);*/'
 print '\tswitch( extend_opcode )'
@@ -348,4 +363,8 @@
 print '{'
 print '\tGLenum extend_opcode = %s;' % ReadData( 4, 'GLenum' );
+print ''
+print '#ifdef CR_UNPACK_DEBUG_PREV_OPCODES'
+print '\tg_VBoxDbgCrPrevExtendOpcode = extend_opcode;'
+print '#endif'
 print ''
 print '\t/*crDebug(\"Unpacking extended opcode \%d", extend_opcode);*/'
