Peb->BeingDebugged and a debugger messing up

Markus Hitter mah at
Mon Sep 8 08:59:48 CDT 2008

Hello all,

after wrestling severals days with Wine's debugging capabilities I  
think I need some advice.

First, regardless wether my app (Catia) is launched with wine or  
winedbg, Peb->BeingDebugged is always False. To the best of my  
efforts I can't find the code snippet which  sets this variable or  
does some sort of probing for the correct value. Oddly enough, the  
app breaks into the debugger after creation of a new process, anyways.

As the app uses a launcher, I have the chance to set BeingDebugged  
explicitely to True. Some time later, after the app created a few  
threads, it's back to False. Are there applications out there setting  
this flag to what they think is best? Any other possible reasons for  
going BeingDebugged back to False while running in winedbg? None of  
the functions Wine provides and handles this variable appears to be  
called by the application.

Third thing is, Wine's attempt to auto-launch the debugger messes up.  
Not only if BeingDebugged is reported wrongly, it obviously runs in  
conflicts if launched due to a exception stack overflow. Is it really  
wise to launch it by triggering an interrupt in DbgBreakPoint()?

Short of better suggestions, I'd try to make debugger launching  
independent from Peb->BeingDebugged (server/kernel should know  
better), try to get rid of the interrupt in DbgBreakPoint() and/or  
make debugger autolaunching optional (at compile time).

What do you think?


- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter

More information about the wine-devel mailing list