/* Hash table mapping symbol names to StgStablePtr */
static /*Str*/HashTable *stablehash;
-#if defined(GHCI) && defined(BREAKPOINT)
+#if defined(DEBUGGER)
/* Hash table mapping info table ptrs to DataCon names */
static HashTable *dchash;
#endif
/* -----------------------------------------------------------------------------
* Insert symbols into hash tables, checking for duplicates.
*/
+int isSuffixOf(char* x, char* suffix);
static void ghciInsertStrHashTable ( char* obj_name,
HashTable *table,
if (lookupHashTable(table, (StgWord)key) == NULL)
{
insertStrHashTable(table, (StgWord)key, data);
-#if defined(GHCI) && defined(BREAKPOINT)
+#if defined(DEBUGGER)
// Insert the reverse pair in the datacon hash if it is a closure
{
if(isSuffixOf(key, "static_info") || isSuffixOf(key, "con_info")) {
);
exit(1);
}
-
-#if defined(GHCI) && defined(BREAKPOINT)
-static void ghciInsertDCTable ( char* obj_name,
- StgWord key,
- char* data
- )
-{
- ghciInsertStrHashTable(obj_name, dchash, (char *)key, data);
-
-}
-#endif
/* -----------------------------------------------------------------------------
* initialize the object linker
*/
stablehash = allocStrHashTable();
symhash = allocStrHashTable();
-#if defined(GHCI) && defined(BREAKPOINT)
+#if defined(DEBUGGER)
dchash = allocHashTable();
#endif
}
}
-#if defined(GHCI) && defined(BREAKPOINT)
+#if defined(DEBUGGER)
char *
lookupDataCon( StgWord addr )
{
// that the actual sections end up aligned again.
oc->misalignment = machoGetMisalignment(f);
oc->image = stgMallocBytes(oc->fileSize + oc->misalignment, "loadObj(image)");
+ oc->image += oc->misalignment;
# else
oc->image = stgMallocBytes(oc->fileSize, "loadObj(image)");
# endif
#endif
-#if defined(GHCI) && defined(BREAKPOINT)
int isSuffixOf(char* x, char* suffix) {
int suffix_len = strlen (suffix);
int x_len = strlen (x);
char* x_suffix = &x[strlen(x)-strlen(suffix)];
return strcmp(x_suffix, suffix) == 0;
}
-#endif