简体   繁体   中英

How can I detect gdb in windows c code?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM