My system is Fedora 18, and I'm using mingw64-gcc version 4.7.2-7.fc18 (installed from yum). Wine is version 1.5.29-1.fc18 (also installed from yum).
For testing purposes, I have a very simple Windows program:
Code: Select all
[erick@erick-dell-690v-linux cfiles]$ cat simple.c
#include <windows.h>
#include <stdio.h>
void doSomething()
{
char msg[256];
sprintf(msg, "Process ID: %u", (unsigned)GetCurrentProcessId());
MessageBox(NULL, msg, "Hello, world!", MB_OK | MB_ICONINFORMATION);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
doSomething();
return 0;
}
[erick@erick-dell-690v-linux cfiles]$ x86_64-w64-mingw32-gcc -g -mwindows -o simple.exe simple.c
[erick@erick-dell-690v-linux cfiles]$ ./simple.exe
Code: Select all
[erick@erick-dell-690v-linux cfiles]$ winedbg ./simple.exe
WineDbg starting on pid 0023
Code: Select all
Process of pid=0023 has terminated
Wine-dbg>
I see that winedbg has a --gdb option, but I haven't had any luck with that either:
Code: Select all
[erick@erick-dell-690v-linux cfiles]$ winedbg --gdb ./simple.exe
0023:0024: create process 'Z:\home\erick\cfiles\simple.exe'/0x10ba0 @0x4014c0 (59904<1390>)
fixme:dbghelp:EnumerateLoadedModulesW64 If this happens, bump the number in mod
0023:0024: create thread I @0x4014c0
[erick@erick-dell-690v-linux cfiles]$
Code: Select all
[erick@erick-dell-690v-linux cfiles]$ ./simple.exe &
[1] 725
[erick@erick-dell-690v-linux cfiles]$ winedbg --gdb 725
Can't attach process 02d5: error 87
Couldn't start process '725 '
Usage:
winedbg [ [ --gdb ] [ prog-name [ prog-args ] | <num> | file.mdmp | --help ]
[erick@erick-dell-690v-linux cfiles]$ winedbg --gdb 36
0024:0025: create process 'Z:\home\erick\cfiles\simple.exe'/0x10bf0 @(nil) (59904<1390>)
fixme:dbghelp:EnumerateLoadedModulesW64 If this happens, bump the number in mod
0024:0025: create thread I @(nil)
I've also tried using gdb.exe from the mingw64-gdb package on yum.
Code: Select all
[erick@erick-dell-690v-linux cfiles]$ /usr/x86_64-w64-mingw32/sys-root/mingw/bin/gdb.exe simple.exe
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 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-w64-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from Z:\home\erick\cfiles\simple.exe...done.
(gdb) break doSomething
Can someone please tell me what I'm doing wrong? Any help would be greatly appreciated!