-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVerbose Diagnostics Lite.i7x
2913 lines (2502 loc) · 159 KB
/
Verbose Diagnostics Lite.i7x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Version 1 of Verbose Diagnostics Lite (for Glulx only) by Brady Garvin begins here.
"Additional detail in the messages for runtime problems, programming errors, block value errors, and so on, to the extent that such detail can be given without loading debug information files (compare Verbose Diagnostics)."
"with the support for block value errors courtesy of Esteban Montecristo"
Include Runtime Checks by Brady Garvin.
Include Low-Level Operations by Brady Garvin.
Include Low-Level Text by Brady Garvin.
Include Low-Level Linked Lists by Brady Garvin.
Include Low-Level Hash Tables by Brady Garvin.
Include Glulx Runtime Instrumentation Framework by Brady Garvin.
Include Call Stack Tracking by Brady Garvin.
Include Glk Interception by Brady Garvin.
Include Output Interception by Brady Garvin.
Include Out-of-Band State Protection by Brady Garvin.
Use authorial modesty.
Book "Copyright and License"
[Copyright 2013 Brady J. Garvin]
[This extension is released under the Creative Commons Attribution 3.0 Unported License (CC BY 3.0) so that it can qualify as a public Inform extension. See the LICENSE file included in the release for further details.]
Book "Extension Information"
Chapter "Use Options" - unindexed
Use a block value routine hash table size of at least 311 translates as (- Constant VDL_BLOCK_ROUTINE_HASH_SIZE={N}; -).
Use a indexed text routine hash table size of at least 311 translates as (- Constant VDL_IT_ROUTINE_HASH_SIZE={N}; -).
Use a relation routine hash table size of at least 311 translates as (- Constant VDL_REL_ROUTINE_HASH_SIZE={N}; -).
Use a memory stack routine hash table size of at least 311 translates as (- Constant VDL_MST_ROUTINE_HASH_SIZE={N}; -).
Use a printing routine hash table size of at least 311 translates as (- Constant VDL_PRINT_ROUTINE_HASH_SIZE={N}; -).
Use a miscellaneous routine hash table size of at least 311 translates as (- Constant VDL_MISC_ROUTINE_HASH_SIZE={N}; -).
Use a extra Glk stream state hash table size of at least 311 translates as (- Constant VDL_EXTRA_STREAM_STATE_HASH_SIZE={N}; -).
Use a extra Glk file reference state hash table size of at least 311 translates as (- Constant VDL_EXTRA_FREF_STATE_HASH_SIZE={N}; -).
To decide what number is the block value routine hash table size: (- VDL_BLOCK_ROUTINE_HASH_SIZE -).
To decide what number is the indexed text routine hash table size: (- VDL_IT_ROUTINE_HASH_SIZE -).
To decide what number is the relation routine hash table size: (- VDL_REL_ROUTINE_HASH_SIZE -).
To decide what number is the memory stack routine hash table size: (- VDL_MST_ROUTINE_HASH_SIZE -).
To decide what number is the printing routine hash table size: (- VDL_PRINT_ROUTINE_HASH_SIZE -).
To decide what number is the miscellaneous routine hash table size: (- VDL_MISC_ROUTINE_HASH_SIZE -).
To decide what number is the extra Glk stream state hash table size: (- VDL_EXTRA_STREAM_STATE_HASH_SIZE -).
To decide what number is the extra Glk file reference state hash table size: (- VDL_EXTRA_FREF_STATE_HASH_SIZE -).
Book "Runtime Checks"
Chapter "Messages" - unindexed
To fail at recognizing an extra Glk state serialization format:
say "[low-level runtime failure in]Verbose Diagnostics/Verbose Diagnostics Lite[with explanation]I attempted to deserialize my own copy of some Glk state from a temporary file, but found that the file doesn't adhere to a format I recognize.[terminating the story]".
Book "Runtime Problems" - unindexed
Responding to a runtime problem is a phrase nothing -> nothing that varies.
Chapter "Responding to a Runtime Problem" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a runtime problem (this is saying the call stack for a runtime problem):
say "[the call stack]".
Responding to a runtime problem is saying the call stack for a runtime problem.
Chapter "Responding to a Runtime Problem with a Breakpoint" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a runtime problem (this is forcing a breakpoint for a runtime problem):
force a breakpoint named "Runtime problem".
Responding to a runtime problem is forcing a breakpoint for a runtime problem.
Chapter "The Custom Runtime Problem Handler" - unindexed
Include (-
[ vdl_RTPHandler n par1 par2 par3 In i c;
enable_rte=true;
RunTimeProblem(n,par1,par2,par3,In,i,c);
(llo_getField((+ responding to a runtime problem +),1))();
];
-).
Chapter "Runtime Problem Handler Addresses" - unindexed
To decide what rule is the default runtime problem handler: (- RunTimeProblem -).
To decide what rule is the custom runtime problem handler: (- vdl_RTPHandler -).
Chapter "Shielding the Custom Runtime Problem Handler" - unindexed
A GRIF shielding rule (this is the substitute the custom runtime problem handler rule):
substitute the uninstrumented custom runtime problem handler for the instrumented default runtime problem handler.
Book "Programming Errors" - unindexed
Responding to a programming error is a phrase nothing -> nothing that varies.
Chapter "Responding to a Programming Error" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a programming error (this is saying the call stack for a programming error):
say "[line break][the call stack]".
Responding to a programming error is saying the call stack for a programming error.
Chapter "Responding to a Programming Error" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a programming error (this is forcing a breakpoint for a programming error):
force a breakpoint named "Programming error".
Responding to a programming error is forcing a breakpoint for a programming error.
Chapter "The Custom Programming Error Handler" - unindexed
Include (-
[ vdl_PEHandler crime obj id size p q;
RT__Err(crime,obj,id,size,p,q);
(llo_getField((+ responding to a programming error +),1))();
];
-).
Chapter "Programming Error Handler Addresses" - unindexed
To decide what rule is the default programming error handler: (- RT__Err -).
To decide what rule is the custom programming error handler: (- vdl_PEHandler -).
Chapter "Shielding the Custom Programming Error Handler" - unindexed
A GRIF shielding rule (this is the substitute the custom programming error handler rule):
substitute the uninstrumented custom programming error handler for the instrumented default programming error handler.
Book "Block Value Errors" - unindexed
[This is essentially what Esteban e-mailed in January of 2010, but tweaked to be more robust against changes to the Blk* implementations.]
Responding to a block value error is a phrase nothing -> nothing that varies.
Chapter "Responding to a Block Value Error" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a block value error (this is saying the call stack for a block value error):
say "[the call stack]".
Responding to a block value error is saying the call stack for a block value error.
Chapter "Responding to a Block Value Error" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a block value error (this is forcing a breakpoint for a block value error):
force a breakpoint named "Block value error".
Responding to a block value error is forcing a breakpoint for a block value error.
Chapter "The Custom Block Value Error Handler" - unindexed
Include (-
[ vdl_BVEHandler message;
print (string)message,"^";
(llo_getField((+ responding to a block value error +),1))();
];
-).
Chapter "Block Value Error Handler Addresses" - unindexed
To decide what number is the address of the custom block value error handler: (- vdl_BVEHandler -).
Chapter "Block Value Routines of Interest" - unindexed
The block value routine hash table is a hash table that varies.
A GRIF setup rule (this is the allocate a hash table for block value routine identification rule):
now the block value routine hash table is a new hash table with the block value routine hash table size buckets;
insert the key the address of I6_BlkAllocate into the block value routine hash table;
insert the key the address of I6_BlkAllocationError into the block value routine hash table;
insert the key the address of I6_BlkDebug into the block value routine hash table;
insert the key the address of I6_BlkDebugDecomposition into the block value routine hash table;
insert the key the address of I6_BlkFree into the block value routine hash table;
insert the key the address of I6_BlkFreeSingleBlock into the block value routine hash table;
insert the key the address of I6_BlkMerge into the block value routine hash table;
insert the key the address of I6_BlkRecut into the block value routine hash table;
insert the key the address of I6_BlkResize into the block value routine hash table;
insert the key the address of I6_BlkSize into the block value routine hash table;
insert the key the address of I6_BlkTotalSize into the block value routine hash table;
insert the key the address of I6_BlkType into the block value routine hash table;
insert the key the address of I6_BlkValueCast into the block value routine hash table;
insert the key the address of I6_BlkValueCompare into the block value routine hash table;
insert the key the address of I6_BlkValueCopy into the block value routine hash table;
insert the key the address of I6_BlkValueCreate into the block value routine hash table;
insert the key the address of I6_BlkValueDestroy into the block value routine hash table;
insert the key the address of I6_BlkValueExtent into the block value routine hash table;
insert the key the address of I6_BlkValueHash into the block value routine hash table;
insert the key the address of I6_BlkValueInitialCopy into the block value routine hash table;
insert the key the address of I6_BlkValueRead into the block value routine hash table;
insert the key the address of I6_BlkValueReadFromFile into the block value routine hash table;
insert the key the address of I6_BlkValueSetExtent into the block value routine hash table;
insert the key the address of I6_BlkValueWrite into the block value routine hash table;
insert the key the address of I6_BlkValueWriteToFile into the block value routine hash table.
Chapter "Block Value Routine Instrumentation" - unindexed
Section "The Block Value Error Suffix" - unindexed
To decide what text is the first nonsynthetic block value error suffix: (- "***" -).
To decide what text is the second nonsynthetic block value error suffix: (- "***^" -).
The first block value error suffix is a text that varies.
The second block value error suffix is a text that varies.
A GRIF setup rule (this is the allocate the synthetic text for the block value error suffix rule):
now the first block value error suffix is a new synthetic text copied from the first nonsynthetic block value error suffix;
now the second block value error suffix is a new synthetic text copied from the second nonsynthetic block value error suffix.
Section "Block Value Routine Instrumentation Proper" - unindexed
[ !From @streamstr <parameter-zero>; ]
[ @callfi vdl_BVEHandler <moved-from-parameter-zero> 0; ]
To replace (A - an instruction vertex) with a block value error handler invocation if it is printing a block value error:
if the addressing mode of parameter zero of A is the constant addressing mode:
let the message be parameter zero of A converted to some text;
let the synthetic message be a new synthetic text copied from the message;
if the synthetic text the synthetic message ends with the synthetic text the first block value error suffix or the synthetic text the synthetic message ends with the synthetic text the second block value error suffix:
write the operation code op-callfi to A;
write the addressing mode constant addressing mode to parameter zero of A;
write the address of the custom block value error handler to parameter zero of A;
write the addressing mode constant addressing mode to parameter one of A;
write the (the message converted to a number) to parameter one of A;
write the addressing mode zero-or-discard addressing mode to parameter two of A;
delete the synthetic text the synthetic message.
A GRIF Instrumentation rule (this is the replace error-printing statements with error handler invocations in block value routines rule):
if the block value routine hash table contains the key the address of the chunk being instrumented:
repeat with the instruction vertex running through occurrences of the operation code op-streamstr in the scratch space:
replace the instruction vertex with a block value error handler invocation if it is printing a block value error.
Chapter "Shielding the Custom Block Value Error Handler" - unindexed
A GRIF shielding rule (this is the shield the custom block value error handler rule):
shield the address of the custom block value error handler against instrumentation.
Book "Indexed Text Errors" - unindexed
Responding to a indexed text error is a phrase nothing -> nothing that varies.
Chapter "Responding to a Indexed Text Error" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a indexed text error (this is saying the call stack for a indexed text error):
say "[the call stack]".
Responding to a indexed text error is saying the call stack for a indexed text error.
Chapter "Responding to a Indexed Text Error" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a indexed text error (this is forcing a breakpoint for a indexed text error):
force a breakpoint named "Indexed text error".
Responding to a indexed text error is forcing a breakpoint for a indexed text error.
Chapter "The Custom Indexed Text Error Handler" - unindexed
Include (-
[ vdl_IndexedTextHandler message;
print (string)message,"^";
(llo_getField((+ responding to a indexed text error +),1))();
];
-).
Chapter "Indexed Text Error Handler Addresses" - unindexed
To decide what number is the address of the custom indexed text error handler: (- vdl_IndexedTextHandler -).
Chapter "Indexed Text Routines of Interest" - unindexed
The indexed text routine hash table is a hash table that varies.
A GRIF setup rule (this is the allocate a hash table for indexed text routine identification rule):
now the indexed text routine hash table is a new hash table with the indexed text routine hash table size buckets;
insert the key the address of I6_IT_BlobAccess into the indexed text routine hash table;
insert the key the address of I6_IT_GetBlob into the indexed text routine hash table;
insert the key the address of I6_IT_ReplaceBlob into the indexed text routine hash table;
insert the key the address of I6_IT_ReplaceText into the indexed text routine hash table;
insert the key the address of I6_IT_CharacterLength into the indexed text routine hash table;
insert the key the address of I6_IT_GetCharacter into the indexed text routine hash table;
insert the key the address of I6_IT_CharactersOfCase into the indexed text routine hash table;
insert the key the address of I6_IT_CharactersToCase into the indexed text routine hash table;
insert the key the address of I6_IT_Concatenate into the indexed text routine hash table;
insert the key the address of I6_IT_RE_SetTrace into the indexed text routine hash table;
insert the key the address of I6_IT_RE_Node into the indexed text routine hash table;
insert the key the address of I6_IT_RE_NodeAddress into the indexed text routine hash table;
insert the key the address of I6_IT_RE_DebugMatchVars into the indexed text routine hash table;
insert the key the address of I6_IT_RE_CreateMatchVars into the indexed text routine hash table;
insert the key the address of I6_IT_RE_EmptyMatchVars into the indexed text routine hash table;
insert the key the address of I6_IT_RE_GetMatchVar into the indexed text routine hash table;
insert the key the address of I6_IT_MV_End into the indexed text routine hash table;
insert the key the address of I6_IT_RE_Clear_Markers into the indexed text routine hash table;
insert the key the address of I6_IT_RE_DebugTree into the indexed text routine hash table;
insert the key the address of I6_IT_RE_DebugSubtree into the indexed text routine hash table;
insert the key the address of I6_IT_RE_DebugNode into the indexed text routine hash table;
insert the key the address of I6_IT_CHR_CompileTree into the indexed text routine hash table;
insert the key the address of I6_IT_RE_CompileTree into the indexed text routine hash table;
insert the key the address of I6_IT_RE_RangeSyntaxCorrect into the indexed text routine hash table;
insert the key the address of I6_IT_RE_ExpandChoices into the indexed text routine hash table;
insert the key the address of I6_IT_RE_CheckTree into the indexed text routine hash table;
insert the key the address of I6_IT_RE_Width into the indexed text routine hash table;
insert the key the address of I6_IT_RE_PrintNoRewinds into the indexed text routine hash table;
insert the key the address of I6_IT_RE_Parse into the indexed text routine hash table;
insert the key the address of I6_IT_RE_ParseAtPosition into the indexed text routine hash table;
insert the key the address of I6_IT_RE_SeekBacktrack into the indexed text routine hash table;
insert the key the address of I6_IT_RE_FailSubexpressions into the indexed text routine hash table;
insert the key the address of I6_IT_RE_EraseConstraints into the indexed text routine hash table;
insert the key the address of I6_IT_RE_MatchSubstring into the indexed text routine hash table;
insert the key the address of I6_IT_RE_Range into the indexed text routine hash table;
insert the key the address of I6_IT_Replace_RE into the indexed text routine hash table;
insert the key the address of I6_IT_RE_Concatenate into the indexed text routine hash table.
Chapter "Indexed Text Routine Instrumentation" - unindexed
Section "The Indexed Text Error Suffixes" - unindexed
To decide what text is the first nonsynthetic indexed text error suffix: (- "***" -).
To decide what text is the second nonsynthetic indexed text error suffix: (- "***^" -).
To decide what text is the third nonsynthetic indexed text error suffix: (- "OVERFLOW^" -).
The first indexed text error suffix is a text that varies.
The second indexed text error suffix is a text that varies.
The third indexed text error suffix is a text that varies.
A GRIF setup rule (this is the allocate the synthetic text for the indexed text error suffixes rule):
now the first indexed text error suffix is a new synthetic text copied from the first nonsynthetic indexed text error suffix;
now the second indexed text error suffix is a new synthetic text copied from the second nonsynthetic indexed text error suffix;
now the third indexed text error suffix is a new synthetic text copied from the third nonsynthetic indexed text error suffix.
Section "Indexed Text Routine Instrumentation Proper" - unindexed
[ !From @streamstr <parameter-zero>; ]
[ @callfi vdl_IndexedTextHandler <moved-from-parameter-zero> 0; ]
To replace (A - an instruction vertex) with an indexed text error handler invocation if it is printing an indexed text error:
if the addressing mode of parameter zero of A is the constant addressing mode:
let the message be parameter zero of A converted to some text;
let the synthetic message be a new synthetic text copied from the message;
if the synthetic text the synthetic message ends with the synthetic text the first indexed text error suffix or the synthetic text the synthetic message ends with the synthetic text the second indexed text error suffix or the synthetic text the synthetic message ends with the synthetic text the third indexed text error suffix:
write the operation code op-callfi to A;
write the addressing mode constant addressing mode to parameter zero of A;
write the address of the custom indexed text error handler to parameter zero of A;
write the addressing mode constant addressing mode to parameter one of A;
write the (the message converted to a number) to parameter one of A;
write the addressing mode zero-or-discard addressing mode to parameter two of A;
delete the synthetic text the synthetic message.
A GRIF Instrumentation rule (this is the replace error-printing statements with error handler invocations in indexed text routines rule):
if the indexed text routine hash table contains the key the address of the chunk being instrumented:
repeat with the instruction vertex running through occurrences of the operation code op-streamstr in the scratch space:
replace the instruction vertex with an indexed text error handler invocation if it is printing an indexed text error.
Chapter "Shielding the Custom Indexed Text Error Handler" - unindexed
A GRIF shielding rule (this is the shield the custom indexed text error handler rule):
shield the address of the custom indexed text error handler against instrumentation.
Book "Relation Errors" - unindexed
Responding to a relation error is a phrase nothing -> nothing that varies.
Chapter "Responding to a Relation Error" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a relation error (this is saying the call stack for a relation error):
say "[the call stack]".
Responding to a relation error is saying the call stack for a relation error.
Chapter "Responding to a Relation Error" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a relation error (this is forcing a breakpoint for a relation error):
force a breakpoint named "Relation error".
Responding to a relation error is forcing a breakpoint for a relation error.
Chapter "The Custom Relation Error Handler" - unindexed
Include (-
[ vdl_RelationHandler message;
print (string)message,"^";
(llo_getField((+ responding to a relation error +),1))();
];
-).
Chapter "Relation Error Handler Addresses" - unindexed
To decide what number is the address of the custom relation error handler: (- vdl_RelationHandler -).
Chapter "Relation Routines of Interest" - unindexed
The relation routine hash table is a hash table that varies.
A GRIF setup rule (this is the allocate a hash table for relation routine identification rule):
now the relation routine hash table is a new hash table with the relation routine hash table size buckets;
insert the key the address of I6_RelationTest into the relation routine hash table;
insert the key the address of I6_EmptyRelationHandler into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Support into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Create into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Destroy into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Copy into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Compare into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Distinguish into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Say into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Name into the relation routine hash table;
insert the key the address of I6_ChooseRelationHandler into the relation routine hash table;
insert the key the address of I6_RELATION_TY_SetValency into the relation routine hash table;
insert the key the address of I6_RELATION_TY_GetValency into the relation routine hash table;
insert the key the address of I6_DoubleHashSetRelationHandler into the relation routine hash table;
insert the key the address of I6_DoubleHashSetLookUp into the relation routine hash table;
insert the key the address of I6_DoubleHashSetCheckResize into the relation routine hash table;
insert the key the address of I6_DoubleHashSetEntryMatches into the relation routine hash table;
insert the key the address of I6_HashListRelationHandler into the relation routine hash table;
insert the key the address of I6_HashTableRelationHandler into the relation routine hash table;
insert the key the address of I6_ReversedHashTableRelationHandler into the relation routine hash table;
insert the key the address of I6_SymDoubleHashSetRelationHandler into the relation routine hash table;
insert the key the address of I6_SymHashListRelationHandler into the relation routine hash table;
insert the key the address of I6_Sym2in1HashTableRelationHandler into the relation routine hash table;
insert the key the address of I6_HashCoreRelationHandler into the relation routine hash table;
insert the key the address of I6_HashCoreLookUp into the relation routine hash table;
insert the key the address of I6_HashCoreCheckResize into the relation routine hash table;
insert the key the address of I6_HashCoreEntryMatches into the relation routine hash table;
insert the key the address of I6_EquivHashTableRelationHandler into the relation routine hash table;
insert the key the address of I6_TwoInOneHashTableRelationHandler into the relation routine hash table;
insert the key the address of I6_TwoInOneDelete into the relation routine hash table;
insert the key the address of I6_TwoInOneLookUp into the relation routine hash table;
insert the key the address of I6_TwoInOneCheckResize into the relation routine hash table;
insert the key the address of I6_TwoInOneEntryMatches into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Support into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Say into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Name into the relation routine hash table;
insert the key the address of I6_RELATION_TY_Empty into the relation routine hash table;
insert the key the address of I6_RELATION_TY_EquivalenceAdjective into the relation routine hash table;
insert the key the address of I6_RELATION_TY_SymmetricAdjective into the relation routine hash table;
insert the key the address of I6_RELATION_TY_OToOAdjective into the relation routine hash table;
insert the key the address of I6_RELATION_TY_OToVAdjective into the relation routine hash table;
insert the key the address of I6_RELATION_TY_VToOAdjective into the relation routine hash table;
insert the key the address of I6_RELATION_TY_VToVAdjective into the relation routine hash table;
insert the key the address of I6_Relation_Now1to1 into the relation routine hash table;
insert the key the address of I6_Relation_NowN1toV into the relation routine hash table;
insert the key the address of I6_Relation_Now1to1V into the relation routine hash table;
insert the key the address of I6_Relation_NowN1toVV into the relation routine hash table;
insert the key the address of I6_Relation_NowS1to1 into the relation routine hash table;
insert the key the address of I6_Relation_NowSN1to1 into the relation routine hash table;
insert the key the address of I6_Relation_NowS1to1V into the relation routine hash table;
insert the key the address of I6_Relation_NowSN1to1V into the relation routine hash table;
insert the key the address of I6_Relation_NowVtoV into the relation routine hash table;
insert the key the address of I6_Relation_NowNVtoV into the relation routine hash table;
insert the key the address of I6_Relation_TestVtoV into the relation routine hash table;
insert the key the address of I6_Relation_NowEquiv into the relation routine hash table;
insert the key the address of I6_Relation_NowNEquiv into the relation routine hash table;
insert the key the address of I6_Relation_NowEquivV into the relation routine hash table;
insert the key the address of I6_Relation_NowNEquivV into the relation routine hash table;
insert the key the address of I6_Relation_ShowVtoV into the relation routine hash table;
insert the key the address of I6_Relation_ShowOtoO into the relation routine hash table;
insert the key the address of I6_Relation_RShowOtoO into the relation routine hash table;
insert the key the address of I6_RSE_Flip into the relation routine hash table;
insert the key the address of I6_RSE_Set into the relation routine hash table;
insert the key the address of I6_Relation_ShowEquiv into the relation routine hash table;
insert the key the address of I6_SignalMapChange into the relation routine hash table;
insert the key the address of I6_MapRouteTo into the relation routine hash table;
insert the key the address of I6_FastRouteTo into the relation routine hash table;
insert the key the address of I6_FastCountRouteTo into the relation routine hash table;
insert the key the address of I6_ComputeFWMatrix into the relation routine hash table;
insert the key the address of I6_SlowRouteTo into the relation routine hash table;
insert the key the address of I6_SlowCountRouteTo into the relation routine hash table;
insert the key the address of I6_RelationRouteTo into the relation routine hash table;
insert the key the address of I6_RelFollowVector into the relation routine hash table;
insert the key the address of I6_OtoVRelRouteTo into the relation routine hash table;
insert the key the address of I6_VtoORelRouteTo into the relation routine hash table;
insert the key the address of I6_VtoVRelRouteTo into the relation routine hash table;
insert the key the address of I6_FastVtoVRelRouteTo into the relation routine hash table;
insert the key the address of I6_IterateRelations into the relation routine hash table.
Chapter "Relation Routine Instrumentation" - unindexed
Section "The Relation Error Suffix" - unindexed
To decide what text is the first nonsynthetic relation error suffix: (- "***" -).
To decide what text is the second nonsynthetic relation error suffix: (- "***^" -).
The first relation error suffix is a text that varies.
The second relation error suffix is a text that varies.
A GRIF setup rule (this is the allocate the synthetic text for the relation error suffix rule):
now the first relation error suffix is a new synthetic text copied from the first nonsynthetic relation error suffix;
now the second relation error suffix is a new synthetic text copied from the second nonsynthetic relation error suffix.
Section "Relation Routine Instrumentation Proper" - unindexed
[ !From @streamstr <parameter-zero>; ]
[ @callfi vdl_RelationHandler <moved-from-parameter-zero> 0; ]
To replace (A - an instruction vertex) with a relation error handler invocation if it is printing a relation error:
if the addressing mode of parameter zero of A is the constant addressing mode:
let the message be parameter zero of A converted to some text;
let the synthetic message be a new synthetic text copied from the message;
if the synthetic text the synthetic message ends with the synthetic text the first relation error suffix or the synthetic text the synthetic message ends with the synthetic text the second relation error suffix:
write the operation code op-callfi to A;
write the addressing mode constant addressing mode to parameter zero of A;
write the address of the custom relation error handler to parameter zero of A;
write the addressing mode constant addressing mode to parameter one of A;
write the (the message converted to a number) to parameter one of A;
write the addressing mode zero-or-discard addressing mode to parameter two of A;
delete the synthetic text the synthetic message.
A GRIF Instrumentation rule (this is the replace error-printing statements with error handler invocations in relation routines rule):
if the relation routine hash table contains the key the address of the chunk being instrumented:
repeat with the instruction vertex running through occurrences of the operation code op-streamstr in the scratch space:
replace the instruction vertex with a relation error handler invocation if it is printing a relation error.
Chapter "Shielding the Custom Relation Error Handler" - unindexed
A GRIF shielding rule (this is the shield the custom relation error handler rule):
shield the address of the custom relation error handler against instrumentation.
Book "Memory Stack Errors" - unindexed
Responding to a memory stack error is a phrase nothing -> nothing that varies.
Chapter "Responding to a Memory Stack Error" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a memory stack error (this is saying the call stack for a memory stack error):
say "[the call stack]".
Responding to a memory stack error is saying the call stack for a memory stack error.
Chapter "Responding to a Memory Stack Error" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a memory stack error (this is forcing a breakpoint for a memory stack error):
force a breakpoint named "Memory stack error".
Responding to a memory stack error is forcing a breakpoint for a memory stack error.
Chapter "The Custom Memory Stack Error Handler" - unindexed
Include (-
[ vdl_MemoryStackHandler;
print "^^";
(llo_getField((+ responding to a memory stack error +),1))();
];
-).
Chapter "Memory Stack Error Handler Addresses" - unindexed
To decide what number is the address of the custom memory stack error handler: (- vdl_MemoryStackHandler -).
Chapter "Memory Stack Routines of Interest" - unindexed
The memory stack routine hash table is a hash table that varies.
A GRIF setup rule (this is the allocate a hash table for memory stack routine identification rule):
now the memory stack routine hash table is a new hash table with the memory stack routine hash table size buckets;
insert the key the address of I6_MstVO into the memory stack routine hash table;
insert the key the address of I6_MstVON into the memory stack routine hash table.
Chapter "Memory Stack Routine Instrumentation" - unindexed
Section "The Memory Stack Error Suffix" - unindexed
To decide what text is the nonsynthetic memory stack error suffix: (- "^" -).
The memory stack error suffix is a text that varies.
A GRIF setup rule (this is the allocate the synthetic text for the memory stack error suffix rule):
now the memory stack error suffix is a new synthetic text copied from the nonsynthetic memory stack error suffix.
Section "Memory Stack Routine Instrumentation Proper" - unindexed
[ !From @streamstr <parameter-zero>; ]
[ @callf vdl_MemoryStackHandler 0; ]
To replace (A - an instruction vertex) with a memory stack error handler invocation if it is printing a memory stack error:
if the addressing mode of parameter zero of A is the constant addressing mode:
let the message be parameter zero of A converted to some text;
let the synthetic message be a new synthetic text copied from the message;
if the synthetic text the synthetic message ends with the synthetic text the memory stack error suffix:
write the operation code op-callf to A;
write the addressing mode constant addressing mode to parameter zero of A;
write the address of the custom memory stack error handler to parameter zero of A;
write the addressing mode zero-or-discard addressing mode to parameter one of A;
delete the synthetic text the synthetic message.
A GRIF Instrumentation rule (this is the replace error-printing statements with error handler invocations in memory stack routines rule):
if the memory stack routine hash table contains the key the address of the chunk being instrumented:
repeat with the instruction vertex running through occurrences of the operation code op-streamstr in the scratch space:
replace the instruction vertex with a memory stack error handler invocation if it is printing a memory stack error.
Chapter "Shielding the Custom Memory Stack Error Handler" - unindexed
A GRIF shielding rule (this is the shield the custom memory stack error handler rule):
shield the address of the custom memory stack error handler against instrumentation.
Book "Printing Errors" - unindexed
Responding to a printing error is a phrase nothing -> nothing that varies.
Chapter "Responding to a Printing Error" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a printing error (this is saying the call stack for a printing error):
say "[the call stack]".
Responding to a printing error is saying the call stack for a printing error.
Chapter "Responding to a Printing Error" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a printing error (this is forcing a breakpoint for a printing error):
force a breakpoint named "Printing error".
Responding to a printing error is forcing a breakpoint for a printing error.
Chapter "The Custom Printing Error Handler" - unindexed
Include (-
[ vdl_PrintingErrorHandler message;
print (string)message,"^";
(llo_getField((+ responding to a printing error +),1))();
];
-).
Chapter "Printing Error Handler Addresses" - unindexed
To decide what number is the address of the custom printing error handler: (- vdl_PrintingErrorHandler -).
Chapter "Printing Routines of Interest" - unindexed
The printing routine hash table is a hash table that varies.
A GRIF setup rule (this is the allocate a hash table for printing routine identification rule):
now the printing routine hash table is a new hash table with the printing routine hash table size buckets;
insert the key the address of I6_VM_PrintToBuffer into the printing routine hash table.
Chapter "Printing Routine Instrumentation" - unindexed
Section "The Printing Error Prefix" - unindexed
To decide what text is the nonsynthetic printing error prefix: (- "Error: " -).
The printing error prefix is a text that varies.
A GRIF setup rule (this is the allocate the synthetic text for the printing error prefix rule):
now the printing error prefix is a new synthetic text copied from the nonsynthetic printing error prefix.
Section "Printing Routine Instrumentation Proper" - unindexed
[ !From @streamstr <parameter-zero>; ]
[ @callfi vdl_PrintingErrorHandler <moved-from-parameter-zero> 0; ]
To replace (A - an instruction vertex) with a printing error handler invocation if it is printing a printing error:
if the addressing mode of parameter zero of A is the constant addressing mode:
let the message be parameter zero of A converted to some text;
let the synthetic message be a new synthetic text copied from the message;
if the synthetic text the synthetic message begins with the synthetic text the printing error prefix:
write the operation code op-callfi to A;
write the addressing mode constant addressing mode to parameter zero of A;
write the address of the custom printing error handler to parameter zero of A;
write the addressing mode constant addressing mode to parameter one of A;
write the (the message converted to a number) to parameter one of A;
write the addressing mode zero-or-discard addressing mode to parameter two of A;
delete the synthetic text the synthetic message.
A GRIF Instrumentation rule (this is the replace error-printing statements with error handler invocations in printing routines rule):
if the printing routine hash table contains the key the address of the chunk being instrumented:
repeat with the instruction vertex running through occurrences of the operation code op-streamstr in the scratch space:
replace the instruction vertex with a printing error handler invocation if it is printing a printing error.
Chapter "Shielding the Custom Printing Error Handler" - unindexed
A GRIF shielding rule (this is the shield the custom printing error handler rule):
shield the address of the custom printing error handler against instrumentation.
Book "Glk Errors" - unindexed
Responding to a Glk error is a phrase nothing -> nothing that varies.
The Glk error state is some text that varies. The Glk error state is "".
The Glk error function selector is a number that varies.
To signal the Glk error (T - some text):
now the Glk error state is T;
apply responding to a Glk error.
Chapter "Responding to a Glk Error" - unindexed (for use without Interactive Debugger by Brady Garvin)
[We use the word ``print'' to avoid an Inform bug in 6G60.]
To print the call stack for a Glk error (this is saying the call stack for a Glk error):
say "[the Glk error state][line break](within the interpreter, under [the Glk function name for the selector the Glk error function selector],)[line break][the call stack]".
Responding to a Glk error is saying the call stack for a Glk error.
Chapter "Responding to a Glk Error" - unindexed (for use with Interactive Debugger by Brady Garvin)
To force a breakpoint for a Glk error (this is forcing a breakpoint for a Glk error):
force a breakpoint named "Glk error: [the Glk error state]".
Responding to a Glk error is forcing a breakpoint for a Glk error.
Chapter "Known Glk Function Names" - unindexed
Include (-
[ vdl_glkName selector;
switch(selector){
4:
print "glk_gestalt";
5:
print "glk_gestalt_ext";
32:
print "glk_window_iterate";
33:
print "glk_window_get_rock";
34:
print "glk_window_get_root";
35:
print "glk_window_open";
36:
print "glk_window_close";
37:
print "glk_window_get_size";
38:
print "glk_window_set_arrangement";
39:
print "glk_window_get_arrangement";
40:
print "glk_window_get_type";
41:
print "glk_window_get_parent";
42:
print "glk_window_clear";
43:
print "glk_window_move_cursor";
44:
print "glk_window_get_stream";
45:
print "glk_window_set_echo_stream";
46:
print "glk_window_get_echo_stream";
47:
print "glk_set_window";
48:
print "glk_window_get_sibling";
64:
print "glk_stream_iterate";
65:
print "glk_stream_get_rock";
66:
print "glk_stream_open_file";
67:
print "glk_stream_open_memory";
68:
print "glk_stream_close";
69:
print "glk_stream_set_position";
70:
print "glk_stream_get_position";
71:
print "glk_stream_set_current";
72:
print "glk_stream_get_current";
96:
print "glk_fileref_create_temp";
97:
print "glk_fileref_create_by_name";
98:
print "glk_fileref_create_by_prompt";
99:
print "glk_fileref_destroy";
100:
print "glk_fileref_iterate";
101:
print "glk_fileref_get_rock";
102:
print "glk_fileref_delete_file";
103:
print "glk_fileref_does_file_exist";
104:
print "glk_fileref_create_from_fileref";
128:
print "glk_put_char";
129:
print "glk_put_char_stream";
130:
print "glk_put_string";
131:
print "glk_put_string_stream";
132:
print "glk_put_buffer";
133:
print "glk_put_buffer_stream";
134:
print "glk_set_style";
135:
print "glk_set_style_stream";
144:
print "glk_get_char_stream";
145:
print "glk_get_line_stream";
146:
print "glk_get_buffer_stream";
160:
print "glk_char_to_lower";
161:
print "glk_char_to_upper";
176:
print "glk_stylehint_set";
177:
print "glk_stylehint_clear";
178:
print "glk_style_distinguish";
179:
print "glk_style_measure";
192:
print "glk_select";
193:
print "glk_select_poll";
208:
print "glk_request_line_event";
209:
print "glk_cancel_line_event";
210:
print "glk_request_char_event";
211:
print "glk_cancel_char_event";
212:
print "glk_request_mouse_event";
213:
print "glk_cancel_mouse_event";
214:
print "glk_request_timer_events";
224:
print "glk_image_get_info";
225:
print "glk_image_draw";
226:
print "glk_image_draw_scaled";
232:
print "glk_window_flow_break";
233:
print "glk_window_erase_rect";
234:
print "glk_window_fill_rect";
235:
print "glk_window_set_background_color";
240:
print "glk_schannel_iterate";
241:
print "glk_schannel_get_rock";
242:
print "glk_schannel_create";
243:
print "glk_schannel_destroy";
248:
print "glk_schannel_play";
249:
print "glk_schannel_play_ext";
250:
print "glk_schannel_stop";
251:
print "glk_schannel_set_volume";
252:
print "glk_sound_load_hint";
244:
print "glk_schannel_create_ext";
247:
print "glk_schannel_play_multi";
253:
print "glk_schannel_set_volume_ext";
254:
print "glk_schannel_pause";
255:
print "glk_schannel_unpause";
256:
print "glk_set_hyperlink";
257:
print "glk_set_hyperlink_stream";
258:
print "glk_request_hyperlink_event";
259:
print "glk_cancel_hyperlink_event";
288:
print "glk_buffer_to_lower_case_uni";
289:
print "glk_buffer_to_upper_case_uni";
290:
print "glk_buffer_to_title_case_uni";
296:
print "glk_put_char_uni";
297:
print "glk_put_string_uni";
298:
print "glk_put_buffer_uni";
299:
print "glk_put_char_stream_uni";
300:
print "glk_put_string_stream_uni";
301:
print "glk_put_buffer_stream_uni";
304:
print "glk_get_char_stream_uni";
305:
print "glk_get_buffer_stream_uni";
306:
print "glk_get_line_stream_uni";
312:
print "glk_stream_open_file_uni";
313:
print "glk_stream_open_memory_uni";
320:
print "glk_request_char_event_uni";
321:
print "glk_request_line_event_uni";
291:
print "glk_buffer_canon_decompose_uni";
292:
print "glk_buffer_canon_normalize_uni";
336:
print "glk_set_echo_line_event";
337:
print "glk_set_terminators_line_event";
352:
print "glk_current_time";
353:
print "glk_current_simple_time";
360:
print "glk_time_to_date_utc";
361:
print "glk_time_to_date_local";
362:
print "glk_simple_time_to_date_utc";
363:
print "glk_simple_time_to_date_local";
364:
print "glk_date_to_time_utc";
365:
print "glk_date_to_time_local";
366:
print "glk_date_to_simple_time_utc";
367:
print "glk_date_to_simple_time_local";
73:
print "glk_stream_open_resource";
314:
print "glk_stream_open_resource_uni";
default:
print "Glk function #", selector;
rfalse;
}
print " [Glk function #", selector, "]";
rtrue;
];
-).
To say the Glk function name for the selector (A - a number): (- print (vdl_glkName) ({A}); -).
Chapter "infglk" - unindexed
Section "infglk Patches" - unindexed
Include (-
! For older versions of infglk.h, such as the one that ships with 6G60
#ifndef winmethod_Border;
Constant winmethod_Border = $000;
#endif;
#ifndef winmethod_NoBorder;
Constant winmethod_NoBorder = $100;
#endif;
#ifndef winmethod_BorderMask;
Constant winmethod_BorderMask = $100;
#endif;
-) after "Definitions.i6t".
Section "infglk Accessors" - unindexed
[Note that the following are only masks for values actually in use. The masks in glk.h are wider, to allow the standard to expand.]
To decide what number is the current Glk direction mask: (- (winmethod_Left|winmethod_Right|winmethod_Above|winmethod_Below) -).
To decide what number is the current Glk direction minimum: (- winmethod_Left -).
To decide what number is the current Glk direction maximum: (- winmethod_Below -).
To decide what number is the current Glk division mask: (- (winmethod_Fixed|winmethod_Proportional) -).
To decide what number is the current Glk division minimum: (- winmethod_Fixed -).
To decide what number is the current Glk division maximum: (- winmethod_Proportional -).
To decide what number is the current Glk border mask: (- (winmethod_Border|winmethod_NoBorder) -).
To decide what number is the current Glk border minimum: (- winmethod_Border -).
To decide what number is the current Glk border maximum: (- winmethod_NoBorder -).
To decide what number is proportional division: (- winmethod_Proportional -).
To decide what number is the current Glk creatable window type minimum: (- wintype_Blank -).
To decide what number is the current Glk creatable window type maximum: (- wintype_Graphics -).
To decide what number is the pair window type: (- wintype_Pair -).
To decide what number is the text buffer window type: (- wintype_TextBuffer -).
To decide what number is the graphics window type: (- wintype_Graphics -).
To decide what number is fixed division: (- winmethod_Fixed -).
To decide what number is the blank window type: (- wintype_Blank -).
To decide what number is the current Glk justification minimum: (- stylehint_just_LeftFlush -).
To decide what number is the current Glk justification maximum: (- stylehint_just_RightFlush -).
To decide what number is the write operation: (- filemode_Write -).
To decide what number is the read operation: (- filemode_Read -).
To decide what number is the read-write operation: (- filemode_ReadWrite -).