Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – tendra.SVN – Blame – /branches/tendra4/src/tools/tld/debug.c – Rev 2

Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/**** debug.c --- Debugging routines.
32
 *
33
 ** Author: Steve Folkes <smf@hermes.mod.uk>
34
 *
35
 **** Commentary:
36
 *
37
 * This file implements the tracing routines for use with the TDF linker.
38
 *
39
 **** Change Log:
40
 * $Log: debug.c,v $
41
 * Revision 1.1.1.1  1998/01/17  15:57:18  release
42
 * First version to be checked into rolling release.
43
 *
44
 * Revision 1.4  1995/09/22  08:39:15  smf
45
 * Fixed problems with incomplete structures (to shut "tcc" up).
46
 * Fixed some problems in "name-key.c" (no real problems, but rewritten to
47
 * reduce the warnings that were output by "tcc" and "gcc").
48
 * Fixed bug CR95_354.tld-common-id-problem (library capsules could be loaded
49
 * more than once).
50
 *
51
 * Revision 1.3  1995/07/07  15:32:22  smf
52
 * Updated to support TDF specification 4.0.
53
 *
54
 * Revision 1.2  1994/12/12  11:46:18  smf
55
 * Performing changes for 'CR94_178.sid+tld-update' - bringing in line with
56
 * OSSG C Coding Standards.
57
 *
58
 * Revision 1.1.1.1  1994/07/25  16:03:31  smf
59
 * Initial import of TDF linker 3.5 non shared files.
60
 *
61
**/
62
 
63
/****************************************************************************/
64
 
65
#include "debug.h"
66
#include "tdf.h"
67
 
68
#include "solve-cycles.h"
69
 
70
/*--------------------------------------------------------------------------*/
71
 
72
static OStreamP	debug_file   = NIL (OStreamP);
73
 
74
/*--------------------------------------------------------------------------*/
75
 
76
void
77
debug_set_file PROTO_N ((file))
78
	       PROTO_T (OStreamP file)
79
{
80
    if (ostream_is_open (file)) {
81
	debug_file = file;
82
    } else {
83
	debug_file = NIL (OStreamP);
84
    }
85
}
86
 
87
/*--------------------------------------------------------------------------*/
88
 
89
void
90
debug_info_u_name PROTO_N ((name))
91
		  PROTO_T (NStringP name)
92
{
93
    if (debug_file) {
94
	write_cstring (debug_file, "Using unit set name '");
95
	write_nstring (debug_file, name);
96
	write_char (debug_file, '\'');
97
	write_newline (debug_file);
98
    }
99
}
100
 
101
/*--------------------------------------------------------------------------*/
102
 
103
void
104
debug_info_r_start_capsule PROTO_N ((name))
105
			   PROTO_T (CStringP name)
106
{
107
    if (debug_file) {
108
	write_cstring (debug_file, "Reading capsule '");
109
	write_cstring (debug_file, name);
110
	write_cstring (debug_file, "':");
111
	write_newline (debug_file);
112
    }
113
}
114
 
115
void
116
debug_info_r_versions PROTO_N ((major, minor))
117
    		      PROTO_T (unsigned major X unsigned minor)
118
{
119
    if (debug_file) {
120
	write_cstring  (debug_file, "  Read major version: ");
121
	write_unsigned (debug_file, major);
122
	write_cstring  (debug_file, "; minor version:");
123
	write_unsigned (debug_file, minor);
124
	write_newline  (debug_file);
125
    }
126
}
127
 
128
void
129
debug_info_r_start_unit_decs PROTO_N ((num_unit_sets))
130
			     PROTO_T (unsigned num_unit_sets)
131
{
132
    if (debug_file) {
133
	write_cstring (debug_file, "  Reading ");
134
	write_unsigned (debug_file, num_unit_sets);
135
	write_cstring (debug_file, " unit set names:");
136
	write_newline (debug_file);
137
    }
138
}
139
 
140
void
141
debug_info_r_unit_dec PROTO_N ((name))
142
		      PROTO_T (NStringP name)
143
{
144
    if (debug_file) {
145
	write_cstring (debug_file, "    ");
146
	write_nstring (debug_file, name);
147
	write_newline (debug_file);
148
    }
149
}
150
 
151
void
152
debug_info_r_start_shapes PROTO_N ((num_shapes))
153
			  PROTO_T (unsigned num_shapes)
154
{
155
    if (debug_file) {
156
	write_cstring (debug_file, "  Reading ");
157
	write_unsigned (debug_file, num_shapes);
158
	write_cstring (debug_file, " shape names:");
159
	write_newline (debug_file);
160
    }
161
}
162
 
