1 /**************************************************************************/
2 /*                                                                        */
3 /*                                 OCaml                                  */
4 /*                                                                        */
5 /*   Contributed by Sylvain Le Gall for Lexifi                            */
6 /*                                                                        */
7 /*   Copyright 2008 Institut National de Recherche en Informatique et     */
8 /*     en Automatique.                                                    */
9 /*                                                                        */
10 /*   All rights reserved.  This file is distributed under the terms of    */
11 /*   the GNU Lesser General Public License version 2.1, with the          */
12 /*   special exception on linking described in the file LICENSE.          */
13 /*                                                                        */
14 /**************************************************************************/
15 
16 #include "windbug.h"
17 
debug_test(void)18 int debug_test (void)
19 {
20   static int debug_init = 0;
21   static int debug = 0;
22 
23 #ifdef DEBUG
24   if (!debug_init)
25   {
26     debug = (getenv("OCAMLDEBUG") != NULL);
27     debug_init = 1;
28   };
29 #endif
30 
31   return debug;
32 }
33