Debugging wine/windows applications

Marcus Meissner marcus at jet.franken.de
Sat Jul 7 05:29:34 CDT 2012


On Sat, Jul 07, 2012 at 01:25:12PM +0300, John Yani wrote:
> I tried "WINELOADER=./wine winedbg --gdb notepad"
> 
> And its output is the same as  "./wine winedbg --gdb notepad"

Well, i have a installed wine... but doing this there:

wine winedbg.exe --gdb notepad.exe

0042:0043: create process 'C:\Windows\System\notepad.exe'/0x1106f8 @0x7ee012b0 (0<0>)
fixme:dbghelp_dwarf:dwarf2_parse_line_numbers Unsupported extended opcode 0
fixme:dbghelp_dwarf:dwarf2_parse_line_numbers Unsupported extended opcode 0
fixme:dbghelp_dwarf:dwarf2_parse_line_numbers Unsupported extended opcode 0
fixme:dbghelp_dwarf:compute_location Only supporting one breg (edi/24 -> esi/23)
0042:0043: create thread I @0x7ee012b0
GNU gdb (GDB) SUSE (7.2-3.3)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
0042:0043: loads DLL C:\Windows\System\KERNEL32.dll @0x7b810000 (0<0>)
0042:0043: loads DLL C:\Windows\System\ntdll.dll @0x7bc10000 (0<0>)
0042:0043: loads DLL C:\Windows\System\advapi32.dll @0x7e7e0000 (0<0>)
0042:0043: loads DLL C:\Windows\System\gdi32.dll @0x7e850000 (0<0>)
....
start_process (peb=0x7ffdf000) at /home/marcus/projects/wine/dlls/kernel32/process.c:1083
1083        return call_process_entry( peb, entry );
trace: 98 => 80
Wine-gdb> bt
#0  start_process (peb=0x7ffdf000) at /home/marcus/projects/wine/dlls/kernel32/process.c:1083
#1  0x7bc75670 in call_thread_func_wrapper () from /home/marcus/projects/32wine/dlls/ntdll/ntdll.dll.so
#2  0x7bc7794d in call_thread_func (entry=0x7b85e1c0 <start_process>, arg=0x7ffdf000, frame=0x33ffc8) at /home/marcus/projects/wine/dlls/ntdll/signal_i386.c:2522
#3  0x7bc7564e in call_thread_entry_point () from /home/marcus/projects/32wine/dlls/ntdll/ntdll.dll.so
#4  0x7bc4d7de in start_process (kernel_start=0x7b85e1c0) at /home/marcus/projects/wine/dlls/ntdll/loader.c:2653
#5  0xf75c4bad in wine_call_on_stack () from /home/marcus/projects/32wine/libs/wine/libwine.so.1
#6  0xf75c4c6b in wine_switch_to_stack (func=0x7bc4d7c0 <start_process>, arg=0x7b85e1c0, stack=0x340000) at /home/marcus/projects/wine/libs/wine/port.c:59
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Wine-gdb> c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
0xffffe423 in ?? ()
Wine-gdb> bt
#0  0xffffe423 in ?? ()
#1  0x7bcb6ff4 in ?? () from /home/marcus/projects/32wine/dlls/ntdll/ntdll.dll.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Wine-gdb> 

Its not having the correct symbols there, but basically works.


Or I also tried:

$ wine notepad.exe&
... wait until window shows ...
$ ps auxw|grep notepad
marcus   26694  0.4  0.1 1785696 10084 pts/6   t    12:27   0:00 notepad.exe                                      
$ 

gdb /usr/bin/wine
(gdb) attach 26694
0xffffe425 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe425 in __kernel_vsyscall ()
#1  0xf764e0e3 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:82
#2  0x7bc796c8 in wait_reply (cookie=0x32f3bc) at /home/marcus/projects/wine/dlls/ntdll/sync.c:807
#3  0x7bc7bb03 in NTDLL_wait_for_multiple_objects (count=1, handles=0x32f438, flags=4, timeout=0x0, signal_object=<value optimized out>)
    at /home/marcus/projects/wine/dlls/ntdll/sync.c:1122
#4  0x7bc7bbf5 in NtWaitForMultipleObjects (count=1, handles=0x32f438, wait_all=0 '\000', alertable=0 '\000', timeout=0x0) at /home/marcus/projects/wine/dlls/ntdll/sync.c:1160
#5  0x7b86fe3f in WaitForMultipleObjectsEx (count=1, handles=0x32f61c, wait_all=0, timeout=4294967295, alertable=0) at /home/marcus/projects/wine/dlls/kernel32/sync.c:190
#6  0x7e4c3bc5 in WaitForMultipleObjectsEx_ichk (count=1, handles=0x32f61c, timeout=4294967295, mask=1279, flags=0) at /home/marcus/projects/wine/include/winbase.h:2600
#7  X11DRV_MsgWaitForMultipleObjectsEx (count=1, handles=0x32f61c, timeout=4294967295, mask=1279, flags=0) at /home/marcus/projects/wine/dlls/winex11.drv/event.c:472
...



Ciao, Marcus



More information about the wine-devel mailing list