]> git.ozlabs.org Git - ccan/blob - ccan/breakpoint/_info
5f5251e6ddc05d3124bf429c62115c7b140911d9
[ccan] / ccan / breakpoint / _info
1 #include <string.h>
2 #include "config.h"
3
4 /**
5  * breakpoint - break if the program is run under gdb.
6  *
7  * This code allows you to insert breakpoints within a program.  These will
8  * do nothing unless your program is run under GDB.
9  *
10  * License: CC0 (Public domain)
11  *
12  * Example:
13  *      #include <ccan/breakpoint/breakpoint.h>
14  *
15  *      int main(void)
16  *      {
17  *              breakpoint();
18  *              return 0;
19  *      }
20  */
21 int main(int argc, char *argv[])
22 {
23         /* Expect exactly one argument */
24         if (argc != 2)
25                 return 1;
26
27         if (strcmp(argv[1], "depends") == 0) {
28                 printf("ccan/compiler\n");
29                 return 0;
30         }
31
32         return 1;
33 }