summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorbjpop@csse.unimelb.edu.au <unknown>2007-02-20 19:07:31 +0000
committerbjpop@csse.unimelb.edu.au <unknown>2007-02-20 19:07:31 +0000
commit7d6dffe542bdad5707a929ae7ac25813c586766d (patch)
treea167904e8485c007e4d48b3f7ad72b8626a3e23e /includes
parent500fb9ad138112e8145d9f125f8c6d013f449205 (diff)
downloadhaskell-7d6dffe542bdad5707a929ae7ac25813c586766d.tar.gz
Constructor names in info tables
This patch adds data constructor names into their info tables. This is useful in the ghci debugger. It replaces the old scheme which was based on tracking data con names in the linker.
Diffstat (limited to 'includes')
-rw-r--r--includes/ClosureMacros.h5
-rw-r--r--includes/InfoTables.h16
-rw-r--r--includes/Linker.h3
3 files changed, 21 insertions, 3 deletions
diff --git a/includes/ClosureMacros.h b/includes/ClosureMacros.h
index f40f6aace6..cae5f13c2b 100644
--- a/includes/ClosureMacros.h
+++ b/includes/ClosureMacros.h
@@ -59,6 +59,7 @@
#define get_ret_itbl(c) (RET_INFO_PTR_TO_STRUCT((c)->header.info))
#define get_fun_itbl(c) (FUN_INFO_PTR_TO_STRUCT((c)->header.info))
#define get_thunk_itbl(c) (THUNK_INFO_PTR_TO_STRUCT((c)->header.info))
+#define get_con_itbl(c) (CON_INFO_PTR_TO_STRUCT((c)->header.info))
#define GET_TAG(con) (get_itbl(con)->srt_bitmap)
@@ -67,17 +68,21 @@
#define RET_INFO_PTR_TO_STRUCT(info) ((StgRetInfoTable *)(info) - 1)
#define FUN_INFO_PTR_TO_STRUCT(info) ((StgFunInfoTable *)(info) - 1)
#define THUNK_INFO_PTR_TO_STRUCT(info) ((StgThunkInfoTable *)(info) - 1)
+#define CON_INFO_PTR_TO_STRUCT(info) ((StgConInfoTable *)(info) - 1)
#define itbl_to_fun_itbl(i) ((StgFunInfoTable *)(((StgInfoTable *)(i) + 1)) - 1)
#define itbl_to_ret_itbl(i) ((StgRetInfoTable *)(((StgInfoTable *)(i) + 1)) - 1)
#define itbl_to_thunk_itbl(i) ((StgThunkInfoTable *)(((StgInfoTable *)(i) + 1)) - 1)
+#define itbl_to_con_itbl(i) ((StgConInfoTable *)(((StgInfoTable *)(i) + 1)) - 1)
#else
#define INFO_PTR_TO_STRUCT(info) ((StgInfoTable *)info)
#define RET_INFO_PTR_TO_STRUCT(info) ((StgRetInfoTable *)info)
#define FUN_INFO_PTR_TO_STRUCT(info) ((StgFunInfoTable *)info)
#define THUNK_INFO_PTR_TO_STRUCT(info) ((StgThunkInfoTable *)info)
+#define CON_INFO_PTR_TO_STRUCT(info) ((StgConInfoTable *)info)
#define itbl_to_fun_itbl(i) ((StgFunInfoTable *)(i))
#define itbl_to_ret_itbl(i) ((StgRetInfoTable *)(i))
#define itbl_to_thunk_itbl(i) ((StgThunkInfoTable *)(i))
+#define itbl_to_con_itbl(i) ((StgConInfoTable *)(i))
#endif
/* -----------------------------------------------------------------------------
diff --git a/includes/InfoTables.h b/includes/InfoTables.h
index 8fa699a097..ea01abf2d8 100644
--- a/includes/InfoTables.h
+++ b/includes/InfoTables.h
@@ -380,6 +380,22 @@ typedef struct _StgThunkInfoTable {
#endif
} StgThunkInfoTable;
+/* -----------------------------------------------------------------------------
+ Constructor info tables
+ -------------------------------------------------------------------------- */
+
+typedef struct _StgConInfoTable {
+#if !defined(TABLES_NEXT_TO_CODE)
+ StgInfoTable i;
+#endif
+
+char *con_desc; /* the name of the data constructor as: Package:Module.Name */
+
+#if defined(TABLES_NEXT_TO_CODE)
+ StgInfoTable i;
+#endif
+} StgConInfoTable;
+
/* -----------------------------------------------------------------------------
Accessor macros for fields that might be offsets (C version)
diff --git a/includes/Linker.h b/includes/Linker.h
index 624d389b17..681a7f9199 100644
--- a/includes/Linker.h
+++ b/includes/Linker.h
@@ -33,9 +33,6 @@ HsInt resolveObjs( void );
/* load a dynamic library */
char *addDLL( char* dll_name );
-/* lookup an address in the datacon tbl */
-char *lookupDataCon( StgWord addr);
-
extern void markRootPtrTable(void (*)(StgClosure **));
#endif /* LINKER_H */