163
void
164
debug_info_r_shape PROTO_N ((name, num_ids))
165
		   PROTO_T (NStringP name X
166
			    unsigned num_ids)
167
{
168
    if (debug_file) {
169
	write_cstring (debug_file, "    ");
170
	write_nstring (debug_file, name);
171
	write_cstring (debug_file, ", ");
172
	write_unsigned (debug_file, num_ids);
173
	write_newline (debug_file);
174
    }
175
}
176
 
177
void
178
debug_info_r_start_names PROTO_N ((num_names))
179
			 PROTO_T (unsigned num_names)
180
{
181
    if (debug_file) {
182
	write_cstring (debug_file, "  Reading ");
183
	write_unsigned (debug_file, num_names);
184
	write_cstring (debug_file, " external name categories:");
185
	write_newline (debug_file);
186
    }
187
}
188
 
189
void
190
debug_info_r_start_shape_names PROTO_N ((shape, num_names))
191
			       PROTO_T (NStringP shape X
192
					unsigned num_names)
193
{
194
    if (debug_file) {
195
	write_cstring (debug_file, "    Reading ");
196
	write_unsigned (debug_file, num_names);
197
	write_cstring (debug_file, " external ");
198
	write_nstring (debug_file, shape);
199
	write_cstring (debug_file, " names:");
200
	write_newline (debug_file);
201
    }
202
}
203
 
204
void
205
debug_info_r_name PROTO_N ((name, old_id, new_id, key))
206
		  PROTO_T (NameKeyP name X
207
			   unsigned old_id X
208
			   unsigned new_id X
209
			   NameKeyP key)
210
{
211
    if (debug_file) {
212
	write_cstring (debug_file, "      ");
213
	write_name_key (debug_file, name);
214
	write_cstring (debug_file, ", ");
215
	write_unsigned (debug_file, old_id);
216
	write_cstring (debug_file, " -> ");
217
	write_unsigned (debug_file, new_id);
218
	write_cstring (debug_file, " (");
219
	write_name_key (debug_file, key);
220
	write_char (debug_file, ')');
221
	write_newline (debug_file);
222
    }
223
}
224
 
225
void
226
debug_info_r_start_unit_sets PROTO_N ((num_unit_sets))
227
			     PROTO_T (unsigned num_unit_sets)
228
{
229
    if (debug_file) {
230
	write_cstring (debug_file, "  Reading ");
231
	write_unsigned (debug_file, num_unit_sets);
232
	write_cstring (debug_file, " unit sets:");
233
	write_newline (debug_file);
234
    }
235
}
236
 
237
void
238
debug_info_r_start_units PROTO_N ((unit_set, num_units))
239
			 PROTO_T (NStringP unit_set X
240
				  unsigned num_units)
241
{
242
    if (debug_file) {
243
	write_cstring (debug_file, "    Reading ");
244
	write_unsigned (debug_file, num_units);
245
	write_char (debug_file, ' ');
246
	write_nstring (debug_file, unit_set);
247
	write_cstring (debug_file, " units:");
248
	write_newline (debug_file);
249
    }
250
}
251
 
252
void
253
debug_info_r_start_unit PROTO_N ((unit_set, unit, num_units))
254
			PROTO_T (NStringP unit_set X
255
				 unsigned unit X
256
				 unsigned num_units)
257
{
258
    if (debug_file) {
259
	write_cstring (debug_file, "      Reading ");
260
	write_nstring (debug_file, unit_set);
261
	write_cstring (debug_file, " unit ");
262
	write_unsigned (debug_file, unit);
263
	write_cstring (debug_file, " of ");
264
	write_unsigned (debug_file, num_units);
265
	write_char (debug_file, ':');
266
	write_newline (debug_file);
267
    }
268
}
269
 
270
void
271
debug_info_r_start_counts PROTO_N ((num_counts))
272
			  PROTO_T (unsigned num_counts)
273
{
274
    if (debug_file) {
275
	write_cstring (debug_file, "        Reading ");
276
	write_unsigned (debug_file, num_counts);
277
	write_cstring (debug_file, " counts:");
278
	write_newline (debug_file);
279
    }
280
}
281
 
282
void
283
debug_info_r_count PROTO_N ((count, shape))
284
		   PROTO_T (unsigned count X
285
			    NStringP shape)
