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 t
I've just hit the same problem.
The workaround from the wiki is to run debugbreak
with the pid of the debugged process, but ps
doesn't show this pid, only pid of gdb. Maybe there is another way to obtain it.
But there is simpler workaround. Just start the program normally (not in gdb), check pid from ps
and start gdb with this pid as second argument.
When gdb is attached the process stops and I can print backtrace.