/* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.58 2003/04/01 17:09:40 sof Exp $
+ * $Id: Printer.c,v 1.62 2003/11/12 17:49:08 sof Exp $
*
* (c) The GHC Team, 1994-2000.
*
#include "Storage.h"
#include "Bytecodes.h" /* for InstrPtr */
#include "Disassembler.h"
+#include "Apply.h"
#include <stdlib.h>
#include <string.h>
printClosure(obj);
}
-static inline void
+STATIC_INLINE void
printStdObjHdr( StgClosure *obj, char* tag )
{
fprintf(stderr,"%s(",tag);
#else
fprintf(stderr,"CONSTR(");
printPtr((StgPtr)obj->header.info);
- fprintf(stderr,"(tag=%d)",info->srt_len);
+ fprintf(stderr,"(tag=%d)",info->srt_bitmap);
#endif
for (i = 0; i < info->layout.payload.ptrs; ++i) {
fprintf(stderr,", ");
p = (P_)(r->payload);
printSmallBitmap(spBottom, sp,
- GET_LIVENESS(r->liveness), RET_DYN_SIZE);
- p += RET_DYN_SIZE;
+ GET_LIVENESS(r->liveness), RET_DYN_BITMAP_SIZE);
+ p += RET_DYN_BITMAP_SIZE + RET_DYN_NONPTR_REGS_SIZE;
for (size = GET_NONPTRS(dyn); size > 0; size--) {
fprintf(stderr," stk[%ld] (%p) = ", (long)(spBottom-p), p);
case RET_VEC_BIG:
barf("todo");
+ case RET_FUN:
+ {
+ StgFunInfoTable *fun_info;
+ StgRetFun *ret_fun;
+ nat size;
+
+ ret_fun = (StgRetFun *)sp;
+ fun_info = get_fun_itbl(ret_fun->fun);
+ size = ret_fun->size;
+ fprintf(stderr,"RET_FUN (%p) (type=%d)\n", ret_fun, fun_info->fun_type);
+ switch (fun_info->fun_type) {
+ case ARG_GEN:
+ printSmallBitmap(spBottom, sp+1,
+ BITMAP_BITS(fun_info->bitmap),
+ BITMAP_SIZE(fun_info->bitmap));
+ break;
+ case ARG_GEN_BIG:
+ printLargeBitmap(spBottom, sp+2,
+ (StgLargeBitmap *)fun_info->bitmap,
+ BITMAP_SIZE(fun_info->bitmap));
+ break;
+ default:
+ printSmallBitmap(spBottom, sp+1,
+ BITMAP_BITS(stg_arg_bitmaps[fun_info->fun_type]),
+ BITMAP_SIZE(stg_arg_bitmaps[fun_info->fun_type]));
+ break;
+ }
+ continue;
+ }
+
default:
+ fprintf(stderr, "unknown object %d\n", info->type);
barf("printStackChunk");
}
}
nat s, g;
P_ q, r;
bdescr *bd;
+#if defined(__GNUC__)
const int arr_size = 1024;
+#else
+#define arr_size 1024
+#endif
StgPtr arr[arr_size];
int i = 0;