286
{
287
    if (debug_file) {
288
	write_cstring (debug_file, "          ");
289
	write_unsigned (debug_file, count);
290
	write_cstring (debug_file, " (");
291
	write_nstring (debug_file, shape);
292
	write_char (debug_file, ')');
293
	write_newline (debug_file);
294
    }
295
}
296
 
297
void
298
debug_info_r_start_maps PROTO_N ((num_maps))
299
			PROTO_T (unsigned num_maps)
300
{
301
    if (debug_file) {
302
	write_cstring (debug_file, "        Reading ");
303
	write_unsigned (debug_file, num_maps);
304
	write_cstring (debug_file, " mapping categories:");
305
	write_newline (debug_file);
306
    }
307
}
308
 
309
void
310
debug_info_r_start_shape_maps PROTO_N ((shape, num_maps))
311
			      PROTO_T (NStringP shape X
312
				       unsigned num_maps)
313
{
314
    if (debug_file) {
315
	write_cstring (debug_file, "          Reading ");
316
	write_unsigned (debug_file, num_maps);
317
	write_char (debug_file, ' ');
318
	write_nstring (debug_file, shape);
319
	write_cstring (debug_file, " mappings:");
320
	write_newline (debug_file);
321
    }
322
}
323
 
324
void
325
debug_info_r_map PROTO_N ((internal, old_external, new_external))
326
		 PROTO_T (unsigned internal X
327
			  unsigned old_external X
328
			  unsigned new_external)
329
{
330
    if (debug_file) {
331
	write_cstring (debug_file, "            ");
332
	write_unsigned (debug_file, internal);
333
	write_cstring (debug_file, ", ");
334
	write_unsigned (debug_file, old_external);
335
	write_cstring (debug_file, " -> ");
336
	write_unsigned (debug_file, new_external);
337
	write_newline (debug_file);
338
    }
339
}
340
 
341
void
342
debug_info_r_unit_body PROTO_N ((size))
343
		       PROTO_T (unsigned size)
344
{
345
    if (debug_file) {
346
	write_cstring (debug_file, "        Reading ");
347
	write_unsigned (debug_file, size);
348
	write_cstring (debug_file, " bytes of unit body");
349
	write_newline (debug_file);
350
    }
351
}
352
 
353
void
354
debug_info_r_tld_version PROTO_N ((version))
355
			 PROTO_T (unsigned version)
356
{
357
    if (debug_file) {
358
	write_cstring (debug_file, "          Reading version ");
359
	write_unsigned (debug_file, version);
360
	write_cstring (debug_file, " linker information unit:");
361
	write_newline (debug_file);
362
    }
363
}
364
 
365
void
366
debug_info_r_start_usages PROTO_N ((shape, num_names))
367
			  PROTO_T (NStringP shape X
368
				   unsigned num_names)
369
{
370
    if (debug_file) {
371
	write_cstring (debug_file, "            Reading ");
372
	write_unsigned (debug_file, num_names);
373
	write_cstring (debug_file, " external ");
374
	write_nstring (debug_file, shape);
375
	write_cstring (debug_file, " name usages:");
376
	write_newline (debug_file);
377
    }
378
}
379
 
380
void
381
debug_info_r_usage PROTO_N ((use, name_use, key))
382
		   PROTO_T (unsigned use X
383
			    unsigned name_use X
384
			    NameKeyP key)
385
{
386
    if (debug_file) {
387
	write_cstring (debug_file, "              ");
388
	write_usage (debug_file, use);
389
	write_cstring (debug_file, " (");
390
	write_name_key (debug_file, key);
391
	write_cstring (debug_file, ", ");
392
	write_usage (debug_file, name_use);
393
	write_char (debug_file, ')');
394
	write_newline (debug_file);
395
    }
396
}
397
 
398
void
399
debug_info_r_end_capsule PROTO_Z ()
400
{
401
    if (debug_file) {
402
	write_cstring (debug_file, "Finished reading capsule");
403
	write_newline (debug_file);
404
    }
405
}
406
 
407
void
408
debug_info_r_abort_capsule PROTO_Z ()
409
{
410
    if (debug_file) {
411
	write_cstring (debug_file, "Aborted reading capsule");
412
	write_newline (debug_file);
413
    }
414
}
415
 
416
/*--------------------------------------------------------------------------*/
417
 
418
void
419
debug_info_w_start_capsule PROTO_N ((name))
420
			   PROTO_T (CStringP name)
