[MPlayer-dev-eng] [PATCH] Win32 loader support for OS/2

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Feb 9 17:19:11 CET 2010


On Tue, Feb 09, 2010 at 11:12:06PM +0900, KO Myung-Hun wrote:
> >>+#ifdef DEBUG_QTX_API
> >>+    printf("addr = %p, cb = %d, fl = %08X : ", p, cb, fl);
> >>+    if(fl&  0x10)
> >>+        printf("COMMIT ");
> >>+    if(fl&  0x2000 )
> >>+        printf("SHARED ");
> >>+    if(fl&  0x4000)
> >>+        printf("FREE ");
> >>+    if(fl&  0x10000)
> >>+        printf("BASE ");
> >>+    if(fl&  0x01)
> >>+        printf("READ ");
> >>+    if(fl&  0x02)
> >>+        printf("WRITE ");
> >>+    if(fl&  0x04)
> >>+        printf("EXEC ");
> >>+    if(fl&  0x08)
> >>+        printf("GUARD ");
> >>+    printf("\n");
> >>+#endif
> >
> >is that necessary?
> >
> 
> Of course for debugging.

Let me rephrase that: Why would we need OS/2 specific debugging code in SVN?
Does anyone intend to improve QTX support, let alone on OS/2?

> >>+    // Occasionally, ptr with 'EXEC' attr is passed.
> >>+    // On OS/2, however, malloc() never set 'EXEC' attr.
> >>+    // So ptr with 'EXEC' attr is invalid.
> >>+    if(fl&  0x04)
> >>+        return 1;
> >
> >If it's "EXEC" the pointer is not invalid, it does not point
> >to heap memory though.
> >So is_allocated_ptr or is_head_ptr or something like that would
> >be a better name for the function I think.
> >
> 
> However the output is 'WARNING! Invalid Ptr handle!'.

Invalid as argument for that function I guess.

> >>@@ -758,6 +802,7 @@
> >>    int plen=-1;
> >>    // find the code:
> >>
> >>+#ifndef __OS2__
> >>    dptr=0x62b67ae0;dptr+=2*((reg->eax>>16)&255);
> >>  //  printf("FUNC: flag=%d ptr=%p\n",dptr[0],dptr[1]);
> >>    if(dptr[0]&255){
> >>@@ -792,6 +837,7 @@
> >>  	  pwrapper=dptr[1];
> >>        }
> >>    }
> >>+#endif
> >
> >That whole point is under
> >DEBUG_QTX_API, which is disabled by default, so IMO don't disable parts
> >of it doubly - someone who actually needs the debug code can get it
> >to compile at least as fast as figure out why half of the output is
> >missing on OS/2 only.
> >
> 
> Unforunately it does not work on OS/2. it causes MPlayer crashed.

Maybe, the question is more why it's important to have DEBUG_QTX_API
working on OS/2.
Since that is not enabled by default, I'd say it should at least be a
separate patch, since it's not necessary for simply making the loader
work on OS/2, only to make the debug stuff work.

> And I don't understand how hard-coded address value, 0x62b67ae0, can
> be used.

Because the QTX code is always loaded at the same address (or at least should be).



More information about the MPlayer-dev-eng mailing list