https://bugs.winehq.org/show_bug.cgi?id=50468
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #3 from Eric Pouech eric.pouech@gmail.com --- (In reply to mk939 from comment #2)
Created attachment 72705 [details] Executable to list modules, addresses and test backtraces
The issue does not only apply to dlls, but also ELF executables. This document includes information about compiling and "debugging" the binary.
just tested on installed wine, this works as expected (both 32 and 64 compilations)
[eric:~/work/output-wine/winewow64/install]$ bin/winegcc -O0 -g -gdwarf-4 ../../wine64/simple_debug_test.c -o simple_debug_test.exe [eric:~/work/output-wine/winewow64/install]$ bin/wine64 winedbg simple_debug_test.exe.so WineDbg starting on pid 010c 0x00000170055605 ntdll+0x55605: ret Wine-dbg>b CreateToolhelp32Snapshot Breakpoint 1 at 0x0000007b628740 CreateToolhelp32Snapshot [Z:\home\eric\work\wine\dlls\kernel32\toolhelp.c:287] in kernel32 Wine-dbg>cont Stopped on breakpoint 1 at 0x0000007b628740 CreateToolhelp32Snapshot [Z:\home\eric\work\wine\dlls\kernel32\toolhelp.c:287] in kernel32 CreateToolhelp32Snapshot () at Z:\home\eric\work\wine\dlls\kernel32\toolhelp.c:287 287 { Wine-dbg>n 288 SYSTEM_PROCESS_INFORMATION* spi = NULL; Wine-dbg>l 288 SYSTEM_PROCESS_INFORMATION* spi = NULL; 289 LDR_DATA_TABLE_ENTRY *mod = NULL; 290 ULONG num_pcs, num_thd, num_mod; 291 HANDLE hSnapShot = 0; 292 293 TRACE("%lx,%lx\n", flags, process ); 294 if (!(flags & (TH32CS_SNAPPROCESS|TH32CS_SNAPTHREAD|TH32CS_SNAPMODULE))) 295 { 296 FIXME("flags %lx not implemented\n", flags ); 297 SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); 298 return INVALID_HANDLE_VALUE; Wine-dbg>info local 0x0000007b628753 CreateToolhelp32Snapshot+0x13: (000000000011fd30) DWORD flags=0x8 (parameter RCX) DWORD process=0 (parameter RDX) SYSTEM_PROCESS_INFORMATION* spi=0000000000000000 (local ) LDR_DATA_TABLE_ENTRY* mod=0000000000000000 (local ) ULONG num_pcs=<is not available> (local) ULONG num_thd=<is not available> (local) ULONG num_mod=<is not available> (local) HANDLE hSnapShot=0x00000000000000000 (local ) char __func__[25]="????????????" (local ) Wine-dbg>cont -> exepath Z:\home\eric\work\output-wine\winewow64\install\simple_debug_test.exe.so base 0x7fae28c00000 module 0x7fae28c00000 size 28672 uses 65535 -> exepath C:\windows\system32\ntdll.dll base 0x170000000 module 0x170000000 size 3555328 uses 65535 -> exepath C:\windows\system32\kernel32.dll base 0x7b600000 module 0x7b600000 size 1667072 uses 65535 -> exepath C:\windows\system32\kernelbase.dll base 0x7b000000 module 0x7b000000 size 6189056 uses 65535 Unhandled exception: page fault on read access to 0x0000000000000bad in 64-bit code (0x007fae28c0129b). Register dump: rip:00007fae28c0129b rsp:000000000011fa00 rbp:000000000011fa10 eflags:00010206 ( R- -- I - -P- ) rax:0000000000000bad rbx:0000000000245d1a rcx:000000017000d664 rdx:0000000000000000 rsi:00007fae28c03c86 rdi:000000000011f531 r8:000000000021fa50 r9:0000000000000000 r10:0000000000000000 r11:0000000000000202 r12:0000000000245de0 r13:0000000000000001 r14:0000000000000000 r15:0000000000000000 Stack dump: 0x0000000011fa00: 0000000000000bad fffffffffeced300 0x0000000011fa10: 000000000011fd30 00007fae28c0143a 0x0000000011fa20: 0000000000000008 0000000100000000 0x0000000011fa30: 0000000000243660 0000000000000000 0x0000000011fa40: 0000000100000238 0000ffff0000010c 0x0000000011fa50: 000000000000ffff 000000007b000000 0x0000000011fa60: 00000020005e7000 000000007b000000 0x0000000011fa70: 61626c656e72656b 73006c6c642e6573 0x0000000011fa80: 6f732e6578652e74 0000000000001000 0x0000000011fa90: 0004000000000003 0100010200000001 0x0000000011faa0: 0000000040018664 0000000000007000 0x0000000011fab0: 0000000000000000 0000000000000000 Backtrace: =>0 0x007fae28c0129b please_crash+0x14() [Z:\home\eric\work\output-wine\wine64\simple_debug_test.c:46] in simple_debug_test (0x0000000011fa10) 1 0x007fae28c0143a main+0x175(argc=0x28bef000, argv=00007FAE28C05F90) [Z:\home\eric\work\output-wine\wine64\simple_debug_test.c:70] in simple_debug_test (0x0000000011fd30) 2 0x007fae28c015d1 __wine_spec_exe_entry+0x131(peb=<internal error>) [Z:\home\eric\work\wine\dlls\winecrt0\exe_entry.c:105] in simple_debug_test (0x0000000011fe30) 3 0x0000007b627e49 BaseThreadInitThunk+0x9(unknown=<internal error>, entry=<internal error>, arg=<internal error>) [Z:\home\eric\work\wine\dlls\kernel32\thread.c:61] in kernel32 (0000000000000000) 4 0x0000017005dcb8 __wine_pop_frame(entry=00007FAE28C014A0, arg=0000000067FF0000) [Z:\home\eric\work\wine\include\wine\exception.h:277] in ntdll (0000000000000000) 5 0x0000017005dcb8 RtlUserThreadStart+0x88(entry=[<register RSP not accessible in this frame>, arg=[<register RSP not accessible in this frame>) [Z:\home\eric\work\wine\dlls\ntdll\thread.c:285] in ntdll (0000000000000000) 0x007fae28c0129b please_crash+0x14 [Z:\home\eric\work\output-wine\wine64\simple_debug_test.c:46] in simple_debug_test: movl (%rax),%edx 46 memcpy(x, bad, 5); Wine-dbg>pass 0110:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x7fae28c0129b Invalid address (0x0000007b628740 CreateToolhelp32Snapshot) for breakpoint 1, disabling it Process of pid=010c has terminated Wine-dbg>q