421
{
422
    if (debug_file) {
423
	write_cstring (debug_file, "Writing capsule '");
424
	write_cstring (debug_file, name);
425
	write_cstring (debug_file, "':");
426
	write_newline (debug_file);
427
    }
428
}
429
 
430
void
431
debug_info_w_versions PROTO_N ((major, minor))
432
    		      PROTO_T (unsigned major X unsigned minor)
433
{
434
    if (debug_file) {
435
	write_cstring  (debug_file, "  Writing major version: ");
436
	write_unsigned (debug_file, major);
437
	write_cstring  (debug_file, "; minor version:");
438
	write_unsigned (debug_file, minor);
439
	write_newline  (debug_file);
440
    }
441
}
442
 
443
void
444
debug_info_w_start_unit_decs PROTO_N ((num_unit_sets))
445
			     PROTO_T (unsigned num_unit_sets)
446
{
447
    if (debug_file) {
448
	write_cstring (debug_file, "  Writing ");
449
	write_unsigned (debug_file, num_unit_sets);
450
	write_cstring (debug_file, " unit set names:");
451
	write_newline (debug_file);
452
    }
453
}
454
 
455
void
456
debug_info_w_unit_dec PROTO_N ((name))
457
		      PROTO_T (NStringP name)
458
{
459
    if (debug_file) {
460
	write_cstring (debug_file, "    ");
461
	write_nstring (debug_file, name);
462
	write_newline (debug_file);
463
    }
464
}
465
 
466
void
467
debug_info_w_start_shapes PROTO_N ((num_shapes))
468
			  PROTO_T (unsigned num_shapes)
469
{
470
    if (debug_file) {
471
	write_cstring (debug_file, "  Writing ");
472
	write_unsigned (debug_file, num_shapes);
473
	write_cstring (debug_file, " shape names:");
474
	write_newline (debug_file);
475
    }
476
}
477
 
478
void
479
debug_info_w_shape PROTO_N ((name, num_ids))
480
		   PROTO_T (NStringP name X
481
			    unsigned num_ids)
482
{
483
    if (debug_file) {
484
	write_cstring (debug_file, "    ");
485
	write_nstring (debug_file, name);
486
	write_cstring (debug_file, ", ");
487
	write_unsigned (debug_file, num_ids);
488
	write_newline (debug_file);
489
    }
490
}
491
 
492
void
493
debug_info_w_start_names PROTO_N ((num_names))
494
			 PROTO_T (unsigned num_names)
495
{
496
    if (debug_file) {
497
	write_cstring (debug_file, "  Writing ");
498
	write_unsigned (debug_file, num_names);
499
	write_cstring (debug_file, " external name categories:");
500
	write_newline (debug_file);
501
    }
502
}
503
 
504
void
505
debug_info_w_start_shape_names PROTO_N ((shape, num_names))
506
			       PROTO_T (NStringP shape X
507
					unsigned num_names)
508
{
509
    if (debug_file) {
510
	write_cstring (debug_file, "    Writing ");
511
	write_unsigned (debug_file, num_names);
512
	write_cstring (debug_file, " external ");
513
	write_nstring (debug_file, shape);
514
	write_cstring (debug_file, " names:");
515
	write_newline (debug_file);
516
    }
517
}
518
 
519
void
520
debug_info_w_name PROTO_N ((name, id))
521
		  PROTO_T (NameKeyP name X
522
			   unsigned id)
523
{
524
    if (debug_file) {
525
	write_cstring (debug_file, "      ");
526
	write_name_key (debug_file, name);
527
	write_cstring (debug_file, ", ");
528
	write_unsigned (debug_file, id);
529
	write_newline (debug_file);
530
    }
531
}
532
 
533
void
534
debug_info_w_start_unit_sets PROTO_N ((num_unit_sets))
535
			     PROTO_T (unsigned num_unit_sets)
536
{
537
    if (debug_file) {
538
	write_cstring (debug_file, "  Writing ");
539
	write_unsigned (debug_file, num_unit_sets);
540
	write_cstring (debug_file, " unit sets:");
541
	write_newline (debug_file);
542
    }
543
}
544
 
545
void
546
debug_info_w_start_units PROTO_N ((unit_set, num_units))
547
			 PROTO_T (NStringP unit_set X
548
				  unsigned num_units)
549
{
550
    if (debug_file) {
551
	write_cstring (debug_file, "    Writing ");
552
	write_unsigned (debug_file, num_units);
553
	write_char (debug_file, ' ');
554
	write_nstring (debug_file, unit_set);
555
	write_cstring (debug_file, " units:");
556
	write_newline (debug_file);
557
    }
558
}
559
 
