I want to turn certain debug statements on when i'm debugging with gdb and id rather not do it by hand. I found code using ptrace which will detect gdb on *nix, but that doesnt exist on windows. I am compiling with mingw gcc on windows.
1 Answer
Windows has a function named IsDebuggerPresent. I'm not sure it'll work with gdb, but assuming it uses the normal Windows functions, it should be fine.
1 Comment
chacham15
huh, i saw that function but didnt think it'd work. just tried it and it did, lol.