debugger build okay
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 29 Apr 2000 22:25:05 +0000 (22:25 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 29 Apr 2000 22:25:05 +0000 (22:25 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@238 4a8a32a2-be11-0410-ad9d-d568d2c75423

debugger/mcs51/Makefile.in
debugger/mcs51/sdcdb.c
debugger/mcs51/sdcdb.h

index a3d0d59dea0bbcf66d132c0b1d06dfeba759f04f..086ce97d5a72f2adf06fdd5142b10beb5238d138 100644 (file)
@@ -36,7 +36,8 @@ LIBDIRS         = -L$(PRJDIR)/support/gc
 
 
 OBJECTS                = sdcdb.o symtab.o simi.o $(PRJDIR)/src/SDCCset.o \
-                 break.o cmd.o $(PRJDIR)/src/SDCChasht.o
+                 break.o cmd.o $(PRJDIR)/src/SDCChasht.o \
+                 $(PRJDIR)/src/SDCCerr.o
 SOURCES                = $(patsubst %.o,%.c,$(OBJECTS))
 
 TARGET         = $(PRJDIR)/bin/sdcdb
index d86dcfc8f71efe12824349cd61c0e1341f4e9061..423e37eb94f457cce71718912391ce0d1989ab90 100644 (file)
@@ -42,6 +42,11 @@ char *ssdirl = SDCC_LIB_DIR ":" SDCC_LIB_DIR "/small" ;
 char *simArgs[8];
 int nsimArgs = 0;
 
+/* fake filename & lineno to make linker */
+char *filename=NULL;
+int lineno = 0;
+int fatalError = 0;
+
 /* command table */
 struct cmdtab
 {
@@ -142,6 +147,17 @@ struct cmdtab
     { "q"        ,  cmdQuit       , NULL }
 };
 
+/*-----------------------------------------------------------------*/
+/* gc_strdup - make a string duplicate garbage collector aware     */
+/*-----------------------------------------------------------------*/
+char *gc_strdup(const char *s)
+{
+    char *ret;
+    ALLOC_ATOMIC(ret, strlen(s)+1);
+    strcpy(ret, s);
+    return ret;
+}
+
 /*-----------------------------------------------------------------*/
 /* alloccpy - allocate copy and return a new string                */
 /*-----------------------------------------------------------------*/
index 1077cbec7b0dbb2ae666ae14bdfc770a9fc11733..9d15567828852a4999ec8c495403c31df588e925 100644 (file)
@@ -67,7 +67,13 @@ typedef short bool;
             exit (1);                                                \
          }
 #endif
-
+#ifndef ALLOC_ATOMIC
+#define ALLOC_ATOMIC(x,sz)   if (!(x = GC_malloc_atomic(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   ;                 \