560
void
561
debug_info_w_start_unit PROTO_N ((unit_set, unit, num_units))
562
			PROTO_T (NStringP unit_set X
563
				 unsigned unit X
564
				 unsigned num_units)
565
{
566
    if (debug_file) {
567
	write_cstring (debug_file, "      Writing ");
568
	write_nstring (debug_file, unit_set);
569
	write_cstring (debug_file, " unit ");
570
	write_unsigned (debug_file, unit);
571
	write_cstring (debug_file, " of ");
572
	write_unsigned (debug_file, num_units);
573
	write_char (debug_file, ':');
574
	write_newline (debug_file);
575
    }
576
}
577
 
578
void
579
debug_info_w_start_counts PROTO_N ((num_counts))
580
			  PROTO_T (unsigned num_counts)
581
{
582
    if (debug_file) {
583
	write_cstring (debug_file, "        Writing ");
584
	write_unsigned (debug_file, num_counts);
585
	write_cstring (debug_file, " counts:");
586
	write_newline (debug_file);
587
    }
588
}
589
 
590
void
591
debug_info_w_count PROTO_N ((count, shape))
592
		   PROTO_T (unsigned count X
593
			    NStringP shape)
594
{
595
    if (debug_file) {
596
	write_cstring (debug_file, "          ");
597
	write_unsigned (debug_file, count);
598
	write_cstring (debug_file, " (");
599
	write_nstring (debug_file, shape);
600
	write_char (debug_file, ')');
601
	write_newline (debug_file);
602
    }
603
}
604
 
605
void
606
debug_info_w_start_maps PROTO_N ((num_maps))
607
			PROTO_T (unsigned num_maps)
608
{
609
    if (debug_file) {
610
	write_cstring (debug_file, "        Writing ");
611
	write_unsigned (debug_file, num_maps);
612
	write_cstring (debug_file, " mapping categories:");
613
	write_newline (debug_file);
614
    }
615
}
616
 
617
void
618
debug_info_w_start_shape_maps PROTO_N ((shape, num_maps))
619
			      PROTO_T (NStringP shape X
620
				       unsigned num_maps)
621
{
622
    if (debug_file) {
623
	write_cstring (debug_file, "          Writing ");
624
	write_unsigned (debug_file, num_maps);
625
	write_char (debug_file, ' ');
626
	write_nstring (debug_file, shape);
627
	write_cstring (debug_file, " mappings:");
628
	write_newline (debug_file);
629
    }
630
}
631
 
632
void
633
debug_info_w_map PROTO_N ((internal, external))
634
		 PROTO_T (unsigned internal X
635
			  unsigned external)
636
{
637
    if (debug_file) {
638
	write_cstring (debug_file, "            ");
639
	write_unsigned (debug_file, internal);
640
	write_cstring (debug_file, ", ");
641
	write_unsigned (debug_file, external);
642
	write_newline (debug_file);
643
    }
644
}
645
 
646
void
647
debug_info_w_unit_body PROTO_N ((size))
648
		       PROTO_T (unsigned size)
649
{
650
    if (debug_file) {
651
	write_cstring (debug_file, "        Writing ");
652
	write_unsigned (debug_file, size);
653
	write_cstring (debug_file, " bytes of unit body");
654
	write_newline (debug_file);
655
    }
656
}
657
 
658
void
659
debug_info_w_tld_version PROTO_N ((version))
660
			 PROTO_T (unsigned version)
661
{
662
    if (debug_file) {
663
	write_cstring (debug_file, "          Writing version ");
664
	write_unsigned (debug_file, version);
665
	write_cstring (debug_file, " linker information unit:");
666
	write_newline (debug_file);
667
    }
668
}
669
 
670
void
671
debug_info_w_start_usages PROTO_N ((shape))
672
			  PROTO_T (NStringP shape)
673
{
674
    if (debug_file) {
675
	write_cstring (debug_file, "            Writing external ");
676
	write_nstring (debug_file, shape);
677
	write_cstring (debug_file, " name usages:");
678
	write_newline (debug_file);
679
    }
680
}
681
 
682
void
683
debug_info_w_usage PROTO_N ((use, key))
684
		   PROTO_T (unsigned use X
685
			    NameKeyP key)
686
{
687
    if (debug_file) {
688
	write_cstring (debug_file, "              ");
689
	write_usage (debug_file, use);
690
	write_cstring (debug_file, " (");
691
	write_name_key (debug_file, key);
692
	write_char (debug_file, ')');
693
	write_newline (debug_file);
694
    }
695
}
696
 
