Hello,
We just started using WineLib, and have very basic question:
which -g??? option do you use to do source level debugging with winedbg?
I searched the documentation and mailing list for any step-by-step about this, but found nothing. So either the answer is so obvious that I just can't see it - or it doesn't work?
By default, winemaker seems configure things for no debug - so I edited one Makefile manually, and added -g. Winedbg can attach to the process, and can even show the stack - but didn't know much beyond that. I tried all the -g variants that I could find, but only -gstabs and -gstabs+ seemed to help. They allowed the debugger to find the correct place in the source, and "whatis" seemed to work - however, if I tried to dereference something, it complained about "no type ...", like this:
Wine-dbg>info process pid threads parent executable (all id:s are in hex) 00000008 3 00000000 'Z:\home\s\src\SysSrv \DataDistributionService\DDSServer2\ddsserver2.exe' Wine-dbg>attach 8 In 32 bit mode. 0x546387a2: ret Wine-dbg>bt Backtrace: =>1 0x546387a2 (0x10252c50) 2 0x48714a7e NTDLL_wait_for_multiple_objects+0x12e in ntdll (0x10252cf8) 3 0x48712fec vm86_return_end+0xc55 in ntdll (0x10252d1c) 4 0x1000b808 (0x10352d64) 5 0x48714a7e NTDLL_wait_for_multiple_objects+0x12e in ntdll (0x10352e0c) 6 0x48714afc NtWaitForMultipleObjects+0x6c in ntdll (0x10352e30) 7 0x61e57a95 WaitForMultipleObjectsEx+0xb5 in kernel32 (0x10352f60) 8 0x61e5797b WaitForSingleObjectEx+0x3b in kernel32 (0x10352f80) 9 0x1002878afixme:dbghelp:elf_new_wine_thunks Duplicate in ddsserver2<elf>: _ZZ17BroadCastIdentityPvmmE22lRepCntrClientDeletion<10037720-00000004> lRepCntrClientDeletion<10037720-00000000> fixme:dbghelp:elf_new_wine_thunks Duplicate in ddsserver2<elf>: _ZZ17BroadCastIdentityPvmmE20lRepKeepAliveCounter<10037724-00000004> lRepKeepAliveCounter<10037724-00000000> fixme:dbghelp:elf_new_wine_thunks Duplicate in ddsserver2<elf>: _ZZ17BroadCastIdentityPvmmE17lRepCntrBroadcast<1003771c-00000004> lRepCntrBroadcast<1003771c-00000000> _Z13DDSServerMainPv+0x88(lpParameter=0x44c47098) [/home/s/src/SysSrv/ DataDistributionService/DDSServer2/AcceptSocket.cpp:220] in ddsserver2 (0x10353150) 10 0x61e5eeda (0x10353228) 11 0x48716523 (0x10353a78) 12 0x1000508d (0x10353b0c) 13 0x660d255a (0x00000000) Wine-dbg>up 8 220 dwRetVal = ::WaitForSingleObjectEx (pServer-
m_hStopEvent, INFINITE, TRUE);
Wine-dbg>p pServer 0x44c47098 Wine-dbg>p *pServer
No type or type mismatch Wine-dbg>whatis pServer struct DDSServer* Wine-dbg>
Any help?
Geoff
Geoff K. Hart a écrit :
Hello,
We just started using WineLib, and have very basic question:
which -g??? option do you use to do source level debugging with winedbg?
I searched the documentation and mailing list for any step-by-step about this, but found nothing. So either the answer is so obvious that I just can't see it - or it doesn't work?
By default, winemaker seems configure things for no debug - so I edited one Makefile manually, and added -g. Winedbg can attach to the process, and can even show the stack - but didn't know much beyond that. I tried all the -g variants that I could find, but only -gstabs and -gstabs+ seemed to help.
-gstabs is needed because we don't grok the dwarf debug information, just the stabs one. latest gcc version use dwarf as default. Which wine version are you using ? They've been several fixes in winedbg which could help you here. A+
Geoff K. Hart wrote:
Hello,
We just started using WineLib, and have very basic question:
which -g??? option do you use to do source level debugging with winedbg?
There is no point in struggling with winedbg, with a winelib. wine and winelib apps can be fully debugged with gdb. I use a full screen gui over gdb, kdevelop, give it a try. What you do is : - find out if on your system you are running wine-kthread or wine-pthread. (wine is Just a loader that figures out which one to load). Than at the gdb settings the executable for debugging is that one (wine-pthread or wine-kthread) - have all the right command line parameters to invoke your winelib app. If you have environment variables need set do that before you run the debugger or at the debugger before the app is loaded. In kdevelop there is a nice settings dialog to set all these things once. Actually one of the points of a winelib is that you can use the native debugger.
Free life Boaz
Hi,
I have created one winelib library (e.g. mylib.dll.so). When I try to link to it during the executable generation (using winemaker's -i option), I got the following error: could not open .def for mylib. I didn't manually created a spec file during the winelib library generation so I don't have def file for it. I checked winebuild manpage, it seems that def file is only needed when building dlls with a PE(win32) compilers.
Can anybody tell me what the problem is and how I can fix it? Thanks.
Cheers, Wu
(Boaz - I also saw that your are the author of a set of patches for ATL & MFC - is there a set of 20041019 that I can pickup someplace? Especially for "__uuidof")
On Wed, 2004-11-03 at 09:34 +0200, Boaz Harrosh wrote:
Geoff K. Hart wrote:
Hello,
We just started using WineLib, and have very basic question:
which -g??? option do you use to do source level debugging with winedbg?
There is no point in struggling with winedbg, with a winelib. wine and winelib apps can be fully debugged with gdb.
OK - that's great news. However, could you illustrate this technique a bit more? I'm running on FC2, using the 1019 version of wine. So I presume it's pthreads? Here's more evidence:
[spsy@hulk DDSServer2]$ ps -ef|grep wine spsy 30660 1 0 09:56 ? 00:00:00 /usr/bin/wineserver spsy 30662 29425 0 09:56 pts/12 00:00:00 /usr/bin/wine- preloader /usr/bin/wine-pthread ./ddsserver2.exe.so
That's when I start the app in the normal way (ddsserver2 is the app). I just rebuilt the app with "-g" (manually added in the Makefile).
I tried:
[spsy@hulk windows]$ gdb --pid=30662 GNU gdb Red Hat Linux (6.0post-0.20040223.19rh) [ ... header deleted ... ] Attaching to process 30662 Reading symbols from /usr/bin/wine-preloader...(no debugging symbols found)...done. Using host libthread_db library "/lib/tls/libthread_db.so.1". 0x15aee7a2 in ?? () (gdb) bt #0 0x15aee7a2 in ?? () #1 0x100e4221 in ?? () #2 0x101c8244 in ?? () #3 0x00000000 in ?? () (gdb)
Looks like I didn't start things up in the right manner.
- have all the right command line parameters to invoke your winelib
app.
If you have environment variables need set do that before you run the debugger or at the debugger before the app is loaded. In kdevelop
there
is a nice settings dialog to set all these things once. Actually one of the points of a winelib is that you can use the
native
debugger.
I will try kdevelop (and also Eclipse) later, but I want to get plain gdb working first (if possible).
thanks! Geoff
p.s. here's what winedbg says (does the fact that the app is running 3 threads matter?) [spsy@hulk windows]$ winedbg Wine-dbg>process info No process loaded, cannot execute 'process info' Wine-dbg>info process pid threads parent executable (all id:s are in hex) 0000000a 3 00000000 'Z:\home\s\src\SysSrv \DataDistributionService\DDSServer2\ddsserver2.exe' Wine-dbg>attach 10 In 32 bit mode. 0x15aee7a2: ret Wine-dbg>bt Backtrace: =>1 0x15aee7a2 (0x2453ec50) 2 0x101b1a7e NTDLL_wait_for_multiple_objects+0x12e in ntdll (0x2453ecf8) 3 0x101affec vm86_return_end+0xc55 in ntdll (0x2453ed1c) 4 0x15365808 (0x10872d64) 5 0x101b1a7e NTDLL_wait_for_multiple_objects+0x12e in ntdll (0x10872e0c) 6 0x101b1afc NtWaitForMultipleObjects+0x6c in ntdll (0x10872e30) 7 0x1038ca95 WaitForMultipleObjectsEx+0xb5 in kernel32 (0x10872f60) 8 0x1038c97b WaitForSingleObjectEx+0x3b in kernel32 (0x10872f80) 9 0x1298c78afixme:dbghelp:elf_load_debug_info_from_file Unsupported Dwarf2 information for ddsserver2<elf> _Z13DDSServerMainPv+0x88 in ddsserver2 (0x10873150) 10 0x10393eda (0x10873228) 11 0x101b3523 (0x10873a78) 12 0x1535f08d (0x10873b0c) 13 0x100ed55a (0x00000000) Wine-dbg>