-/* -*- mode: hugs-c; -*- */
+
/* -----------------------------------------------------------------------------
- * $Id: Disassembler.c,v 1.3 1999/02/05 16:02:37 simonm Exp $
- *
- * Copyright (c) The GHC Team 1994-1999.
- *
* Bytecode disassembler
*
+ * Copyright (c) 1994-1998.
+ *
+ * $RCSfile: Disassembler.c,v $
+ * $Revision: 1.4 $
+ * $Date: 1999/03/01 14:47:05 $
* ---------------------------------------------------------------------------*/
#include "Rts.h"
static InstrPtr disConstChar ( StgBCO *bco, InstrPtr pc, char* i )
{
StgChar x = bcoConstChar(bco,bcoInstr(bco,pc++));
- fprintf(stderr,"%s '%c'",i,x);
+ if (isprint((int)x))
+ fprintf(stderr,"%s '%c'",i,x); else
+ fprintf(stderr,"%s 0x%x",i,(int)x);
return pc;
}
case i_VOID:
return disNone(bco,pc,"VOID");
-
case i_RETURN_GENERIC:
return disNone(bco,pc,"RETURN_GENERIC");
switch (op) {
case i_INTERNAL_ERROR1:
return disNone(bco,pc,"INTERNAL_ERROR1");
+ case i_pushseqframe:
+ return disNone(bco,pc,"i_pushseqframe");
+ case i_pushcatchframe:
+ return disNone(bco,pc,"i_pushcatchframe");
default:
{
const AsmPrim* p = asmFindPrimop(i_PRIMOP1,op);
return disNone(bco,pc,"ccall_Id");
case i_ccall_IO:
return disNone(bco,pc,"ccall_IO");
+ case i_raise:
+ return disNone(bco,pc,"primRaise");
default:
{
const AsmPrim* p = asmFindPrimop(i_PRIMOP2,op);
pc = disInstr(bco,pc);
fprintf(stderr,"\n");
}
+ if (bco->stgexpr) {
+ ppStgExpr(bco->stgexpr);
+ fprintf(stderr, "\n");
+ }
+ else
+ fprintf(stderr, "\t(handwritten bytecode)\n" );
}
#endif /* INTERPRETER */