697
void
698
debug_info_w_end_capsule PROTO_Z ()
699
{
700
    if (debug_file) {
701
	write_cstring (debug_file, "Finished writing capsule");
702
	write_newline (debug_file);
703
    }
704
}
705
 
706
/*--------------------------------------------------------------------------*/
707
 
708
void
709
debug_info_r_start_library PROTO_N ((name))
710
			   PROTO_T (CStringP name)
711
{
712
    if (debug_file) {
713
	write_cstring (debug_file, "Reading library '");
714
	write_cstring (debug_file, name);
715
	write_cstring (debug_file, "':");
716
	write_newline (debug_file);
717
    }
718
}
719
 
720
void
721
debug_info_r_lib_versions PROTO_N ((major, minor))
722
    			  PROTO_T (unsigned major X unsigned minor)
723
{
724
    if (debug_file) {
725
	write_cstring  (debug_file, "  Reading major version: ");
726
	write_unsigned (debug_file, major);
727
	write_cstring  (debug_file, "; minor version: ");
728
	write_unsigned (debug_file, minor);
729
	write_newline  (debug_file);
730
    }
731
}
732
 
733
void
734
debug_info_r_library_version PROTO_N ((version))
735
			     PROTO_T (unsigned version)
736
{
737
    if (debug_file) {
738
	write_cstring (debug_file, "  Reading type ");
739
	write_unsigned (debug_file, version);
740
	write_cstring (debug_file, " library:");
741
	write_newline (debug_file);
742
    }
743
}
744
 
745
void
746
debug_info_r_start_capsules PROTO_N ((num_capsules))
747
			    PROTO_T (unsigned num_capsules)
748
{
749
    if (debug_file) {
750
	write_cstring (debug_file, "    Reading ");
751
	write_unsigned (debug_file, num_capsules);
752
	write_cstring (debug_file, " capsules:");
753
	write_newline (debug_file);
754
    }
755
}
756
 
757
void
758
debug_info_r_capsule PROTO_N ((name, length))
759
		     PROTO_T (NStringP name X
760
			      unsigned length)
761
{
762
    if (debug_file) {
763
	write_cstring (debug_file, "      Loaded '");
764
	write_nstring (debug_file, name);
765
	write_cstring (debug_file, "', ");
766
	write_unsigned (debug_file, length);
767
	write_cstring (debug_file, " bytes");
768
	write_newline (debug_file);
769
    }
770
}
771
 
772
void
773
debug_info_r_start_index PROTO_N ((num_shapes))
774
			 PROTO_T (unsigned num_shapes)
775
{
776
    if (debug_file) {
777
	write_cstring (debug_file, "    Reading ");
778
	write_unsigned (debug_file, num_shapes);
779
	write_cstring (debug_file, " shape indices:");
780
	write_newline (debug_file);
781
    }
782
}
783
 
784
void
785
debug_info_r_start_shape_index PROTO_N ((shape, num_names))
786
			       PROTO_T (NStringP shape X
787
					unsigned num_names)
788
{
789
    if (debug_file) {
790
	write_cstring (debug_file, "      Reading ");
791
	write_unsigned (debug_file, num_names);
792
	write_cstring (debug_file, " entries in ");
793
	write_nstring (debug_file, shape);
794
	write_cstring (debug_file, " external name index:");
795
	write_newline (debug_file);
796
    }
797
}
798
 
799
void
800
debug_info_r_index_entry PROTO_N ((name, use, name_use, key, cap_name))
801
			 PROTO_T (NameKeyP name X
802
				  unsigned use X
803
				  unsigned name_use X
804
				  NameKeyP key X
805
				  CStringP cap_name)
806
{
807
    if (debug_file) {
808
	write_cstring (debug_file, "        ");
809
	write_name_key (debug_file, name);
810
	write_cstring (debug_file, ", ");
811
	write_usage (debug_file, use);
812
	write_cstring (debug_file, ", '");
813
	write_cstring (debug_file, cap_name);
814
	write_cstring (debug_file, "' (");
815
	write_name_key (debug_file, key);
816
	write_cstring (debug_file, ", ");
817
	write_usage (debug_file, name_use);
818
	write_char (debug_file, ')');
819
	write_newline (debug_file);
820
    }
821
}
822
 
823
void
824
debug_info_r_end_library PROTO_Z ()
825
{
826
    if (debug_file) {
827
	write_cstring (debug_file, "Finished reading library");
828
	write_newline (debug_file);
829
    }
830
}
831
 
