X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fbreakpoint%2F_info;fp=ccan%2Fbreakpoint%2F_info;h=5f5251e6ddc05d3124bf429c62115c7b140911d9;hp=0000000000000000000000000000000000000000;hb=9552c972f725f70ab024e0c9d0487ff078322fd8;hpb=75786a7313a8ac224b7501d5cde841dbda16392e diff --git a/ccan/breakpoint/_info b/ccan/breakpoint/_info new file mode 100644 index 00000000..5f5251e6 --- /dev/null +++ b/ccan/breakpoint/_info @@ -0,0 +1,33 @@ +#include +#include "config.h" + +/** + * breakpoint - break if the program is run under gdb. + * + * This code allows you to insert breakpoints within a program. These will + * do nothing unless your program is run under GDB. + * + * License: CC0 (Public domain) + * + * Example: + * #include + * + * int main(void) + * { + * breakpoint(); + * return 0; + * } + */ +int main(int argc, char *argv[]) +{ + /* Expect exactly one argument */ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { + printf("ccan/compiler\n"); + return 0; + } + + return 1; +}