ddd fixes
[fw/sdcc] / debugger / mcs51 / sdcdb.h
index c3bc3c206e4cb170a4cef7ea5531ecec35dc218b..b5afc122162031399e77c5bb00da52ae1b47c4bc 100644 (file)
 #ifndef  SDCDB_H
 #define  SDCDB_H
 
-/* #define SDCDB_DEBUG */
+#define SDCDB_DEBUG
+
+#ifdef SDCDB_DEBUG
+// set D_x to 0 to turn off, 1 to turn on.
+#define D_break  0x01
+#define D_simi   0x02
+#define D_sdcdb  0x04
+#define D_symtab 0x08
+
+extern int sdcdbDebug;
+
+#define Dprintf(f, fs) {if (f & sdcdbDebug) printf fs ; }
+#else
+#define Dprintf(f, fs) { }
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -48,20 +62,23 @@ typedef short bool;
 #define min(a,b) (a < b ? a : b)
 #endif
 
-#ifndef ALLOC
-#define  ALLOC(x,sz) if (!(x = calloc(1, sz)))                          \
-         {                                                           \
-            fprintf(stderr,"sdcdb: out of memory\n"); \
-            exit (1);                                                \
-         }
-#endif
-#ifndef ALLOC_ATOMIC
-#define ALLOC_ATOMIC(x,sz)   if (!(x = calloc(1, sz)))   \
-         {                                               \
-            fprintf(stderr,"sdcdb: out of memory\n"); \
-            exit (1);                                    \
-         }
-#endif
+/* 
+ * #ifndef ALLOC
+ * #define  ALLOC(x,sz) if (!(x = calloc(1, sz)))                          \
+ *          {                                                           \
+ *             fprintf(stderr,"sdcdb: out of memory\n"); \
+ *             exit (1);                                                \
+ *          }
+ * #endif
+ * #ifndef ALLOC_ATOMIC
+ * #define ALLOC_ATOMIC(x,sz)   if (!(x = calloc(1, sz)))   \
+ *          {                                               \
+ *             fprintf(stderr,"sdcdb: out of memory\n"); \
+ *             exit (1);                                    \
+ *          }
+ * #endif
+ */
+
 /* generalpurpose stack related macros */
 #define  STACK_DCL(stack,type,size)                   \
          typedef  type  t_##stack   ;                 \
@@ -211,6 +228,9 @@ extern set *modules  ; /* set of modules   */
 extern set *functions; /* set of functions */
 extern set *symbols  ; /* set of symbols */
 
+extern char *currModName ;
+extern short userinterrupt ;
+extern short showfull ;
 extern int nStructs ;
 extern struct structdef **structs ; /* all structures */
 extern char *ssdirl; /* source directory search path */