/* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.54 2002/12/11 15:36:45 simonmar Exp $
+ * $Id: Printer.c,v 1.57 2003/03/25 17:58:48 sof Exp $
*
* (c) The GHC Team, 1994-2000.
*
static void printStdObject( StgClosure *obj, char* tag );
static void printStdObjPayload( StgClosure *obj );
+#ifdef USING_LIBBFD
static void reset_table ( int size );
static void prepare_table ( void );
static void insert ( unsigned value, const char *name );
+#endif
#if 0 /* unused but might be useful sometime */
static rtsBool lookup_name ( char *name, unsigned *result );
static void enZcode ( char *in, char *out );
const char *name;
};
-static nat max_table_size;
static nat table_size;
static struct entry* table;
+#ifdef USING_LIBBFD
+static nat max_table_size;
+
static void reset_table( int size )
{
max_table_size = size;
table_size = 0;
- table = (struct entry *) malloc(size * sizeof(struct entry));
+ table = (struct entry *)stgMallocBytes(size * sizeof(struct entry), "Printer.c:reset_table()");
}
static void prepare_table( void )
table[table_size].name = name;
table_size = table_size + 1;
}
-
+#endif
#if 0
static rtsBool lookup_name( char *name, unsigned *result )
* rubbish like the obj-splitting symbols
*/
-static rtsBool isReal( flagword flags, const char *name )
+static rtsBool isReal( flagword flags STG_UNUSED, const char *name )
{
#if 0
/* ToDo: make this work on BFD */
return rtsFalse;
}
#else
- (void)flags; /* keep gcc -Wall happy */
if (*name == '\0' ||
(name[0] == 'g' && name[1] == 'c' && name[2] == 'c') ||
(name[0] == 'c' && name[1] == 'c' && name[2] == '.')) {
}
}
- free(symbol_table);
+ stgFree(symbol_table);
}
prepare_table();
}