I'm on Windows, running GDB on an executable built under MinGW. The program has an infinite loop. I want to find it by hitting Ctrl-C. When I do, both the program and GDB exit. All the help on this subject seems to assume I'm on Linux.
A:
To find the infinite loop, you could try stepping through the execution until you get to a sequence that repeats indefinitely.
I'm not sure, but I think Ctrl-C should only stop the execution, not gdb itself...
I think there is a "handle" command that you can use to control how the interrupt signal is handled.
mandaleeka
2009-04-02 18:49:24
I know. I was hoping not to have to do that.
Mike Dunlavey
2009-04-02 18:50:49
You're right on both counts, but it doesn't seem to work in a Windows DOS-box.
Mike Dunlavey
2009-04-02 18:54:55
+1
A:
Which "shell" are you using? If you use the MSYS "rxvt" shell, the behavior is pretty much as you describe. Ctrl-C only works if you are running from a normal Windows command prompt.
Matthew Talbert
2009-08-13 16:58:42
That's useful information. I'm at a Windows command prompt, and it didn't seem to work, but I'll give it another try.
Mike Dunlavey
2009-08-13 23:38:46
You might also try "Console2". This should behave close to the Windows command prompt, but it's a lot prettier. I use gdb all the time with that, and never have any issues. https://sourceforge.net/projects/console/
Matthew Talbert
2009-08-14 02:38:31