projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix GHCi on PowerPC OS X
[ghc-hetmet.git]
/
rts
/
Linker.c
diff --git
a/rts/Linker.c
b/rts/Linker.c
index
45f5ff6
..
789093d
100644
(file)
--- a/
rts/Linker.c
+++ b/
rts/Linker.c
@@
-95,7
+95,7
@@
static /*Str*/HashTable *symhash;
/* Hash table mapping symbol names to StgStablePtr */
static /*Str*/HashTable *stablehash;
/* 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
/* Hash table mapping info table ptrs to DataCon names */
static HashTable *dchash;
#endif
@@
-817,6
+817,7
@@
static RtsSymbolVal rtsSyms[] = {
/* -----------------------------------------------------------------------------
* Insert symbols into hash tables, checking for duplicates.
*/
/* -----------------------------------------------------------------------------
* Insert symbols into hash tables, checking for duplicates.
*/
+int isSuffixOf(char* x, char* suffix);
static void ghciInsertStrHashTable ( char* obj_name,
HashTable *table,
static void ghciInsertStrHashTable ( char* obj_name,
HashTable *table,
@@
-827,7
+828,7
@@
static void ghciInsertStrHashTable ( char* obj_name,
if (lookupHashTable(table, (StgWord)key) == NULL)
{
insertStrHashTable(table, (StgWord)key, data);
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")) {
// Insert the reverse pair in the datacon hash if it is a closure
{
if(isSuffixOf(key, "static_info") || isSuffixOf(key, "con_info")) {
@@
-856,17
+857,6
@@
static void ghciInsertStrHashTable ( char* obj_name,
);
exit(1);
}
);
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
*/
/* -----------------------------------------------------------------------------
* initialize the object linker
*/
@@
-892,7
+882,7
@@
initLinker( void )
stablehash = allocStrHashTable();
symhash = allocStrHashTable();
stablehash = allocStrHashTable();
symhash = allocStrHashTable();
-#if defined(GHCI) && defined(BREAKPOINT)
+#if defined(DEBUGGER)
dchash = allocHashTable();
#endif
dchash = allocHashTable();
#endif
@@
-1113,7
+1103,7
@@
lookupSymbol( char *lbl )
}
}
}
}
-#if defined(GHCI) && defined(BREAKPOINT)
+#if defined(DEBUGGER)
char *
lookupDataCon( StgWord addr )
{
char *
lookupDataCon( StgWord addr )
{
@@
-1334,6
+1324,7
@@
loadObj( char *path )
// that the actual sections end up aligned again.
oc->misalignment = machoGetMisalignment(f);
oc->image = stgMallocBytes(oc->fileSize + oc->misalignment, "loadObj(image)");
// that the actual sections end up aligned again.
oc->misalignment = machoGetMisalignment(f);
oc->image = stgMallocBytes(oc->fileSize + oc->misalignment, "loadObj(image)");
+ oc->image += misalignment;
# else
oc->image = stgMallocBytes(oc->fileSize, "loadObj(image)");
# endif
# else
oc->image = stgMallocBytes(oc->fileSize, "loadObj(image)");
# endif
@@
-4407,7
+4398,6
@@
static int machoGetMisalignment( FILE * f )
#endif
#endif
-#if defined(GHCI) && defined(BREAKPOINT)
int isSuffixOf(char* x, char* suffix) {
int suffix_len = strlen (suffix);
int x_len = strlen (x);
int isSuffixOf(char* x, char* suffix) {
int suffix_len = strlen (suffix);
int x_len = strlen (x);
@@
-4422,4
+4412,3
@@
int isSuffixOf(char* x, char* suffix) {
char* x_suffix = &x[strlen(x)-strlen(suffix)];
return strcmp(x_suffix, suffix) == 0;
}
char* x_suffix = &x[strlen(x)-strlen(suffix)];
return strcmp(x_suffix, suffix) == 0;
}
-#endif