Peter Urbanec a écrit :
Dan Kegel wrote:
start winedbg without any app say 'bt all' in winedbg Voila, you now have backtraces for every process, including the hung one. It's your job to get that into a text file and remove the uninteresting ones...
I've also been trying to debug a multithreaded app. There are at least two complications that winedbg throws up:
Is now documented in http://bugs.winehq.org/show_bug.cgi?id=20617
As far as I can tell, winedbg will not allow you to switch the
current thread context. This means that even though you can get a backtrace of all threads in all processes, you actually can not examine the state of a specific thread.
I don't know enough about the internals of wine to go ahead and implement a "thread tid" command. I could manage the code in dbg.y and debug.l to implement the command line interface. When it comes to the actual implementation, I can sort of guess at what may need to be done there. However, I suspect that my naive attempts at an implementation are unlikely to produce an acceptable patch.
It can't be as simple as updating the value of dbg_curr_thread with the result of dbg_get_thread(dbg_curr_process, tid) and then calling GetThreadContext(dbg_curr_thread->handle, &dbg_context), can it?
the changes will need to be larger than that winedbg assumes throughout the code that it's stopped in a single thread but, if you change dbg_curr_thread, and enter the 'cont' command, you have to decide which thread should be resumed therefore, the changes imply to use two different objects: - the thread on which an exception occured - the thread you're currently examining and that's not a simple task moreover it'll be hard to understand the difference between the two above mentionned thread objects
so, finding another solution might be preferable what are the thread's missing information you were thinking of ?
A+