832
void
833
debug_info_r_abort_library PROTO_Z ()
834
{
835
    if (debug_file) {
836
	write_cstring (debug_file, "Aborted reading library");
837
	write_newline (debug_file);
838
    }
839
}
840
 
841
/*--------------------------------------------------------------------------*/
842
 
843
void
844
debug_info_w_start_library PROTO_N ((name))
845
			   PROTO_T (CStringP name)
846
{
847
    if (debug_file) {
848
	write_cstring (debug_file, "Writing library '");
849
	write_cstring (debug_file, name);
850
	write_cstring (debug_file, "':");
851
	write_newline (debug_file);
852
    }
853
}
854
 
855
void
856
debug_info_w_lib_versions PROTO_N ((major, minor))
857
    			  PROTO_T (unsigned major X unsigned minor)
858
{
859
    if (debug_file) {
860
	write_cstring  (debug_file, "  Writing major version: ");
861
	write_unsigned (debug_file, major);
862
	write_cstring  (debug_file, "; minor version: ");
863
	write_unsigned (debug_file, minor);
864
	write_newline  (debug_file);
865
    }
866
}
867
 
868
void
869
debug_info_w_library_version PROTO_N ((version))
870
			     PROTO_T (unsigned version)
871
{
872
    if (debug_file) {
873
	write_cstring (debug_file, "  Writing type ");
874
	write_unsigned (debug_file, version);
875
	write_cstring (debug_file, " library:");
876
	write_newline (debug_file);
877
    }
878
}
879
 
880
void
881
debug_info_w_start_capsules PROTO_N ((num_capsules))
882
			    PROTO_T (unsigned num_capsules)
883
{
884
    if (debug_file) {
885
	write_cstring (debug_file, "    Writing ");
886
	write_unsigned (debug_file, num_capsules);
887
	write_cstring (debug_file, " capsules:");
888
	write_newline (debug_file);
889
    }
890
}
891
 
892
void
893
debug_info_w_capsule PROTO_N ((name, length))
894
		     PROTO_T (CStringP name X
895
			      unsigned length)
896
{
897
    if (debug_file) {
898
	write_cstring (debug_file, "      Saved '");
899
	write_cstring (debug_file, name);
900
	write_cstring (debug_file, "', ");
901
	write_unsigned (debug_file, length);
902
	write_cstring (debug_file, " bytes");
903
	write_newline (debug_file);
904
    }
905
}
906
 
907
void
908
debug_info_w_start_index PROTO_N ((num_shapes))
909
			 PROTO_T (unsigned num_shapes)
910
{
911
    if (debug_file) {
912
	write_cstring (debug_file, "    Writing ");
913
	write_unsigned (debug_file, num_shapes);
914
	write_cstring (debug_file, " shape indices:");
915
	write_newline (debug_file);
916
    }
917
}
918
 
919
void
920
debug_info_w_start_shape_index PROTO_N ((shape, num_names))
921
			       PROTO_T (NStringP shape X
922
					unsigned num_names)
923
{
924
    if (debug_file) {
925
	write_cstring (debug_file, "      Writing ");
926
	write_unsigned (debug_file, num_names);
927
	write_cstring (debug_file, " entries in ");
928
	write_nstring (debug_file, shape);
929
	write_cstring (debug_file, " external name index:");
930
	write_newline (debug_file);
931
    }
932
}
933
 
934
void
935
debug_info_w_index_entry PROTO_N ((key, use, cap_name, cap_index))
936
			 PROTO_T (NameKeyP key X
937
				  unsigned use X
938
				  CStringP cap_name X
939
				  unsigned cap_index)
940
{
941
    if (debug_file) {
942
	write_cstring (debug_file, "        ");
943
	write_name_key (debug_file, key);
944
	write_cstring (debug_file, ", ");
945
	write_usage (debug_file, use);
946
	write_cstring (debug_file, ", '");
947
	write_cstring (debug_file, cap_name);
948
	write_cstring (debug_file, "' (");
949
	write_unsigned (debug_file, cap_index);
950
	write_char (debug_file, ')');
951
	write_newline (debug_file);
952
    }
953
}
954
 
955
void
956
debug_info_w_end_library PROTO_Z ()
957
{
958
    if (debug_file) {
959
	write_cstring (debug_file, "Finished writing library");
960
	write_newline (debug_file);
961
    }
962
}
963
 
964
/*--------------------------------------------------------------------------*/
965
 
