X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Finterpreter%2Fstorage.c;h=696e117f597c4eb8d7e5a0342e116a9637823923;hb=b9daf612008be8a05925045c38b161fe2c9f1045;hp=95627f491275162ac621bfa02f1cd4aaf16553a0;hpb=d86b16ffc30730e4350154152d222a45ae47eaa8;p=ghc-hetmet.git diff --git a/ghc/interpreter/storage.c b/ghc/interpreter/storage.c index 95627f4..696e117 100644 --- a/ghc/interpreter/storage.c +++ b/ghc/interpreter/storage.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: storage.c,v $ - * $Revision: 1.69 $ - * $Date: 2000/04/11 16:36:53 $ + * $Revision: 1.70 $ + * $Date: 2000/04/12 09:37:19 $ * ------------------------------------------------------------------------*/ #include "hugsbasictypes.h" @@ -3002,6 +3002,27 @@ List args; { * debugging support * ------------------------------------------------------------------------*/ +/* Given the address of an info table, find the constructor/tuple + that it belongs to, and return the name. Only needed for debugging. +*/ +char* lookupHugsItblName ( void* v ) +{ + int i; + for (i = TYCON_BASE_ADDR; + i < TYCON_BASE_ADDR+tabTyconSz; ++i) { + if (tabTycon[i-TYCON_BASE_ADDR].inUse + && tycon(i).itbl == v) + return textToStr(tycon(i).text); + } + for (i = NAME_BASE_ADDR; + i < NAME_BASE_ADDR+tabNameSz; ++i) { + if (tabName[i-NAME_BASE_ADDR].inUse + && name(i).itbl == v) + return textToStr(name(i).text); + } + return NULL; +} + static String maybeModuleStr ( Module m ) { if (isModule(m)) return textToStr(module(m).text); else return "??";