More debugger quesions

Eric Pouech pouech-eric at wanadoo.fr
Thu Jul 14 11:44:03 CDT 2005


Robert Lunnon a écrit :
> Well we are getting somewhere
> 
> When my test application segfaults the debugger attaches and runs through a 
> number of debug events eventually ariving at a segfault
> 
> strace:winedbg:dbg_handle_debug_event 00000008:00000009: loads DLL c:
> \windows\system\imm32.dll @7f440000 (0<0>)
> trace:winedbg:dbg_handle_debug_event 00000008:00000009: exception 
> code=80000003
> 
> Now I added some instrumentation and find the following happens IE 
> 
> trace:winedbg:dbg_handle_debug_event Continue on first exception is true
> trace:winedbg:dbg_handle_debug_event Breaking switch
> trace:winedbg:dbg_handle_debug_event Call ContinueDebugEvent
> trace:winedbg:dbg_handle_debug_event Continuing executio
> trace:winedbg:dbg_main_loop Wait for next debug event...
> 
> In this code at the top of dbg_main_loop
>     if (dbg_curr_process)
>         dbg_printf("WineDbg starting on pid 0x%lx\n", dbg_curr_pid);
> 
>     /* wait for first exception */
>     while (WaitForDebugEvent(&de, INFINITE))
>     {
>         WINE_TRACE("Calling handle_debug_event 2\n");
>         if (dbg_handle_debug_event(&de)) {WINE_TRACE("Event 
> handled\n");break;}
>     WINE_TRACE("Wait for next debug event...\n");
>     }
> 
> 
> Problem is that the client program is stopped, probably on a segfault trace 
> because I enable tracing (stops) on all machine faults and signals when I 
> attached it (this allows my replacement for wait4 to find out if a fault or 
> signal happened in the debuggee). Everything deadlocks then since the 
> debugger never continues the program after the exception (Or perhaps the 
> wineserver never gets a message to restart it)
> 
> Perhaps I don't understand the semantics of PTRACE wait4 interactions. Should 
> I just let the app trap machine faults ?

a couple of questions:
- when you call ContinueDebugEvent, did you change the causes that caused the 
crash (from the debugger) ? If not, it should segfault again (but I don't know 
what happens)
- after you called ContinueDebugEvent, the debuggee should be restarted. It 
isn't the case, so I'd start looking at ContinueDebugEvent in the server so see 
what fails (you may want to start with breakpoints instead of seg faults, as it 
may be easier to handle - except for some kludges -> see winedbg/break.c, when 
incrementing / decrementing EIP)

HTH

-- 
Eric Pouech




More information about the wine-devel mailing list