From d7de5701777c329e0798fa9e779d50ed63ef205a Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 18:27:35 +0000 Subject: [PATCH] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 5 +- bootstrap/unix-44/Heap.h | 6 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 6 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 162 +++++++++++++++++++++------ bootstrap/unix-44/Out.h | 4 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 5 +- bootstrap/unix-48/Heap.h | 6 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 6 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 162 +++++++++++++++++++++------ bootstrap/unix-48/Out.h | 4 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 5 +- bootstrap/unix-88/Heap.h | 6 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 162 +++++++++++++++++++++------ bootstrap/unix-88/Out.h | 4 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 5 +- bootstrap/windows-48/Heap.h | 6 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 6 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 162 +++++++++++++++++++++------ bootstrap/windows-48/Out.h | 4 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 5 +- bootstrap/windows-88/Heap.h | 6 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 162 +++++++++++++++++++++------ bootstrap/windows-88/Out.h | 4 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 890 insertions(+), 355 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 02716878..fb2ee9ee 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2270fec0..5b6e66ef 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index c9adb169..0e9118e3 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT32 Heap_heap; +static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 0df71d54..62f61978 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT32 Heap_allocated, Heap_heapsize; +import INT32 Heap_allocated; +import INT32 Heap_heap; +import INT32 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 03d205e0..529aeee2 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 3c1c580d..89339f66 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index a3718f79..8017c2e7 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5924f42f..d8d05354 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index e929a6e0..4d978eb5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7e829aa2..5597b3e3 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 6d72148a..dc9ab60c 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT32 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT32)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT32)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT32 tag, next, level, module; CHAR name[24]; INT32 bases[16]; INT32 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT32 addr) { - INT32 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 4, addr, INT32); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 108); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 108); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT32)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 8); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + __GET((ADDRESS)o - 4, addr, INT32); + Out_DumpTag(addr); +} + +typedef + INT32 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT32 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT32 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT32 caddr; + chunk__6 c = NIL; + INT32 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0b3a93df..80673194 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT32 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a825b8ec..9b35ef5a 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 5d752192..2b2fba4b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index bbca112c..bc3411f2 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 04c8767a..208d1fe8 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 02716878..fb2ee9ee 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2270fec0..5b6e66ef 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index c9adb169..0e9118e3 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT32 Heap_heap; +static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 0df71d54..62f61978 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT32 Heap_allocated, Heap_heapsize; +import INT32 Heap_allocated; +import INT32 Heap_heap; +import INT32 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 03d205e0..529aeee2 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 3c1c580d..89339f66 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index a3718f79..8017c2e7 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5924f42f..d8d05354 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 6b6144fc..c9f40056 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7e829aa2..5597b3e3 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 6d72148a..dc9ab60c 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT32 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT32)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT32)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT32 tag, next, level, module; CHAR name[24]; INT32 bases[16]; INT32 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT32 addr) { - INT32 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 4, addr, INT32); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 108); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 108); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT32)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 8); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + __GET((ADDRESS)o - 4, addr, INT32); + Out_DumpTag(addr); +} + +typedef + INT32 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT32 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT32 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT32 caddr; + chunk__6 c = NIL; + INT32 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0b3a93df..80673194 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT32 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a825b8ec..9b35ef5a 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 5d752192..2b2fba4b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index a91fe173..5df0abaa 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 24dacf51..d7570ee1 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index bed555a5..ead3b170 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index ba436b23..6ff0de64 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 3e929c3a..769d2d6b 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT64 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT64 Heap_heap; +static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b2018428..26424f29 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT64 Heap_allocated, Heap_heapsize; +import INT64 Heap_allocated; +import INT64 Heap_heap; +import INT64 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 884c7b0e..82b56235 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index e5803d29..f82ccfd0 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e3e6f1fe..faf1ba5e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index dc87be62..94982bd2 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 25e2e7c2..46bd1072 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c88953f2..a3223212 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 67eaad85..5b315327 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT64 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT64)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT64)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT64 tag, next, level, module; CHAR name[24]; INT64 bases[16]; INT64 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT64 addr) { - INT64 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 8, addr, INT64); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 192); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 192); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT64)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 16); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT64 addr; + __GET((ADDRESS)o - 8, addr, INT64); + Out_DumpTag(addr); +} + +typedef + INT64 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT64 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT64 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT64 caddr; + chunk__6 c = NIL; + INT64 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 208), {-8}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 208), {-8}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 32), {-8}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 56), {-8}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0126ef62..42ae59ed 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT64 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d695bda2..ef72c3b2 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 741cf3f7..fbc0ebdd 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index bd19d27b..6447e8ae 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 2cf87339..ff036fdd 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b4133ede..1193b13c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 7aaa4f5a..7571e510 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index c9adb169..0e9118e3 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT32 Heap_heap; +static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 0df71d54..62f61978 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT32 Heap_allocated, Heap_heapsize; +import INT32 Heap_allocated; +import INT32 Heap_heap; +import INT32 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 6d8570ec..e5fe836e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 3c1c580d..89339f66 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index a3718f79..8017c2e7 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5924f42f..d8d05354 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 6b6144fc..c9f40056 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7e829aa2..5597b3e3 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index f792315a..f215ffaf 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT32 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT32)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT32)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT32 tag, next, level, module; CHAR name[24]; INT32 bases[16]; INT32 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT32 addr) { - INT32 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 4, addr, INT32); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 108); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 108); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT32)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 8); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + __GET((ADDRESS)o - 4, addr, INT32); + Out_DumpTag(addr); +} + +typedef + INT32 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT32 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT32 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT32 caddr; + chunk__6 c = NIL; + INT32 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0b3a93df..80673194 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT32 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 661a3ff4..1e35e805 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 68347c6c..3362fba3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index a91fe173..5df0abaa 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 24dacf51..d7570ee1 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1c505c07..8dce3c01 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 337b30b5..32786d38 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 3e929c3a..769d2d6b 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT64 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT64 Heap_heap; +static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b2018428..26424f29 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT64 Heap_allocated, Heap_heapsize; +import INT64 Heap_allocated; +import INT64 Heap_heap; +import INT64 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 6e92bf1e..d3c5d8d1 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index e5803d29..f82ccfd0 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e3e6f1fe..faf1ba5e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index dc87be62..94982bd2 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 25e2e7c2..46bd1072 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c88953f2..a3223212 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d0afc5be..e8d8713a 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT64 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT64)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT64)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT64 tag, next, level, module; CHAR name[24]; INT64 bases[16]; INT64 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT64 addr) { - INT64 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 8, addr, INT64); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 192); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 192); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT64)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 16); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT64 addr; + __GET((ADDRESS)o - 8, addr, INT64); + Out_DumpTag(addr); +} + +typedef + INT64 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT64 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT64 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT64 caddr; + chunk__6 c = NIL; + INT64 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 208), {-8}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 208), {-8}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 32), {-8}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 56), {-8}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0126ef62..42ae59ed 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT64 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 59a4d3a4..53d2232c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 787e2dc2..e2b27d76 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index bd19d27b..6447e8ae 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 2cf87339..ff036fdd 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h