Native windows dll, proxy methods, Unsupported Dwarf2 information for...

Robert Shearman rob at
Sat Apr 9 20:34:44 CDT 2005

Stephen Crowley wrote:

>Hi,  I have a win32 dll which exports about 30 functions. I've used
>winedump with the -f and -I flags to create stub/proxy functions which
>use LoadLibrary.  Please CC my on all responses as I am not subscribed
>to the list.
>It generates functions like so..
>HGTBSESSION __stdcall GTBAPI_gtbCreateSession(HWND hParent,
>GTBSessionCallback * lpCallBack, void * lpParam)
>        HGTBSESSION (__stdcall *pFunc)(HWND, const GTBSessionCallback
>*, void *);
>        HGTBSESSION retVal;
>        pFunc=(void*)GetProcAddress(hDLL,"gtbCreateSession");
>        TRACE("((HWND)%p,(GTBSessionCallback *)%p,(void *)%p):
>        retVal = pFunc(hParent,lpCallBack,lpParam);
>        TRACE("Returned (%p)\n",retVal);
>        return retVal;
>For compatibility with existing code I removed the GTBAPI_ from the
>function and switched back to the native prototype.
>GTBSessionCallback *lpCallBack, void *lpParam)
>Compiled and linked like so.
>gcc -shared GTAPIB_main.c -I/usr/include/wine/windows
>-I../GenSrc/API/GTAPIB -o ../lib/
>Then I have a small test app that I compile/link:
>winegcc TestAPIB.c -I/usr/include/wine/windows -I
>../../../GenSrc/API/GTAPIB -L../../../lib -lgtapib -lkernel32 -o
>Running ./TestAPIB throws the following error
>WineDbg starting on pid 0x8
>Unhandled exception: page fault on read access to 0x00000000 in 32-bit
>code (0x00000000).
>In 32 bit mode.
>=>1 0x00000000 (0x406efe60)
>fixme:dbghelp:elf_load_debug_info_from_map Unsupported Dwarf2
>information for testapib<elf>
>  2 0x405e5276 WinMain in testapib (0x406efe90)
>  3 0x405e5173 __wine_exe_main in testapib (0x406eff20)
>  4 0x404e0de2 in kernel32 (+0x50de2) (0x406efff4)
>  5 0x4001d181 wine_switch_to_stack in (0x00000000)
>0x00000000: addb        %al,0x0(%eax)
>My wine version is 20050310
>Any tips would be greatly appreciated.

Compile your program with the "-gstabs+" flag and you will get debugging 
information compatible with winedbg. From there, it should be easier to 
work out the real cause of the crash.


More information about the wine-devel mailing list