I want to use winedbg to debug an exception error in a program.
I read the man page and wiki but I'm not able to make it work.
First I start the program from one terminal, then I start winedbg in another terminal.
The windows program is waiting for me to make it crash.
In the wine-dbg> prompt I type info process and a list of process appears.
The process I'm trying to debug is in the list.
I type attach n where n is the decimal conversion of the process pid I want to debug.
winedbg doesn't output anything.
So, now I press Ctrl+C to stop the debuggee, and winedbg outputs "Ctrl-C: stopping debuggee".
Now I type a command, winedbg doesn't echo when I type.
I blindly type my command anyway followed by enter but nothing happens.
I press Ctrl+C again and it keeps replying with "Ctrl-C: stopping debuggee".
Then I alt-tab to the windows program and make it crash.
I return to the winedbg terminal: no new output, no reaction.
I can still ctrl-c and stop the debuggee as much as I want but I cannot enter any commands.
The only thing I can do is close the windows program, and then winedbg outputs "Process of pid=xxxx has terminated".
Further commands result in "You must be attached to a process to run this command."
Where or when am I supposed to enter the commands, bt and such?
Wine 1.7.41 WoW64 compiled from git.
The debuggee is a 64bit app.
How do one use winedbg?
Re: How do one use winedbg?
Hi,
Did you read the guide on using the Winde Debugger?
https://www.winehq.org/docs/winedev-guide/wine-debugger
Hope this will help you.
Did you read the guide on using the Winde Debugger?
https://www.winehq.org/docs/winedev-guide/wine-debugger
Hope this will help you.
- olivierfrdierick
- Level 5
- Posts: 258
- Joined: Thu Sep 13, 2012 12:09 pm
Re: How do one use winedbg?
Yes, I did. It doesn't work like explained at all.
When I run winedbg program.exe it does show a winedbg> prompt in the output between fixmes of the program, but it returns to the shell immediately, the program still running in parallel as if the command wine program.exe was given. That is: it does not wait before executing the program and I don't have the opportunity to type any winedbg commands.
When I run winedbg in a second terminal while the program is running, I can attach to the process I want to debug, but I cannot input any commands except ctrl-c, that prints stopping debuggee in the terminal and that's all I can do, as I already described. I believe the process is actually stopped, because it does not crash and I have to kill it to stop wineserver, but it's useless if I cannot type any commands.
Edit: It does in fact work as explained, with another app, so the issue is either because the app I want to debug is multi-process/threaded, or because it is 64-bit, or the app itself prevents debugging.
When I run winedbg program.exe it does show a winedbg> prompt in the output between fixmes of the program, but it returns to the shell immediately, the program still running in parallel as if the command wine program.exe was given. That is: it does not wait before executing the program and I don't have the opportunity to type any winedbg commands.
When I run winedbg in a second terminal while the program is running, I can attach to the process I want to debug, but I cannot input any commands except ctrl-c, that prints stopping debuggee in the terminal and that's all I can do, as I already described. I believe the process is actually stopped, because it does not crash and I have to kill it to stop wineserver, but it's useless if I cannot type any commands.
Edit: It does in fact work as explained, with another app, so the issue is either because the app I want to debug is multi-process/threaded, or because it is 64-bit, or the app itself prevents debugging.