966
void
967
debug_info_l_not_needed PROTO_N ((key, shape_key, use))
968
			PROTO_T (NameKeyP key X
969
				 NStringP shape_key X
970
				 unsigned use)
971
{
972
    if (debug_file) {
973
	write_cstring (debug_file, "No definition needed for ");
974
	write_nstring (debug_file, shape_key);
975
	write_cstring (debug_file, " '");
976
	write_name_key (debug_file, key);
977
	write_cstring (debug_file, "' (");
978
	write_usage (debug_file, use);
979
	write_char (debug_file, ')');
980
	write_newline (debug_file);
981
    }
982
}
983
 
984
void
985
debug_info_l_not_found PROTO_N ((key, shape_key, use))
986
		       PROTO_T (NameKeyP key X
987
				NStringP shape_key X
988
				unsigned use)
989
{
990
    if (debug_file) {
991
	write_cstring (debug_file, "No definition found for ");
992
	write_nstring (debug_file, shape_key);
993
	write_cstring (debug_file, " '");
994
	write_name_key (debug_file, key);
995
	write_cstring (debug_file, "' (");
996
	write_usage (debug_file, use);
997
	write_char (debug_file, ')');
998
	write_newline (debug_file);
999
    }
1000
}
1001
 
1002
void
1003
debug_info_l_found PROTO_N ((key, shape_key, use, name))
1004
		   PROTO_T (NameKeyP key X
1005
			    NStringP shape_key X
1006
			    unsigned use X
1007
			    CStringP name)
1008
{
1009
    if (debug_file) {
1010
	write_cstring (debug_file, "Definition found for ");
1011
	write_nstring (debug_file, shape_key);
1012
	write_cstring (debug_file, " '");
1013
	write_name_key (debug_file, key);
1014
	write_cstring (debug_file, "' (");
1015
	write_usage (debug_file, use);
1016
	write_cstring (debug_file, ") in file '");
1017
	write_cstring (debug_file, name);
1018
	write_char (debug_file, '\'');
1019
	write_newline (debug_file);
1020
    }
1021
}
1022
 
1023
void
1024
debug_info_l_hide PROTO_N ((shape, key))
1025
		  PROTO_T (NStringP shape X
1026
			   NameKeyP key)
1027
{
1028
    if (debug_file) {
1029
	write_cstring (debug_file, "Hid external ");
1030
	write_nstring (debug_file, shape);
1031
	write_cstring (debug_file, " '");
1032
	write_name_key (debug_file, key);
1033
	write_char (debug_file, '\'');
1034
	write_newline (debug_file);
1035
    }
1036
}
1037
 
1038
void
1039
debug_info_l_keep PROTO_N ((shape, key))
1040
		  PROTO_T (NStringP shape X
1041
			   NameKeyP key)
1042
{
1043
    if (debug_file) {
1044
	write_cstring (debug_file, "Kept external ");
1045
	write_nstring (debug_file, shape);
1046
	write_cstring (debug_file, " '");
1047
	write_name_key (debug_file, key);
1048
	write_char (debug_file, '\'');
1049
	write_newline (debug_file);
1050
    }
1051
}
1052
 
1053
void
1054
debug_info_l_suppress PROTO_N ((shape, key))
1055
		      PROTO_T (NStringP shape X
1056
			       NameKeyP key)
1057
{
1058
    if (debug_file) {
1059
	write_cstring (debug_file, "Suppressed external ");
1060
	write_nstring (debug_file, shape);
1061
	write_cstring (debug_file, " '");
1062
	write_name_key (debug_file, key);
1063
	write_char (debug_file, '\'');
1064
	write_newline (debug_file);
1065
    }
1066
}
1067
 
1068
void
1069
debug_info_l_rename PROTO_N ((shape, from, to))
1070
		    PROTO_T (NStringP shape X
1071
			     NameKeyP from X
1072
			     NameKeyP to)
1073
{
1074
    if (debug_file) {
1075
	write_cstring (debug_file, "Renamed external ");
1076
	write_nstring (debug_file, shape);
1077
	write_cstring (debug_file, " '");
1078
	write_name_key (debug_file, from);
1079
	write_cstring (debug_file, "' to '");
1080
	write_name_key (debug_file, to);
1081
	write_char (debug_file, '\'');
1082
	write_newline (debug_file);
1083
    }
1084
}
1085
 
1086
/*
1087
 * Local variables(smf):
1088
 * eval: (include::add-path-entry "os-interface" "library" "generated")
1089
 * End:
1090
**/