1

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 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

huh, i saw that function but didnt think it'd work. just tried it and it did, lol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.