Debugging totally broken with latest everything?
Ryan Johnson
ryan.johnson@cs.utoronto.ca
Mon Apr 15 22:32:00 GMT 2013
On 15/04/2013 1:14 PM, Christopher Faylor wrote:
> On Mon, Apr 15, 2013 at 05:03:17PM +0100, Dave Korn wrote:
>> Some notes on the above:
>>
>> The same happens with both the previous version and current snapshot of the
>> cygwin dll. It also happens with both current gdb and an old gdb
>> 6.8.0.20080328-cvs that I have lying around.
>>
>> The hw.exe in question is your bog-standard hello world, compiled with "-g
>> -O0" using gcc4-4.5.3-3.
>>
>> "kill -9" won't kill gdb; I have to use Windows task manager. If I've
>> attached gdb to the hung gdb, I can kill it from there using the "k" instruction.
>>
>> Anyone else having similar problems?
> You're probably seeing a known bug in gdb where it no longer works well
> when run from a console window. There is a race where gdb tries to get
> tty information from a stopped cygwin process. Although I didn't
> introduce the problem, I have tried to fix it from time to time without
> much luck.
I've also seen the problem, my workaround so far has been to ensure the
process is running again before attaching gdb to it (assuming you
stopped it with ^Z so that jobs -p could report its pid). Not that I
actually remember to do this most of the time...
> Debugging from mintty will probably work better.
That's a rather unfortunate interaction with the long-standing "feature"
that interrupting programs with ^C only works if gdb runs in a console
window (STC I used today is below in case I've gotten something wrong).
Am I missing some obvious workaround?
Ryan
STC: when compiling and running this:
#include <unistd.h>
#include <stdio.h>
int main() {
printf("pid: %d\n", getpid());
sleep(10);
}
... ^C does not break in (it exits normally) when gdb runs inside
mintty; putting in a cmd.exe window allows ^C to break in with SIGTRAP
(though the stack trace is utterly useless since the thread is in
windows land at that point).
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list