Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251
WebSVN – tendra.SVN – Diff – /trunk/src/installers/common/dwarf2/dw2_info.c – Rev 2 and 7

Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
 
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
Line 14... Line 44...
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
 
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
 
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
 
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
29
 
59
 
30
 
60
 
31
/**********************************************************************
61
/**********************************************************************
32
$Author: pwe $
62
$Author: pwe $
33
$Date: 1998/03/15 16:00:35 $
63
$Date: 1998/03/15 16:00:35 $
34
$Revision: 1.5 $
64
$Revision: 1.5 $
35
$Log: dw2_info.c,v $
65
$Log: dw2_info.c,v $
Line 42... Line 72...
42
 * Revision 1.3  1998/02/18  11:22:20  pwe
72
 * Revision 1.3  1998/02/18  11:22:20  pwe
43
 * test corrections
73
 * test corrections
44
 *
74
 *
45
 * Revision 1.2  1998/01/21  10:30:06  pwe
75
 * Revision 1.2  1998/01/21  10:30:06  pwe
46
 * labdiff change
76
 * labdiff change
47
 *
77
 *
48
 * Revision 1.1.1.1  1998/01/17  15:55:48  release
78
 * Revision 1.1.1.1  1998/01/17  15:55:48  release
49
 * First version to be checked into rolling release.
79
 * First version to be checked into rolling release.
50
 *
80
 *
51
 * Revision 1.13  1998/01/09  09:31:32  pwe
81
 * Revision 1.13  1998/01/09  09:31:32  pwe
52
 * prep restructure
82
 * prep restructure
Line 122... Line 152...
122
static int doing_abstract = 0;
152
static int doing_abstract = 0;
123
static int doing_inline = 0;	/* consistency check only */
153
static int doing_inline = 0;	/* consistency check only */
124
static dg_info proc_dg_info = (dg_info)0;
154
static dg_info proc_dg_info = (dg_info)0;
125
static dg_type return_type = (dg_type)0;
155
static dg_type return_type = (dg_type)0;
126
 
156
 
222
{
970
{
-
 
971
	while (dl) {
-
 
972
		int has_child = 0;
-
 
973
		int has_dest = 0;
-
 
974
		int reason = dl->why;
-
 
975
		dg_info d_src = dl->info;
-
 
976
		dg_info more_src = (dg_info)0;
-
 
977
		dg_tag tg = dl->tg;
223
  while (default_span_list) {
978
		while (tg && tg->copy) {
-
 
979
			tg = tg->copy;
-
 
980
		}
-
 
981
		if (tg && tg->p.info->key == DGA_MOVD) {
-
 
982
			d_src = tg->p.info;
-
 
983
			reason = d_src->data.i_movd.reason;
224
    out_dwf_label (default_span_list->lab, 1);
984
			if (d_src->data.i_movd.lost) {
-
 
985
				tg = d_src->data.i_movd.tg;
-
 
986
			} else {
-
 
987
				has_dest = 1;
-
 
988
			}
-
 
989
			d_src = d_src->more;
-
 
990
		}
-
 
991
		if (has_dest) {
-
 
992
			if (d_src->key == DGA_SRC && !doing_abstract) {
225
    IGNORE dw_entry (dwe_span, (long)0);
993
				IGNORE dw_entry(dwe_displ_x, (long)0);
-
 
994
				dw_at_ext_address(tg);
-
 
995
				dw_at_decl(d_src->data.i_src.startpos);
-
 
996
			} else if (!doing_abstract &&
-
 
997
				   d_src->key != DGA_INL_RES &&
-
 
998
				   (d_src->key != DGA_RVS ||
-
 
999
				    !d_src->data.i_rvs.has_iv) &&
-
 
1000
				   d_src->key != DGA_BEG &&
-
 
1001
				   d_src->key != DGA_BAR) {
226
    IGNORE dw_entry (dwe_span_strt, (long)0);
1002
				IGNORE dw_entry(dwe_displaced, (long)0);
-
 
1003
				dw_at_ext_address(tg);
-
 
1004
			}
-
 
1005
		} else {
-
 
1006
			if (d_src->key == DGA_SRC && !doing_abstract) {
-
 
1007
				IGNORE dw_entry((tg ? dwe_absent_xr :
-
 
1008
						 dwe_absent_x), (long)0);
-
 
1009
				dw_at_udata((unsigned long)reason);
-
 
1010
				if (tg) {
-
 
1011
					dw_at_ext_address(tg);
-
 
1012
				}
227
    dw_at_decl (shorten_sourcepos (default_span_list->span));
1013
				dw_at_decl(d_src->data.i_src.startpos);
-
 
1014
			} else if (d_src->key == DGA_NAME) {
-
 
1015
				/* included when doing_abstract */
-
 
1016
				more_src = d_src;
-
 
1017
			} else if (!doing_abstract &&
-
 
1018
				   d_src->key != DGA_INL_RES &&
-
 
1019
				   (d_src->key != DGA_RVS ||
-
 
1020
				    !d_src->data.i_rvs.has_iv) &&
-
 
1021
				   d_src->key != DGA_BEG &&
-
 
1022
				   d_src->key != DGA_BAR) {
-
 
1023
				has_child = 1;
-
 
1024
				more_src = d_src;
-
 
1025
				more_src->more = (dg_info)0;
228
    IGNORE dw_entry (dwe_span_end, (long)0);
1026
				IGNORE dw_entry((tg ? dwe_absent_r :
-
 
1027
						 dwe_absent), (long)0);
229
    dw_at_decl (end_sourcepos (default_span_list->span));
1028
				dw_at_udata((unsigned long)reason);
-
 
1029
				if (tg) {
-
 
1030
					dw_at_ext_address(tg);
-
 
1031
				}
-
 
1032
			}
-
 
1033
		}
-
 
1034
		{
-
 
1035
			detch_info *old = sub_detch;
-
 
1036
			sub_detch = dl->sub;
-
 
1037
			output_info(nilexp, more_src);
-
 
1038
			sub_detch = old;
-
 
1039
		}
-
 
1040
		if (has_child) {
230
    dw_sibling_end ();
1041
			dw_sibling_end();
-
 
1042
		}
231
    default_span_list = default_span_list->next;
1043
		dl = dl->next;
232
  }
1044
	}
233
  return;
1045
	return;
234
}
1046
}
235
 
1047
 
236
 
1048
 
237
static void out_refblock		/* Not certain this is needed! */
1049
static void
238
    PROTO_N ( (objs, assgn) )
1050
out_param(dg_param p)
239
    PROTO_T ( objset * objs X int assgn )
-
 
240
{
1051
{
-
 
1052
	/* within debug_info */
-
 
1053
	/* used for declarations only */
-
 
1054
	long attr1 = (H_TP | H_VP), attr2;
-
 
1055
	if (p.pnam[0]) {
-
 
1056
		attr1 |= H_NM;
-
 
1057
	}
-
 
1058
	if (p.ppos.file) {
241
  int count = 0;
1059
		attr1 |= H_XY;
-
 
1060
	}
242
#ifdef NEEDS_DEBUG_ALIGN
1061
#ifdef H_DX
-
 
1062
	if (p.p_dflt) {
-
 
1063
		if (p.p_dflt->span.sp_key == SP_SPAN ||
-
 
1064
		    (p.p_dflt->val && dw_is_const(son(p.p_dflt->val)))) {
-
 
1065
			attr1 |= H_DF;
-
 
1066
		} else {
-
 
1067
			attr1 |= H_DX;
-
 
1068
		}
-
 
1069
	}
-
 
1070
#else
-
 
1071
	if (p.p_dflt) {
243
  long over_lab;
1072
		attr1 |= H_DF;
-
 
1073
	}
244
#endif
1074
#endif
245
  objset * p = objs;
-
 
246
  while (p) {
-
 
247
    if (p->ass == assgn)
1075
	attr2 = dw_entry(dwe_param, attr1);
248
      count++;
-
 
249
    p = p->next;
-
 
250
  }
-
 
251
  out16();
-
 
252
#ifdef NEEDS_DEBUG_ALIGN
1076
#ifdef H_DX
253
  if (count) {
-
 
254
    over_lab = next_dwarf_label();
-
 
255
    out_dwf_label (over_lab, 0);
1077
	if (attr2 & ~(H_NM|H_XY|H_TP|H_VP|H_DF|H_DX)) {
256
    outs (" - . - 2");
-
 
257
  }
-
 
258
  else
1078
#else
-
 
1079
	if (attr2 & ~(H_NM|H_XY|H_TP|H_VP|H_DF)) {
259
#endif
1080
#endif
-
 
1081
			fail_unimplemented();
-
 
1082
	}
260
  outn (count * 4);
1083
	if (attr2 & H_NM) {
261
  d_outnl();
1084
		dw_at_string(p.pnam);
-
 
1085
	}
262
  if (count) {
1086
	if (attr2 & H_XY) {
263
    p = objs;
1087
		dw_at_decl(p.ppos);
-
 
1088
	}
264
    while (p) {
1089
	if (attr2 & H_TP) {
-
 
1090
		dw_at_ext_lab(dw2_find_type_label(p.p_typ));
-
 
1091
	}
265
      if (p->ass == assgn)
1092
	if (attr2 & H_VP) {
266
	dw_at_ext_address (p->tg);
1093
		int vp = 0;
-
 
1094
		if (p.pmode == DG_OUT_MODE || p.pmode == DG_INOUT_MODE) {
267
      p = p->next;
1095
			vp = 1;
268
    }
1096
		}
-
 
1097
		dw_at_flag(vp);
-
 
1098
	}
269
#ifdef NEEDS_DEBUG_ALIGN
1099
#ifdef H_DX
-
 
1100
	if (attr2 & H_DX) {
270
    out_dwf_label (over_lab, 1);
1101
		dw_at_flag((p.p_dflt && !(attr2 & H_DF))? 1 : 0);
-
 
1102
	}
271
#endif
1103
#endif
-
 
1104
	if (attr2 & H_DF) {
-
 
1105
		dw_out_default(p.p_dflt);
272
  }
1106
	}
273
  return;
1107
	return;
274
}
1108
}
275
 
1109
 
276
 
1110
 
425
	}
1181
	}
426
	else
-
 
427
	  check_trivial (e);
-
 
428
      }
-
 
429
      output_info (e, d->more);
-
 
430
      break;
-
 
431
    }
-
 
432
 
-
 
433
    case DGA_NAME: {
-
 
434
      local_var_place = d->data.i_nam.scope_start;
-
 
435
      dw2_out_name (d->data.i_nam.dnam, (e ? LOCAL_NAME : DEAD_NAME));
-
 
436
      output_info (e, d->more);
-
 
437
      break;
-
 
438
    }
-
 
439
 
-
 
440
    case DGA_WITH: {
-
 
441
      if (!doing_abstract) {
-
 
442
	if (!(d->data.i_with.lo_pc) || !e) {	/* optimised away */
-
 
443
	  check_trivial (e);
-
 
444
	  output_info (e, d->more);
-
 
445
	  break;
-
 
446
	}
-
 
447
	IGNORE dw_entry (dwe_with, (long)0);
-
 
448
	dw_at_ext_lab (dw2_find_type_label (d->data.i_with.w_typ));
-
 
449
	dw2_locate_exp (son(d->data.i_with.w_exp), 0, 0);
-
 
450
	dw_at_address (d->data.i_with.lo_pc);
-
 
451
	dw_at_address (d->data.i_with.hi_pc);
-
 
452
      }
-
 
453
      output_info (e, d->more);
-
 
454
      if (!doing_abstract) {
-
 
455
	dw_sibling_end ();
-
 
456
      }
-
 
457
      break;
-
 
458
    }
-
 
459
 
1182
 
-
 
1183
	if (p_t->data.t_proc.prps & (f_untidy | f_var_callees)) {
460
    case DGA_CALL: {
1184
		is_callable = DW_CC_nocall;
-
 
1185
	}
461
      if (doing_abstract)
1186
	if (di->mor && di->mor->refspec) {
462
        output_info (e, d->more);
1187
		attr1 = H_SP | H_XY;
463
      else {
1188
	} else {
464
	if (!(d->data.i_call.brk)) {	/* optimised away */
-
 
465
	  check_trivial (e);
1189
		attr1 = H_NM | H_XY;
466
	  output_info (e, d->more);
1190
		if (res_t) {
467
	  break;
1191
			attr1 |= H_TP;
468
	}
1192
		}
469
	IGNORE dw_entry (dwe_call, (long)0);
1193
		switch (di->idnam.id_key) {
470
	dw_at_string (d->data.i_call.clnam);
1194
		case DG_ID_EXT:
471
	dw_at_decl (d->data.i_call.pos);
1195
			attr1 |= H_EX;
472
	dw_at_udata ((unsigned long)d->data.i_call.ck);
-
 
473
	dw_at_address (d->data.i_call.brk);
1196
			break;
474
	dw2_locate_val (d->data.i_call.p);
1197
		case DG_ID_ARTFL:
475
	output_info (e, d->more);
1198
			attr1 |= H_AT;
476
      }
-
 
477
      break;
1199
			break;
478
    }
-
 
479
 
-
 
480
    case DGA_INL_CALL: {
1200
		case DG_ID_INST:
481
      int old_il = doing_inline;
-
 
482
      dg_type old_res = return_type;
-
 
483
      dg_name_list args = d->data.i_inl.args;
-
 
484
      dg_name di;
1201
			if (gnam[0]) {
485
      dg_type p_t, res_t;
1202
				attr1 |= H_GN;
-
 
1203
			}
486
      long brk = d->data.i_inl.lo_pc;
1204
			break;
487
      if (doing_abstract)
1205
		default:
488
	break;	/* no recursion */
1206
			break;
-
 
1207
		}
489
      di = d->data.i_inl.proc->p.nam;
1208
		if (p_t->data.t_proc.knowpro) {
490
      p_t = find_proc_type (di->data.n_proc.typ);
1209
			attr1 |= H_PT;
-
 
1210
		}
491
      res_t = p_t->data.t_proc.res_type;
1211
		if (p_t->data.t_proc.lang) {
492
      return_type = res_t;
1212
			attr1 |= H_LN;
493
      if (brk) {			/* sometimes lo = hi */
-
 
-
 
1213
		}
494
	IGNORE dw_entry (dwe_inl_call, (long)0);
1214
		if (p_t->data.t_proc.ccv) {
495
	dw_at_ext_address (d->data.i_inl.proc);
1215
			attr1 |= H_CC;
496
	dw_at_address (d->data.i_inl.lo_pc);
1216
			if (p_t->data.t_proc.ccv != DW_CC_normal) {
497
	dw_at_address (d->data.i_inl.hi_pc);
1217
				is_callable = p_t->data.t_proc.ccv;
498
      }
1218
			}
499
      else {	/* call compressed into operand, so no breakpoint */
-
 
500
	check_trivial (e);
1219
		}
-
 
1220
	}
501
	IGNORE dw_entry (dwe_inl_opnd, (long)0);
1221
	if (is_callable |= DW_CC_normal) {
502
	dw_at_ext_address (d->data.i_inl.proc);
1222
		attr1 |= H_CC;
503
      }
1223
	}
504
      doing_inline = 1;
1224
	if (di->mor && di->mor->isspec) {
505
      while (args) {
1225
		attr1 |= H_DC;
-
 
1226
	}
506
	dw2_out_name (args, INL_PARAM_NAME);
1227
	if (di->mor && di->mor->issep) {
507
	args = args->next;
1228
		attr1 |= H_SE;
508
      }
1229
	}
509
      if (extra_diags && brk) {
1230
	if (di->mor && di->mor->acc) {
510
	dg_info rets = d->data.i_inl.resref;
-
 
511
	long attr1 = H_XY, attr2;
1231
		attr1 |= H_AC;
-
 
1232
	}
512
	if (rets) {
1233
	if (di->mor && di->mor->virt) {
513
	  attr1 |= H_PC;
1234
		attr1 |= H_VT;
-
 
1235
	}
514
	  if (res_t)
1236
	if (di->mor && di->mor->vslot) {
515
	    attr1 |= H_LC;
1237
		attr1 |= H_VL;
516
	}
1238
	}
517
	do {
-
 
518
	  attr2 = dw_entry (dwe_return, attr1);
1239
	if (di->mor && di->mor->repn) {
519
	  if (attr2 & ~(H_XY|H_PC|H_LC))
1240
		attr1 |= H_RP;
520
	    fail_unimplemented ();
1241
	}
521
	  if (attr2 & H_XY)
1242
	doing_abstract = 0;
522
	    dw_at_decl (di->mor->end_pos);
1243
	if (di->mor && di->mor->this_tag) {
523
	  if (attr2 & H_PC)
-
 
524
	    dw_at_address (rets->data.i_res.brk);
1244
		set_ext_address(di->mor->this_tag);
525
	  if (attr2 & H_LC)
1245
		if (di->mor->this_tag->any_inl) {
526
	    dw2_locate_val (rets->data.i_res.res);
1246
			doing_abstract = 1;
527
	  if (!rets)
1247
			attr1 |= H_IL;
528
	    break;
1248
		}
529
	  rets = rets->data.i_res.next;
-
 
530
	}
1249
	}
531
	while (rets);
-
 
532
      }
-
 
533
      output_info (e, d->more);
-
 
534
      doing_inline = old_il;
-
 
535
      dw_sibling_end ();
-
 
536
      return_type = old_res;
-
 
537
      break;
-
 
538
    }
-
 
539
 
1250
 
1021
{
1494
{
1022
				/* within debug_info section */
-
 
1023
  int old_il = doing_inline;
-
 
1024
  int old_ab = doing_abstract;
-
 
1025
  long infolab = 0;
-
 
1026
  exp id;
-
 
1027
  dg_type p_t, res_t;
-
 
1028
  dg_type old_res = return_type;
-
 
1029
  long is_callable = DW_CC_normal;
-
 
1030
  char* nam;
-
 
1031
  char* gnam = "";
-
 
1032
  long attr1, attr2;
-
 
1033
  dg_instantn * generic = (dg_instantn *)0;
-
 
1034
  dg_info old_di = proc_dg_info;
-
 
1035
  proc_dg_info = (dg_info)0;
-
 
1036
  if (di->idnam.id_key == DG_ID_INST) {
-
 
1037
    generic = di->idnam.idd.instance;
-
 
1038
    if (generic->nam.id_key == DG_ID_ANON)
-
 
1039
      nam = generic->spec.idd.nam;
-
 
1040
    else {
-
 
1041
      nam = generic->nam.idd.nam;
-
 
1042
      gnam = generic->spec.idd.nam;
-
 
1043
    }
-
 
1044
  }
-
 
1045
  else
-
 
1046
    nam = di->idnam.idd.nam;
-
 
1047
  p_t = find_proc_type (di->data.n_proc.typ);
-
 
1048
  res_t = p_t->data.t_proc.res_type;
-
 
1049
  return_type = res_t;
-
 
1050
  id = di->data.n_proc.obtain_val;
-
 
1051
  if (id) {
1495
	while (p) {
1052
    exp p;
-
 
1053
    if (name(id) != hold_tag || name(son(id)) != name_tag) {
-
 
1054
      failer ("wrong proc obtain_tag");
-
 
1055
      return;
-
 
1056
    }
-
 
1057
    id = son(son(id));
-
 
1058
    p = son(id);
-
 
1059
    if (p) {
1496
		switch (p->key) {
1060
      exp t = son(p);
1497
		case DGN_OBJECT:
1061
      dw2_prepare_locate (id);
1498
			IGNORE dw_entry(dwe_tmpl_val, (long)0);
1062
      proc_dg_info = dgf(p);
-
 
1063
      if (proc_dg_info && proc_dg_info->key != DGA_PRC)
-
 
1064
	failer ("inconsistent proc info");
1499
			dw_at_string(idname_chars(p->idnam));
1065
      if (proc_has_vcallees(p))
-
 
1066
	is_callable = DW_CC_nocall;
-
 
1067
      while (name(t) == ident_tag && isparam(t) && name(son(t)) != formal_callee_tag)
-
 
1068
	t = bro(son(t));
-
 
1069
      if (name(t) == ident_tag && name(son(t)) == formal_callee_tag)
-
 
1070
	is_callable = DW_CC_nocall;
-
 
1071
      if (brog(id)->dec_u.dec_val.extnamed) {
-
 
1072
	infolab = next_dwarf_label ();
-
 
1073
	exit_section ();
1500
			dw_at_decl(p->whence);
1074
	enter_section ("debug_pubnames");
-
 
1075
	out32 (); out_dwf_labdiff (dw_info_start, infolab); d_outnl();
1501
			dw_at_ext_lab(dw2_find_type_label(p->data.n_obj.typ));
1076
	out_string (nam);
-
 
1077
	exit_section ();
-
 
1078
	enter_section ("debug_info");
-
 
1079
      }
-
 
1080
    }
-
 
1081
  }
-
 
1082
 
-
 
1083
  if (p_t->data.t_proc.prps & (f_untidy | f_var_callees))
1502
			dw_out_const(son(p->data.n_obj.obtain_val));
1084
    is_callable = DW_CC_nocall;
-
 
1085
  if (di->mor && di->mor->refspec)
-
 
1086
    attr1 = H_SP | H_XY;
-
 
1087
  else {
-
 
1088
    attr1 = H_NM | H_XY;
-
 
1089
    if (res_t)
-
 
1090
      attr1 |= H_TP;
-
 
1091
    switch (di->idnam.id_key) {
-
 
1092
      case DG_ID_EXT:
-
 
1093
	attr1 |= H_EX;
-
 
1094
	break;
-
 
1095
      case DG_ID_ARTFL:
-
 
1096
	attr1 |= H_AT;
-
 
1097
	break;
1503
			break;
1098
      case DG_ID_INST:
1504
		case DGN_TYPE:
1099
	if (gnam[0])
-
 
1100
	  attr1 |= H_GN;
-
 
1101
	break;
-
 
1102
      default:
-
 
1103
	break;
-
 
1104
    }
-
 
1105
    if (p_t->data.t_proc.knowpro)
-
 
1106
      attr1 |= H_PT;
-
 
1107
    if (p_t->data.t_proc.lang)
1505
			IGNORE dw_entry(dwe_tmpl_type, (long)0);
1108
      attr1 |= H_LN;
-
 
1109
    if (p_t->data.t_proc.ccv) {
-
 
1110
      attr1 |= H_CC;
-
 
1111
      if (p_t->data.t_proc.ccv != DW_CC_normal)
-
 
1112
	is_callable = p_t->data.t_proc.ccv;
-
 
1113
    }
-
 
1114
  }
-
 
1115
  if (is_callable |= DW_CC_normal)
-
 
1116
    attr1 |= H_CC;
-
 
1117
  if (di->mor && di->mor->isspec)
-
 
1118
    attr1 |= H_DC;
-
 
1119
  if (di->mor && di->mor->issep)
-
 
1120
    attr1 |= H_SE;
-
 
1121
  if (di->mor && di->mor->acc)
-
 
1122
    attr1 |= H_AC;
-
 
1123
  if (di->mor && di->mor->virt)
-
 
1124
    attr1 |= H_VT;
-
 
1125
  if (di->mor && di->mor->vslot)
-
 
1126
    attr1 |= H_VL;
-
 
1127
  if (di->mor && di->mor->repn)
-
 
1128
    attr1 |= H_RP;
-
 
1129
  doing_abstract = 0;
-
 
1130
  if (di->mor && di->mor->this_tag) {
-
 
1131
    set_ext_address (di->mor->this_tag);
1506
			dw_at_string(idname_chars(p->idnam));
1132
    if (di->mor->this_tag->any_inl) {
-
 
1133
      doing_abstract = 1;
-
 
1134
      attr1 |= H_IL;
-
 
1135
    }
-
 
1136
  }
-
 
1137
 
-
 
1138
  do {
-
 
1139
    if (!doing_abstract && proc_dg_info) {
-
 
1140
      if (infolab)
-
 
1141
	out_dwf_label (infolab, 1);
1507
			dw_at_decl(p->whence);
1142
      attr1 |= H_PC;
-
 
1143
      if (proc_dg_info->data.i_prc.p &&
-
 
1144
		proc_dg_info->data.i_prc.p->data.i_param.o_env)
1508
			dw_at_ext_lab(dw2_find_type_label(p->data.n_typ.raw));
1145
	attr1 |= H_SL;
1509
			break;
1146
      if (di->mor && di->mor->elabn)
-
 
1147
	attr1 |= H_EL;
1510
		case DGN_PROC:
1148
    }
-
 
1149
 
-
 
1150
    attr2 = dw_entry (dwe_proc, attr1);
1511
			IGNORE dw_entry(dwe_tmpl_proc, (long)0);
1151
 
-
 
1152
    if (attr2 & ~(H_AO|H_SP|H_DC|H_NM|H_XY|H_EX|H_AT|H_AC|H_CC|
-
 
1153
		  H_TP|H_PT|H_IL|H_VT|H_VL|H_PC|H_SL|H_EXTN))
-
 
1154
      fail_unimplemented ();
-
 
1155
    if (attr2 & H_AO)
-
 
1156
      dw_at_ext_address (di->mor->this_tag);
-
 
1157
    if (attr2 & H_SP)
-
 
1158
      dw_at_ext_address (di->mor->refspec);
-
 
1159
    if (attr2 & H_DC)
-
 
1160
      dw_at_flag ((di->mor && di->mor->isspec ? 1 : 0));
-
 
1161
    if (attr2 & H_NM)
-
 
1162
      dw_at_string (nam);
1512
			dw_at_string(idname_chars(p->idnam));
1163
    if (attr2 & H_XY)
-
 
1164
      dw_at_decl (di->whence);
1513
			dw_at_decl(p->whence);
1165
    if (attr2 & H_EX)
-
 
1166
      dw_at_flag ((di->idnam.id_key == DG_ID_EXT ? 1 : 0));
-
 
1167
    if (attr2 & H_AT)
-
 
1168
      dw_at_flag ((di->idnam.id_key == DG_ID_ARTFL ? 1 : 0));
-
 
1169
    if (attr2 & H_AC)
-
 
1170
      dw_at_data (1, (long)(di->mor ? di->mor->acc : 0));
-
 
1171
    if (attr2 & H_CC)
-
 
1172
      dw_at_data (1, is_callable);
-
 
1173
    if (attr2 & H_TP)
-
 
1174
      dw_at_ext_lab (dw2_find_type_label (res_t));
-
 
1175
    if (attr2 & H_PT)
-
 
1176
      dw_at_flag (p_t->data.t_proc.yespro);
-
 
1177
    if (attr2 & H_IL)
-
 
1178
      dw_at_data (1, (long)(di->mor->isinline ? DW_INL_declared_inlined :
-
 
1179
					      DW_INL_inlined));
-
 
1180
    if (attr2 & H_VT)
-
 
1181
      dw_at_data (1, (long)(di->mor ? di->mor->virt : 0));
-
 
1182
    if (attr2 & H_VL)
-
 
1183
      dw2_locate_exp (son(di->mor->vslot), 0, 0);
-
 
1184
    if (attr2 & H_PC) {
-
 
1185
      dw_at_address (proc_dg_info->data.i_prc.prc_start);
-
 
1186
      dw_at_address (proc_dg_info->data.i_prc.prc_end);
-
 
1187
      dw_at_procdetails ();	/* return address and frame_base */
-
 
1188
    }
-
 
1189
    if (attr2 & H_SL)
-
 
1190
      dw2_locate_exp (son(proc_dg_info->data.i_prc.p->data.i_param.o_env), 1, 0);
-
 
1191
 
-
 
1192
    if (attr2 & H_EXTN) {
-
 
1193
      long block_end = next_dwarf_label ();
-
 
1194
      attr1 &= ~attr2;
-
 
1195
      if (attr1 & ~(H_EL|H_GN|H_RP|H_LN|H_SE))
-
 
1196
	fail_unimplemented ();
-
 
1197
      out16 (); out_dwf_dist_to_label (block_end); d_outnl();
-
 
1198
      if (attr1 & H_EL) {
-
 
1199
	set_attribute (DW_AT_DD_elaboration, DW_FORM_ref_addr);
-
 
1200
	dw_at_ext_address (di->mor->elabn);
1514
			dw_at_ext_address(p->mor->refspec);
1201
      }
1515
			break;
1202
      if (attr1 & H_GN) {
-
 
1203
	set_attribute (DW_AT_DD_generic_name, DW_FORM_string);
-
 
1204
	dw_at_string (gnam);
1516
		case DGN_MODULE:
1205
      }
-
 
1206
      if (attr1 & H_RP) {
-
 
1207
	set_attribute (DW_AT_DD_repn, 0);
-
 
1208
	dw_out_const (son (di->mor->repn));
-
 
1209
      }
-
 
1210
      if (attr1 & H_LN) {
-
 
1211
	set_attribute (DW_AT_language, DW_FORM_udata);
-
 
1212
	dw_at_udata ((unsigned long)(p_t->data.t_proc.lang));
-
 
1213
      }
-
 
1214
      if (attr1 & H_SE) {
-
 
1215
	set_attribute (DW_AT_DD_separate, DW_FORM_flag);
-
 
1216
	dw_at_flag ((di->mor && di->mor->issep ? 1 : 0));
-
 
1217
      }
-
 
1218
      set_attribute (0, 0);
-
 
1219
      out_dwf_label (block_end, 1);
-
 
1220
    }
-
 
1221
 
-
 
1222
    if (!doing_abstract && generic)
-
 
1223
      dw2_out_generic (generic->params);
-
 
1224
 
-
 
1225
    if (!doing_abstract && !proc_dg_info && !di->data.n_proc.params) {
-
 
1226
		/* must be declaration only */
-
 
1227
      dg_param * el = p_t->data.t_proc.params.array;
-
 
1228
      int i;
-
 
1229
      for (i = 0; i < p_t->data.t_proc.params.len; i++)
-
 
1230
	out_param (el[i]);
-
 
1231
      if (p_t->data.t_proc.prps & f_var_callers)
-
 
1232
	IGNORE dw_entry (dwe_opt_par, (long)0);
1517
			IGNORE dw_entry(dwe_tmpl_mod, (long)0);
1233
 
-
 
1234
      if (di->mor && di->mor->en_family)
-
 
1235
	dw_out_dim (*(di->mor->en_family));
1518
			dw_at_string(idname_chars(p->idnam));
1236
      dw_sibling_end ();
1519
			dw_at_decl(p->whence);
1237
      break;	/* to return */
-
 
1238
    }
-
 
1239
    {
-
 
1240
      dg_name param = (dg_name)0;
1520
			dw_at_ext_address(p->mor->refspec);
1241
      dg_param * el = p_t->data.t_proc.params.array;
-
 
1242
      int w = 0;
1521
			break;
1243
      if (proc_dg_info && proc_dg_info->data.i_prc.p)
-
 
1244
	param = proc_dg_info->data.i_prc.p->data.i_param.args;
-
 
1245
      else
1522
		default:
1246
      if (di->data.n_proc.params)
-
 
1247
	param = di->data.n_proc.params->data.i_param.args;
-
 
1248
      while (param) {
-
 
1249
	if (param->key == DGN_OBJECT) {
-
 
1250
	  if (w < p_t->data.t_proc.params.len)
-
 
1251
	    param->data.n_obj.p = &(el[w]);
-
 
1252
	  else
1523
			break;
1253
	    param->data.n_obj.p = (dg_param *)0;
-
 
1254
	}
1524
		}
1255
	if (doing_abstract) {
1525
		p = p->next;
1256
	  if (!(param->mor) || !(param->mor->this_tag))
-
 
1257
	    failer ("param inlining error");
-
 
1258
	  param->mor->inline_ref = param->mor->this_tag;
-
 
1259
	}
1526
	}
1260
	dw2_out_name (param, PARAM_NAME);
-
 
1261
	param = param->next;
-
 
1262
	w++;
1527
	return;
1263
      }
-
 
1264
    }
1528
}
1265
    if (p_t->data.t_proc.prps & f_var_callers)
-
 
1266
      IGNORE dw_entry (dwe_opt_par, (long)0);
-
 
1267
 
1529
 
1268
    if (!doing_abstract && di->mor && di->mor->exptns.len) {
-
 
1269
      dg_type * et = di->mor->exptns.array;
-
 
1270
      int i;
-
 
1271
      for (i = 0; i < di->mor->exptns.len; i++) {
-
 
1272
	IGNORE dw_entry (dwe_thrown_t, (long)0);
-
 
1273
	dw_at_ext_lab (dw2_find_type_label (et[i]));
-
 
1274
      }
-
 
1275
    }
-
 
1276
    if (di->mor && di->mor->en_family)
-
 
1277
      dw_out_dim (*(di->mor->en_family));
-
 
1278
    if (proc_dg_info && proc_dg_info->data.i_prc.barrier) {
-
 
1279
      dg_info b = proc_dg_info->data.i_prc.barrier;
-
 
1280
      IGNORE dw_entry (dwe_barrier, (long)0);
-
 
1281
      dw_at_decl (b->data.i_bar.pos);
-
 
1282
      dw_at_address (b->data.i_bar.lo_pc);
-
 
1283
      dw_at_address (b->data.i_bar.hi_pc);
-
 
1284
    }
-
 
1285
 
-
 
1286
    if (!doing_abstract && extra_diags && proc_dg_info) {
-
 
1287
      long atret1 = H_XY, atret2;
-
 
1288
      retrec * rets = proc_dg_info->data.i_prc.returns;
-
 
1289
      if (rets) {
-
 
1290
	atret1 |= H_PC;
-
 
1291
	if (res_t)
-
 
1292
	  atret1 |= H_LC;
-
 
1293
      }
-
 
1294
      do {
-
 
1295
	atret2 = dw_entry (dwe_return, atret1);
-
 
1296
	if (atret2 & ~(H_XY|H_PC|H_LC))
-
 
1297
	  fail_unimplemented ();
-
 
1298
	if (atret2 & H_XY)
-
 
1299
	  dw_at_decl (di->mor->end_pos);
-
 
1300
	if (atret2 & H_PC)
-
 
1301
	  dw_at_address (rets->lab);
-
 
1302
	if (atret2 & H_LC)
-
 
1303
	  dw2_locate_result (pt(son(id)));
-
 
1304
	if (!rets)
-
 
1305
	  break;
-
 
1306
	rets = rets->next;
-
 
1307
      }
-
 
1308
      while (rets);
-
 
1309
    }
-
 
1310
 
-
 
1311
    if (id && (proc_dg_info || doing_abstract)) {
-
 
1312
      output_info (son(id), (proc_dg_info ? dgf(son(id))->more : dgf(son(id))));
-
 
1313
    }
-
 
1314
 
-
 
1315
    dw_sibling_end ();
-
 
1316
    if (doing_abstract) {
-
 
1317
      doing_abstract = 0;
-
 
1318
      doing_inline = 1;
-
 
1319
      attr1 = H_AO;
-
 
1320
    }
-
 
1321
    else
-
 
1322
      break;
-
 
1323
  }
-
 
1324
  while (proc_dg_info);
-
 
1325
 
-
 
1326
  doing_abstract = old_ab;
-
 
1327
  doing_inline = old_il;
-
 
1328
  proc_dg_info = old_di;
-
 
1329
  return_type = old_res;
-
 
1330
  return;
-
 
1331
}
-
 
1332
 
1530
 
1333
 
1531
void
1334
void dw2_out_generic
-
 
1335
    PROTO_N ( (p) )
-
 
1336
    PROTO_T ( dg_name_list p )
1532
dw2_out_name(dg_name di, dg_nm_contex contex)
1337
{
1533
{
1338
  while (p) {
-
 
1339
    switch (p->key) {
-
 
1340
      case DGN_OBJECT: {
-
 
1341
	IGNORE dw_entry (dwe_tmpl_val, (long)0);
-
 
1342
	dw_at_string (idname_chars (p->idnam));
-
 
1343
	dw_at_decl (p->whence);
-
 
1344
	dw_at_ext_lab (dw2_find_type_label (p->data.n_obj.typ));
-
 
1345
	dw_out_const (son (p->data.n_obj.obtain_val));
-
 
1346
	break;
-
 
1347
      }
-
 
1348
      case DGN_TYPE: {
-
 
1349
	IGNORE dw_entry (dwe_tmpl_type, (long)0);
-
 
1350
	dw_at_string (idname_chars (p->idnam));
-
 
1351
	dw_at_decl (p->whence);
-
 
1352
	dw_at_ext_lab (dw2_find_type_label (p->data.n_typ.raw));
-
 
1353
	break;
-
 
1354
      }
-
 
1355
      case DGN_PROC: {
-
 
1356
	IGNORE dw_entry (dwe_tmpl_proc, (long)0);
-
 
1357
	dw_at_string (idname_chars (p->idnam));
-
 
1358
	dw_at_decl (p->whence);
-
 
1359
	dw_at_ext_address (p->mor->refspec);
-
 
1360
	break;
-
 
1361
      }
-
 
1362
      case DGN_MODULE: {
-
 
1363
	IGNORE dw_entry (dwe_tmpl_mod, (long)0);
-
 
1364
	dw_at_string (idname_chars (p->idnam));
-
 
1365
	dw_at_decl (p->whence);
-
 
1366
	dw_at_ext_address (p->mor->refspec);
-
 
1367
	break;
-
 
1368
      }
-
 
1369
      default:
-
 
1370
	break;
-
 
1371
    }
-
 
1372
    p = p->next;
-
 
1373
  }
-
 
1374
  return;
-
 
1375
}
-
 
1376
 
-
 
1377
 
-
 
1378
void dw2_out_name
-
 
1379
    PROTO_N ( (di, contex) )
-
 
1380
    PROTO_T ( dg_name di X dg_nm_contex contex )
-
 
1381
{
-
 
1382
				/* in debug_info section */
1534
	/* in debug_info section */
1383
  dg_tag inl_tag = (di->mor ? di->mor->inline_ref : (dg_tag)0);
1535
	dg_tag inl_tag = (di->mor ? di->mor->inline_ref : (dg_tag)0);
1384
  if (di->mor && di->mor->this_tag && !di->mor->this_tag->outref.k) {
1536
	if (di->mor && di->mor->this_tag && !di->mor->this_tag->outref.k) {
1385
    di->mor->this_tag->outref.k = LAB_D;
1537
		di->mor->this_tag->outref.k = LAB_D;
1386
    di->mor->this_tag->outref.u.l = next_dwarf_label ();
1538
		di->mor->this_tag->outref.u.l = next_dwarf_label();
1387
  }
1539
	}
1388
 
1540
 
1389
				/* EXCEPT_NAME, INSTANTN_NAME not done yet */
1541
	/* EXCEPT_NAME, INSTANTN_NAME not done yet */
1390
  if ((contex == LOCAL_NAME || contex == DEAD_NAME) && !doing_abstract) {
1542
	if ((contex == LOCAL_NAME || contex == DEAD_NAME) && !doing_abstract) {
1391
    if (!dw2_scope_start)
1543
		if (!dw2_scope_start) {
1392
      failer ("missing scope");
1544
			failer("missing scope");
1393
  }
1545
		}
-
 
1546
	}
1394
 
1547
 
1395
  switch (di->key) {
1548
	switch (di->key) {
-
 
1549
	case DGN_OBJECT: {
-
 
1550
		exp x = di->data.n_obj.obtain_val;
-
 
1551
		dg_type typ = di->data.n_obj.typ;
-
 
1552
		dg_param *ppar = (contex == PARAM_NAME ? di->data.n_obj.p :
-
 
1553
				  (dg_param *)0);
-
 
1554
		char *nam = idname_chars(di->idnam);
-
 
1555
		long attr1 = 0, attr2;
-
 
1556
		long loclab = 0, loclabext = 0, infolab = 0;
-
 
1557
		abbrev_entry dwe;
-
 
1558
		if ((inl_tag && !doing_inline && !doing_abstract) ||
-
 
1559
		    (!inl_tag && doing_inline)) {
-
 
1560
			failer("inline inconsistency");
-
 
1561
		}
1396
 
1562
 
1397
    case DGN_OBJECT: {
1563
		if (contex == GLOBAL_NAME && di->idnam.id_key == DG_ID_EXT &&
1398
      exp x = di->data.n_obj.obtain_val;
1564
		    x && find_id(son(x))) {
1399
      dg_type typ = di->data.n_obj.typ;
1565
			infolab = next_dwarf_label();
1400
      dg_param * ppar = (contex == PARAM_NAME ? di->data.n_obj.p : (dg_param *)0);
1566
			exit_section();
1401
      char* nam = idname_chars (di->idnam);
1567
			enter_section("debug_pubnames");
1402
      long attr1 = 0, attr2;
1568
			out32();
1403
      long loclab = 0, loclabext = 0, infolab = 0;
1569
			out_dwf_labdiff(dw_info_start, infolab);
-
 
1570
			d_outnl();
1404
      abbrev_entry dwe;
1571
			dw_at_string(nam);
1405
      if ((inl_tag && !doing_inline && !doing_abstract) || (!inl_tag && doing_inline))
1572
			exit_section();
1406
	failer ("inline inconsistency");
1573
			enter_section("debug_info");
-
 
1574
		}
1407
 
1575
 
1408
      if (contex == GLOBAL_NAME && di->idnam.id_key == DG_ID_EXT &&
1576
		if (contex == PARAM_NAME || contex == INL_PARAM_NAME) {
1409
		x && find_id (son(x))) {
-
 
1410
	infolab = next_dwarf_label ();
1577
			dwe = dwe_param;
1411
	exit_section ();
-
 
1412
	enter_section ("debug_pubnames");
1578
		} else if (di->mor && di->mor->isconst) {
1413
	out32 (); out_dwf_labdiff (dw_info_start, infolab); d_outnl();
-
 
1414
	dw_at_string (nam);
1579
			dwe = dwe_constant;
1415
	exit_section ();
1580
		} else {
1416
	enter_section ("debug_info");
1581
			dwe = dwe_variable;
1417
      }
1582
		}
1418
 
1583
 
1419
      if (contex == PARAM_NAME || contex == INL_PARAM_NAME)
-
 
1420
	dwe = dwe_param;
-
 
1421
      else
-
 
1422
      if (di->mor && di->mor->isconst)
-
 
1423
	dwe = dwe_constant;
-
 
1424
      else
-
 
1425
	dwe = dwe_variable;
-
 
1426
 
-
 
1427
      if (doing_inline)
1584
		if (doing_inline) {
1428
	attr1 |= H_AO;
1585
			attr1 |= H_AO;
1429
      else {
1586
		} else {
1430
	if (di->mor && di->mor->refspec)
1587
			if (di->mor && di->mor->refspec) {
1431
	  attr1 |= (H_SP | H_XY);
1588
				attr1 |= (H_SP | H_XY);
1432
	else {
1589
			} else {
1433
	  attr1 |= (H_NM | H_XY | H_TP);
1590
				attr1 |= (H_NM | H_XY | H_TP);
1434
	  if (contex == GLOBAL_NAME)
1591
				if (contex == GLOBAL_NAME) {
1435
	    attr1 |= H_EX;
1592
					attr1 |= H_EX;
-
 
1593
				}
1436
	  if (di->idnam.id_key == DG_ID_ARTFL)
1594
				if (di->idnam.id_key == DG_ID_ARTFL) {
1437
	    attr1 |= H_AT;
1595
					attr1 |= H_AT;
-
 
1596
				}
1438
	}
1597
			}
1439
	if (di->mor && di->mor->isspec)
1598
			if (di->mor && di->mor->isspec) {
1440
	  attr1 |= H_DC;
1599
				attr1 |= H_DC;
-
 
1600
			}
1441
	if (di->mor && di->mor->acc)
1601
			if (di->mor && di->mor->acc) {
1442
	  attr1 |= H_AC;
1602
				attr1 |= H_AC;
-
 
1603
			}
1443
	if (contex == PARAM_NAME) {
1604
			if (contex == PARAM_NAME) {
1444
	  attr1 |= H_VP;
1605
				attr1 |= H_VP;
1445
#ifdef H_DX
1606
#ifdef H_DX
1446
	  if (ppar && ppar->p_dflt) {
1607
				if (ppar && ppar->p_dflt) {
1447
	    if (ppar->p_dflt->span.sp_key == SP_SPAN ||
1608
					if (ppar->p_dflt->span.sp_key ==
-
 
1609
					    SP_SPAN ||
-
 
1610
					    (ppar->p_dflt->val &&
1448
		(ppar->p_dflt->val && dw_is_const (son(ppar->p_dflt->val)) ))
1611
					     dw_is_const(son(ppar->p_dflt->val)))) {
1449
	      attr1 |= H_DF;
1612
						attr1 |= H_DF;
1450
	    else
1613
					} else {
1451
	      attr1 |= H_DX;
1614
						attr1 |= H_DX;
-
 
1615
					}
1452
	  }
1616
				}
1453
#else
1617
#else
1454
	  if (ppar && ppar->p_dflt)
1618
				if (ppar && ppar->p_dflt) {
1455
	    attr1 |= H_DF;
1619
					attr1 |= H_DF;
-
 
1620
				}
-
 
1621
#endif
-
 
1622
			}
-
 
1623
			if (di->mor && di->mor->repn) {
-
 
1624
				attr1 |= H_RP;
-
 
1625
			}
-
 
1626
		}
-
 
1627
		if (!doing_abstract && !(attr1 & H_DC)) {
-
 
1628
			if (!x) {
-
 
1629
				failer("obtain_value missing");
-
 
1630
			}
-
 
1631
			if (contex == LOCAL_NAME || contex == DEAD_NAME) {
-
 
1632
				attr1 |= H_SS;
-
 
1633
			}
-
 
1634
			if (contex != DEAD_NAME && dw_is_const(son(x))) {
-
 
1635
				attr1 |= H_CV;
-
 
1636
			} else {
-
 
1637
				int ll = decide_ll_type(x);
-
 
1638
				if (!ll && contex == PARAM_NAME) {
-
 
1639
					ll = 1;
-
 
1640
				}
-
 
1641
				attr1 |= (ll ? H_LL : H_LC);
-
 
1642
				if (ll > 1) {
-
 
1643
					attr1 |= H_LE;
-
 
1644
				}
-
 
1645
			}
-
 
1646
		}
-
 
1647
 
-
 
1648
		if (di->mor && di->mor->this_tag) {
-
 
1649
			if (doing_abstract) {
-
 
1650
				set_abstract_lab(di->mor->this_tag);
-
 
1651
			} else {
-
 
1652
				set_ext_address(di->mor->this_tag);
-
 
1653
			}
-
 
1654
		}
-
 
1655
		if (infolab) {
-
 
1656
			out_dwf_label(infolab, 1);
-
 
1657
		}
-
 
1658
		attr2 = dw_entry(dwe, attr1);
-
 
1659
		if (attr2 & ~(H_AO|H_SP|H_DC|H_NM|H_XY|H_EX|H_AT|H_AC|H_TP|H_VP|
-
 
1660
#ifdef H_DX
-
 
1661
			      H_SS|H_LC|H_LL|H_LE|H_CV|H_RP|H_DF|H_DX)) {
-
 
1662
#else
-
 
1663
			      H_SS|H_LC|H_LL|H_LE|H_CV|H_RP|H_DF)) {
1456
#endif
1664
#endif
1457
	}
-
 
1458
	if (di->mor && di->mor->repn)
-
 
1459
	  attr1 |= H_RP;
-
 
1460
      }
-
 
1461
      if (!doing_abstract && !(attr1 & H_DC)) {
-
 
1462
	if (!x)
-
 
1463
	  failer ("obtain_value missing");
-
 
1464
	if (contex == LOCAL_NAME || contex == DEAD_NAME)
-
 
1465
	  attr1 |= H_SS;
-
 
1466
	if (contex != DEAD_NAME && dw_is_const (son(x)))
-
 
1467
	  attr1 |= H_CV;
-
 
1468
	else {
-
 
1469
	  int ll = decide_ll_type (x);
1665
			    fail_unimplemented();
1470
	  if (!ll && contex == PARAM_NAME)
-
 
1471
	    ll = 1;
-
 
1472
	  attr1 |= (ll ? H_LL : H_LC);
-
 
1473
	  if (ll > 1)
-
 
1474
	    attr1 |= H_LE;
-
 
1475
	}
1666
		}
1476
      }
-
 
1477
 
1667
 
1478
      if (di->mor && di->mor->this_tag) {
1668
		if (attr2 & H_AO) {
-
 
1669
			dw_at_abstract_lab(inl_tag);
-
 
1670
		}
1479
	if (doing_abstract)
1671
		if (attr2 & H_SP) {
1480
	  set_abstract_lab (di->mor->this_tag);
1672
			dw_at_ext_address(di->mor->refspec);
1481
	else
1673
		}
-
 
1674
		if (attr2 & H_DC) {
1482
	  set_ext_address (di->mor->this_tag);
1675
			dw_at_flag((di->mor && di->mor->isspec ? 1 : 0));
1483
      }
1676
		}
-
 
1677
		if (attr2 & H_NM) {
1484
      if (infolab)
1678
			dw_at_string(nam);
-
 
1679
		}
-
 
1680
		if (attr2 & H_XY) {
-
 
1681
			dw_at_decl(di->whence);
-
 
1682
		}
-
 
1683
		if (attr2 & H_EX) {
1485
	out_dwf_label (infolab, 1);
1684
			dw_at_flag((infolab ? 1 : 0));
-
 
1685
		}
-
 
1686
		if (attr2 & H_AT) {
-
 
1687
			dw_at_flag((di->idnam.id_key == DG_ID_ARTFL ? 1 : 0));
-
 
1688
		}
-
 
1689
		if (attr2 & H_AC) {
-
 
1690
			dw_at_data(1, (long)(di->mor ? di->mor->acc : 0));
-
 
1691
		}
-
 
1692
		if (attr2 & H_TP) {
1486
      attr2 = dw_entry (dwe, attr1);
1693
			dw_at_ext_lab(dw2_find_type_label(typ));
-
 
1694
		}
-
 
1695
		if (attr2 & H_VP) {
-
 
1696
			int vp = 0;
1487
      if (attr2 & ~(H_AO|H_SP|H_DC|H_NM|H_XY|H_EX|H_AT|H_AC|H_TP|H_VP|
1697
			if (ppar && (ppar->pmode == DG_OUT_MODE ||
-
 
1698
				     ppar->pmode == DG_INOUT_MODE)) {
-
 
1699
				vp = 1;
-
 
1700
			}
-
 
1701
			dw_at_flag(vp);
-
 
1702
		}
1488
#ifdef H_DX
1703
#ifdef H_DX
-
 
1704
		if (attr2 & H_DX) {
-
 
1705
			dw_at_flag((ppar && ppar->p_dflt &&
1489
		    H_SS|H_LC|H_LL|H_LE|H_CV|H_RP|H_DF|H_DX))
1706
				    !(attr2 & H_DF)) ? 1 : 0);
1490
#else
1707
		}
1491
		    H_SS|H_LC|H_LL|H_LE|H_CV|H_RP|H_DF))
-
 
1492
#endif
1708
#endif
-
 
1709
		if (attr2 & H_DF) {
-
 
1710
			dw_out_default(ppar->p_dflt);
-
 
1711
		}
-
 
1712
		if (attr2 & H_SS) {
-
 
1713
			dw_at_distance(dw2_scope_start, local_var_place);
-
 
1714
		}
-
 
1715
		if (attr2 & H_CV) {
-
 
1716
			dw_out_const(son(x));
-
 
1717
		}
-
 
1718
		if (attr2 & H_LC) {
-
 
1719
			if (contex == DEAD_NAME) {
1493
	fail_unimplemented ();
1720
				dw_no_locate();
-
 
1721
			} else {
-
 
1722
				dw2_locate_exp(son(x), 0, 0);
-
 
1723
			}
-
 
1724
		}
-
 
1725
		if (attr2 & H_LL) {
-
 
1726
			dw_at_address(loclab = next_dwarf_label());
-
 
1727
		}
-
 
1728
		if (attr2 & H_LE) {
-
 
1729
			dw_at_address(loclabext = next_dwarf_label());
-
 
1730
		}
-
 
1731
		if (attr2 & H_RP) {
-
 
1732
			dw_out_const(son(di->mor->repn));
-
 
1733
		}
1494
 
1734
 
1495
      if (attr2 & H_AO)
-
 
1496
	dw_at_abstract_lab (inl_tag);
-
 
1497
      if (attr2 & H_SP)
-
 
1498
	dw_at_ext_address (di->mor->refspec);
-
 
1499
      if (attr2 & H_DC)
-
 
1500
	dw_at_flag ((di->mor && di->mor->isspec ? 1 : 0));
-
 
1501
      if (attr2 & H_NM)
-
 
1502
	dw_at_string (nam);
-
 
1503
      if (attr2 & H_XY)
-
 
1504
	dw_at_decl (di->whence);
-
 
1505
      if (attr2 & H_EX)
-
 
1506
	dw_at_flag ((infolab ? 1 : 0));
-
 
1507
      if (attr2 & H_AT)
-
 
1508
	dw_at_flag ((di->idnam.id_key == DG_ID_ARTFL ? 1 : 0));
-
 
1509
      if (attr2 & H_AC)
-
 
1510
	dw_at_data (1, (long)(di->mor ? di->mor->acc : 0));
-
 
1511
      if (attr2 & H_TP)
-
 
1512
	dw_at_ext_lab (dw2_find_type_label (typ));
-
 
1513
      if (attr2 & H_VP) {
-
 
1514
	int vp = 0;
-
 
1515
	if (ppar && (ppar->pmode == DG_OUT_MODE || ppar->pmode == DG_INOUT_MODE))
-
 
1516
	  vp = 1;
-
 
1517
	dw_at_flag (vp);
-
 
1518
      }
-
 
1519
#ifdef H_DX
-
 
1520
      if (attr2 & H_DX)
-
 
1521
	dw_at_flag ((ppar && ppar->p_dflt && !(attr2 & H_DF)) ? 1 : 0);
-
 
1522
#endif
-
 
1523
      if (attr2 & H_DF)
-
 
1524
	dw_out_default (ppar->p_dflt);
-
 
1525
      if (attr2 & H_SS)
-
 
1526
	dw_at_distance (dw2_scope_start, local_var_place);
-
 
1527
      if (attr2 & H_CV)
-
 
1528
	dw_out_const (son(x));
-
 
1529
      if (attr2 & H_LC) {
-
 
1530
	if (contex == DEAD_NAME)
-
 
1531
	  dw_no_locate ();
-
 
1532
	else
-
 
1533
	  dw2_locate_exp (son(x), 0, 0);
-
 
1534
      }
-
 
1535
      if (attr2 & H_LL)
-
 
1536
	dw_at_address (loclab = next_dwarf_label ());
-
 
1537
      if (attr2 & H_LE)
-
 
1538
	dw_at_address (loclabext = next_dwarf_label ());
-
 
1539
      if (attr2 & H_RP)
-
 
1540
	dw_out_const (son (di->mor->repn));
-
 
1541
 
-
 
1542
      if (loclab) {
1735
		if (loclab) {
1543
	long lstart, lend;
1736
			long lstart, lend;
1544
#if 0
-
 
1545
	retrec * rets = proc_dg_info->data.i_prc.returns;
-
 
1546
	long rstart = proc_dg_info->data.i_prc.p->data.i_param.b_start, rend;
-
 
1547
#endif
-
 
1548
	exit_section ();
-
 
1549
	enter_section ("debug_loc");
-
 
1550
	out_dwf_label (loclab, 1);
-
 
1551
	if (contex == PARAM_NAME) {
-
 
1552
	  lstart = proc_dg_info->data.i_prc.prc_start;
-
 
1553
	  out_loc_range (lstart, lstart, 1);
-
 
1554
	  dw2_locate_exp (son(x), 0, 3);
-
 
1555
	  lstart = proc_dg_info->data.i_prc.p->data.i_param.b_start;
-
 
1556
	  lend = proc_dg_info->data.i_prc.prc_end;
-
 
1557
	}
-
 
1558
	else {
-
 
1559
	  lstart = dw2_scope_start;
-
 
1560
	  lend = dw2_scope_end;
-
 
1561
	}
-
 
1562
	out_obj_loclist (lstart, lend, x);
-
 
1563
#if 0
1737
#if 0
1564
	while (rets) {
-
 
1565
	  if (rets->over) {
-
 
1566
	    rend = rets->lab;
-
 
1567
	    if (rend != rstart) {
-
 
1568
	      out_loc_range (rstart, rend, 0);
-
 
1569
	      dw2_locate_exp (son(x), 0, 1);
-
 
1570
	    }
-
 
1571
	    rstart = rets->over;
-
 
1572
	  }
-
 
1573
	  rets = rets->next;
-
 
1574
	}
-
 
1575
	rend = proc_dg_info->data.i_prc.prc_end;
1738
			retrec * rets = proc_dg_info->data.i_prc.returns;
1576
	if (rend != rstart) {
-
 
1577
	  out_loc_range (rstart, rend, 0);
1739
			long rstart = proc_dg_info->data.i_prc.p->data.i_param.b_start, rend;
1578
	  dw2_locate_exp (son(x), 0, 1);
-
 
1579
	}
-
 
1580
#endif
1740
#endif
1955
{
2231
{
1956
  retrec * rec = (retrec *) xmalloc (sizeof (retrec));
2232
	retrec *rec = (retrec *)xmalloc(sizeof(retrec));
1957
  rec->lab = set_dw_text_label ();
2233
	rec->lab = set_dw_text_label();
1958
  rec->over = over;
2234
	rec->over = over;
1959
  rec->next = (retrec *)0;
2235
	rec->next = (retrec *)0;
1960
  *returns_list = rec;
2236
	*returns_list = rec;
1961
  returns_list = &(rec->next);
2237
	returns_list = &(rec->next);
1962
  if (over)
2238
	if (over) {
1963
    set_obj_rets (rec);
2239
		set_obj_rets(rec);
-
 
2240
	}
1964
  return;
2241
	return;
1965
}
2242
}
1966
 
2243
 
1967
 
2244
 
1968
void dw2_proc_end
2245
void
1969
    PROTO_N ( (p) )
-
 
1970
    PROTO_T ( exp p )
2246
dw2_proc_end(exp p)
1971
{
2247
{
1972
  dgf(p)->data.i_prc.prc_end = set_dw_text_label ();
2248
	dgf(p)->data.i_prc.prc_end = set_dw_text_label();
1973
  proc_dg_info = (dg_info)0;
2249
	proc_dg_info = (dg_info)0;
1974
  return;
2250
	return;
1975
}
2251
}
1976
 
2252
 
1977
 
2253
 
1978
static void prepare_detch
2254
static void
1979
    PROTO_N ( (dl) )
-
 
1980
    PROTO_T ( detch_info * dl )
2255
prepare_detch(detch_info *dl)
1981
{
2256
{
1982
  while (dl) {
2257
	while (dl) {
1983
    int reason = dl->why;
2258
		int reason = dl->why;
1984
    dg_info d = dl->info;
2259
		dg_info d = dl->info;
1985
    dg_tag found_tg;
2260
		dg_tag found_tg;
1986
    if (reason >= DGD_MOVD) {
2261
		if (reason >= DGD_MOVD) {
1987
      found_tg = dl->tg;
2262
			found_tg = dl->tg;
1988
      while (found_tg->copy)
2263
			while (found_tg->copy) {
1989
	found_tg = found_tg->copy;
2264
				found_tg = found_tg->copy;
-
 
2265
			}
1990
      d = found_tg->p.info;
2266
			d = found_tg->p.info;
1991
      reason = d->data.i_movd.reason;
2267
			reason = d->data.i_movd.reason;
1992
      d = d->more;
2268
			d = d->more;
1993
    }
2269
		}
1994
    if (reason < DGD_MOVD) {
2270
		if (reason < DGD_MOVD) {
1995
      switch (d->key) {
2271
			switch (d->key) {
1996
	case DGA_NAME: {
2272
			case DGA_NAME:
1997
	  d->data.i_nam.scope_start = set_dw_text_label ();
2273
				d->data.i_nam.scope_start = set_dw_text_label();
1998
	  break;
2274
				break;
1999
	}
-
 
2000
	case DGA_SCOPE: {
2275
			case DGA_SCOPE:
2001
	  d->data.i_scope.start = set_dw_text_label ();
2276
				d->data.i_scope.start = set_dw_text_label();
2002
	  d->data.i_scope.end = set_dw_text_label ();
2277
				d->data.i_scope.end = set_dw_text_label();
-
 
2278
				break;
-
 
2279
			case DGA_REMVAL:
-
 
2280
				d->data.i_remval.lo_pc = set_dw_text_label();
-
 
2281
				set_remval_object(d);
-
 
2282
				break;
-
 
2283
			default:
2003
	  break;
2284
				break;
-
 
2285
			}
-
 
2286
		}
-
 
2287
		if (dl->sub) {
-
 
2288
			prepare_detch(dl->sub);
-
 
2289
		}
-
 
2290
		dl = dl->next;
2004
	}
2291
	}
2005
	case DGA_REMVAL: {
-
 
2006
	  d->data.i_remval.lo_pc = set_dw_text_label ();
-
 
2007
	  set_remval_object (d);
-
 
2008
	  break;
-
 
2009
	}
-
 
2010
	default:
-
 
2011
	  break;
-
 
2012
      }
-
 
2013
    }
-
 
2014
    if (dl->sub)
-
 
2015
      prepare_detch (dl->sub);
-
 
2016
    dl = dl->next;
-
 
2017
  }
-
 
2018
  return;
2292
	return;
2019
}
2293
}
2020
 
2294
 
2021
 
2295
 
2022
void dw2_code_info
2296
void
2023
    PROTO_N ( (d, mcode, args) )
-
 
2024
    PROTO_T ( dg_info d X void (*mcode) PROTO_S((void *)) X void * args )
2297
dw2_code_info(dg_info d, void(*mcode)(void *), void *args)
2025
{
2298
{
2026
  if (d == nildiag) {
2299
	if (d == nildiag) {
2027
    (*mcode)(args);
2300
		(*mcode)(args);
2028
    return;
2301
		return;
2029
  }
2302
	}
2030
  switch (d->key) {
2303
	switch (d->key) {
-
 
2304
	case DGA_PARAMS: {
-
 
2305
		obj_list hold_pars;
-
 
2306
		hold_pars.obj = d->data.i_param.args;
-
 
2307
		hold_pars.islist = 1;
-
 
2308
		hold_pars.next = (obj_list *)0;
-
 
2309
		local_objects = &hold_pars;
-
 
2310
		set_locdata(hold_pars);
-
 
2311
		if (proc_dg_info) {
-
 
2312
			proc_dg_info->data.i_prc.p = d;
-
 
2313
		}
-
 
2314
		d->data.i_param.b_start = set_dw_text_label();
-
 
2315
		dw2_code_info(d->more, mcode, args);
-
 
2316
		close_locdata(hold_pars);
-
 
2317
		local_objects = (obj_list *)0;
-
 
2318
		break;
-
 
2319
	}
-
 
2320
 
-
 
2321
	case DGA_COMP:
-
 
2322
		dw2_code_info(d->more, mcode, args);
-
 
2323
		break;
-
 
2324
 
-
 
2325
	case DGA_SRC:
-
 
2326
		if (d->data.i_src.startpos.file) {
-
 
2327
			dw2_source_mark(d->data.i_src.startpos,
-
 
2328
					d->data.i_src.is_stmt);
-
 
2329
		}
-
 
2330
		dw2_code_info(d->more, mcode, args);
-
 
2331
		if (d->data.i_src.endpos.file) {
-
 
2332
			dw2_source_mark(d->data.i_src.endpos, 0);
-
 
2333
		}
-
 
2334
		break;
-
 
2335
 
-
 
2336
	case DGA_SCOPE:
-
 
2337
	case DGA_EXTRA:
-
 
2338
		d->data.i_scope.start = set_dw_text_label();
-
 
2339
		dw2_code_info(d->more, mcode, args);
-
 
2340
		d->data.i_scope.end = set_dw_text_label();
-
 
2341
		break;
-
 
2342
 
-
 
2343
	case DGA_LAB:
-
 
2344
		d->data.i_scope.start = set_dw_text_label();
-
 
2345
		dw2_code_info(d->more, mcode, args);
-
 
2346
		break;
-
 
2347
 
-
 
2348
	case DGA_NAME: {
-
 
2349
		obj_list hold_obj;
-
 
2350
		hold_obj.obj = d->data.i_nam.dnam;
-
 
2351
		hold_obj.islist = 0;
-
 
2352
		hold_obj.next = local_objects;
-
 
2353
		local_objects = &hold_obj;
-
 
2354
		set_locdata(hold_obj);
-
 
2355
		d->data.i_nam.scope_start = set_dw_text_label();
-
 
2356
		dw2_code_info(d->more, mcode, args);
-
 
2357
		close_locdata(hold_obj);
-
 
2358
		local_objects = hold_obj.next;
-
 
2359
		break;
-
 
2360
	}
-
 
2361
 
-
 
2362
	case DGA_WITH:
-
 
2363
		d->data.i_with.lo_pc = set_dw_text_label();
-
 
2364
		dw2_code_info(d->more, mcode, args);
-
 
2365
		d->data.i_with.hi_pc = set_dw_text_label();
-
 
2366
		break;
-
 
2367
 
-
 
2368
	case DGA_CALL: {
-
 
2369
		dg_info old = current_dg_info;
-
 
2370
		current_dg_info = d;
-
 
2371
		dw2_code_info(d->more, mcode, args);
-
 
2372
		current_dg_info = old;
-
 
2373
		break;
-
 
2374
	}
-
 
2375
 
-
 
2376
	case DGA_INL_CALL: {
-
 
2377
		obj_list hold_pars;
-
 
2378
		hold_pars.obj = d->data.i_inl.args;
-
 
2379
		hold_pars.islist = 1;
-
 
2380
		hold_pars.next = local_objects;
-
 
2381
		local_objects = &hold_pars;
-
 
2382
		set_locdata(hold_pars);
-
 
2383
		d->data.i_inl.lo_pc = set_dw_text_label();
-
 
2384
		dw2_code_info(d->more, mcode, args);
-
 
2385
		d->data.i_inl.hi_pc = set_dw_text_label();
-
 
2386
		close_locdata(hold_pars);
-
 
2387
		local_objects = hold_pars.next;
-
 
2388
		break;
-
 
2389
	}
-
 
2390
 
-
 
2391
	case DGA_INL_RES:
-
 
2392
		dw2_code_info(d->more, mcode, args);
-
 
2393
		d->data.i_res.brk = set_dw_text_label();
-
 
2394
		d->data.i_res.res = find_diag_res(args);
-
 
2395
		{
-
 
2396
			dg_tag cr = d->data.i_res.call;
-
 
2397
			dg_info *dl;
-
 
2398
			if (cr->key != DGK_INFO ||
-
 
2399
			    cr->p.info->key != DGA_INL_CALL) {
-
 
2400
				failer("inline result ref?");
-
 
2401
			}
-
 
2402
			dl = &(cr->p.info->data.i_inl.resref);
-
 
2403
			while (*dl) {
-
 
2404
				if ((*dl) ==d) {
-
 
2405
					failer("impossible cycle");
-
 
2406
					return;
-
 
2407
				}
-
 
2408
				dl = &((*dl)->data.i_res.next);
-
 
2409
			}
-
 
2410
			*dl = d;
-
 
2411
		}
-
 
2412
		break;
-
 
2413
 
-
 
2414
	case DGA_X_TRY:
-
 
2415
		d->data.i_try.lo_pc = set_dw_text_label();
-
 
2416
		dw2_code_info(d->more, mcode, args);
-
 
2417
		d->data.i_try.hi_pc = set_dw_text_label();
-
 
2418
		break;
-
 
2419
 
-
 
2420
	case DGA_X_CATCH: {
-
 
2421
		obj_list hold_obj;
-
 
2422
		hold_obj.obj = d->data.i_catch.ex;
-
 
2423
		hold_obj.islist = 0;
-
 
2424
		hold_obj.next = local_objects;
-
 
2425
		local_objects = &hold_obj;
-
 
2426
		set_locdata(hold_obj);
-
 
2427
		d->data.i_catch.lo_pc = set_dw_text_label();
-
 
2428
		dw2_code_info(d->more, mcode, args);
-
 
2429
		d->data.i_catch.hi_pc = set_dw_text_label();
-
 
2430
		close_locdata(hold_obj);
-
 
2431
		local_objects = hold_obj.next;
-
 
2432
		break;
-
 
2433
	}
-
 
2434
 
-
 
2435
	case DGA_X_RAISE:
-
 
2436
		dw2_code_info(d->more, mcode, args);
-
 
2437
		break;
-
 
2438
 
-
 
2439
	case DGA_BRANCH: {
-
 
2440
		int old_db = dw_doing_branch_tests;
-
 
2441
		dw_doing_branch_tests = 1;
-
 
2442
		d->data.i_brn.brk = set_dw_text_label();
-
 
2443
		dw2_code_info(d->more, mcode, args);
-
 
2444
		d->data.i_brn.cont = set_dw_text_label();
-
 
2445
		dw_doing_branch_tests = old_db;
-
 
2446
		break;
-
 
2447
	}
-
 
2448
 
-
 
2449
	case DGA_TEST:
-
 
2450
	case DGA_JUMP:
-
 
2451
	case DGA_LJ: {
-
 
2452
		dg_info old = current_dg_info;
-
 
2453
		current_dg_info = d;
-
 
2454
		dw2_code_info(d->more, mcode, args);
-
 
2455
		current_dg_info = old;
-
 
2456
		break;
-
 
2457
	}
-
 
2458
 
-
 
2459
	case DGA_BEG: {
-
 
2460
		dg_tag tg = d->data.i_tg;
-
 
2461
		if (tg->key != DGK_INFO || tg->p.info->key != DGA_SCOPE)
-
 
2462
			failer("statement_part_dg?");
-
 
2463
		tg->p.info->data.i_scope.begin_st = set_dw_text_label();
-
 
2464
		dw2_code_info(d->more, mcode, args);
-
 
2465
		break;
-
 
2466
	}
-
 
2467
 
-
 
2468
	case DGA_DEST:
-
 
2469
		d->data.i_dest.brk = set_dw_text_label();
-
 
2470
		dw2_code_info(d->more, mcode, args);
-
 
2471
		break;
-
 
2472
 
-
 
2473
	case DGA_RVS: {
-
 
2474
		obj_list hold_pars;
-
 
2475
		hold_pars.next = local_objects;
-
 
2476
		if (d->data.i_rvs.rvs_key == DGR_ACC && d->data.i_rvs.n_code) {
-
 
2477
			hold_pars.obj = d->data.i_rvs.u2.p;
-
 
2478
			hold_pars.islist = 1;
-
 
2479
			local_objects = &hold_pars;
-
 
2480
			set_locdata(hold_pars);
-
 
2481
		}
-
 
2482
		if (d->data.i_rvs.n_code) {
-
 
2483
			d->data.i_rvs.lo_pc = set_dw_text_label();
-
 
2484
		}
-
 
2485
		if (d->data.i_rvs.u.tg) {
-
 
2486
			dg_info h;
-
 
2487
			if (d->data.i_rvs.u.tg->key != DGK_INFO ||
-
 
2488
			    (h = d->data.i_rvs.u.tg->p.info,
-
 
2489
			     h->key != DGA_RVS)) {
-
 
2490
				failer("incompatible rendezvous sequence");
-
 
2491
			}
-
 
2492
			d->data.i_rvs.u.iv = h->data.i_rvs.u.iv;
-
 
2493
			h->data.i_rvs.u.iv = d;
-
 
2494
			h->data.i_rvs.holder = 1;
-
 
2495
			d->data.i_rvs.info_e = current_dg_exp;
-
 
2496
			d->data.i_rvs.has_iv = 1;
-
 
2497
		}
-
 
2498
		dw2_code_info(d->more, mcode, args);
-
 
2499
		if ((unsigned int)d->data.i_rvs.n_code >= 2) {
-
 
2500
			d->data.i_rvs.hi_pc = set_dw_text_label();
-
 
2501
		}
-
 
2502
		if (d->data.i_rvs.rvs_key == DGR_ACC && d->data.i_rvs.n_code) {
-
 
2503
			close_locdata(hold_pars);
-
 
2504
		}
-
 
2505
		local_objects = hold_pars.next;
-
 
2506
		break;
-
 
2507
	}
-
 
2508
 
-
 
2509
	case DGA_BAR:
-
 
2510
		d->data.i_bar.lo_pc = set_dw_text_label();
-
 
2511
		if (proc_dg_info) {
-
 
2512
			proc_dg_info->data.i_prc.barrier = d;
-
 
2513
		}
-
 
2514
		dw2_code_info(d->more, mcode, args);
-
 
2515
		d->data.i_bar.hi_pc = set_dw_text_label();
-
 
2516
		break;
2031
 
2517
 
2032
    case DGA_PARAMS: {
2518
	case DGA_DETCH:
2033
      obj_list hold_pars;
2519
		if (d->data.i_detch.posn < 0) {
2034
      hold_pars.obj = d->data.i_param.args;
2520
			prepare_detch(d->data.i_detch.dl);
2035
      hold_pars.islist = 1;
-
 
2036
      hold_pars.next = (obj_list *)0;
-
 
2037
      local_objects = &hold_pars;
-
 
2038
      set_locdata (hold_pars);
2521
			dw2_code_info(d->more, mcode, args);
2039
      if (proc_dg_info)
2522
		} else {
2040
	proc_dg_info->data.i_prc.p = d;
-
 
2041
      d->data.i_param.b_start = set_dw_text_label ();
-
 
2042
      dw2_code_info (d->more, mcode, args);
2523
			dw2_code_info(d->more, mcode, args);
2043
      close_locdata (hold_pars);
2524
			prepare_detch(d->data.i_detch.dl);
2044
      local_objects = (obj_list *)0;
-
 
-
 
2525
		}
2045
      break;
2526
		break;
2046
    }
-
 
2047
 
2527
 
2048
    case DGA_COMP: {
2528
	case DGA_MOVD:
-
 
2529
	case DGA_HOIST:
-
 
2530
		d->data.i_movd.lo_pc = set_dw_text_label();
2049
      dw2_code_info (d->more, mcode, args);
2531
		dw2_code_info(d->more, mcode, args);
-
 
2532
		d->data.i_movd.hi_pc = set_dw_text_label();
2050
      break;
2533
		break;
2051
    }
-
 
2052
 
2534
 
2053
    case DGA_SRC: {
2535
	case DGA_OPTIM:
2054
      if (d->data.i_src.startpos.file)
2536
		d->data.i_optim.lo_pc = set_dw_text_label();
2055
	dw2_source_mark (d->data.i_src.startpos, d->data.i_src.is_stmt);
2537
		set_optim_objects(d, 1);
2056
      dw2_code_info (d->more, mcode, args);
2538
		dw2_code_info(d->more, mcode, args);
2057
      if (d->data.i_src.endpos.file)
2539
		d->data.i_optim.hi_pc = set_dw_text_label();
2058
	dw2_source_mark (d->data.i_src.endpos, 0);
2540
		set_optim_objects(d, 0);
2059
      break;
2541
		break;
2060
    }
-
 
2061
 
2542
 
2062
    case DGA_SCOPE:
-
 
2063
    case DGA_EXTRA: {
-
 
2064
      d->data.i_scope.start = set_dw_text_label ();
-
 
2065
      dw2_code_info (d->more, mcode, args);
-
 
2066
      d->data.i_scope.end = set_dw_text_label ();
-
 
2067
      break;
2543
	default:
2068
    }
-
 
2069
 
-
 
2070
    case DGA_LAB: {
-
 
2071
      d->data.i_scope.start = set_dw_text_label ();
-
 
2072
      dw2_code_info (d->more, mcode, args);
-
 
2073
      break;
-
 
2074
    }
-
 
2075
 
-
 
2076
    case DGA_NAME: {
-
 
2077
      obj_list hold_obj;
-
 
2078
      hold_obj.obj = d->data.i_nam.dnam;
-
 
2079
      hold_obj.islist = 0;
-
 
2080
      hold_obj.next = local_objects;
-
 
2081
      local_objects = &hold_obj;
-
 
2082
      set_locdata (hold_obj);
-
 
2083
      d->data.i_nam.scope_start = set_dw_text_label ();
-
 
2084
      dw2_code_info (d->more, mcode, args);
-
 
2085
      close_locdata (hold_obj);
-
 
2086
      local_objects = hold_obj.next;
-
 
2087
      break;
-
 
2088
    }
-
 
2089
 
-
 
2090
    case DGA_WITH: {
-
 
2091
      d->data.i_with.lo_pc = set_dw_text_label ();
-
 
2092
      dw2_code_info (d->more, mcode, args);
-
 
2093
      d->data.i_with.hi_pc = set_dw_text_label ();
-
 
2094
      break;
-
 
2095
    }
-
 
2096
 
-
 
2097
    case DGA_CALL: {
-
 
2098
      dg_info old = current_dg_info;
-
 
2099
      current_dg_info = d;
2544
		failer("unexpected dg_info");
2100
      dw2_code_info (d->more, mcode, args);
-
 
2101
      current_dg_info = old;
-
 
2102
      break;
-
 
2103
    }
-
 
2104
 
-
 
2105
    case DGA_INL_CALL: {
-
 
2106
      obj_list hold_pars;
-
 
2107
      hold_pars.obj = d->data.i_inl.args;
-
 
2108
      hold_pars.islist = 1;
-
 
2109
      hold_pars.next = local_objects;
-
 
2110
      local_objects = &hold_pars;
-
 
2111
      set_locdata (hold_pars);
-
 
2112
      d->data.i_inl.lo_pc = set_dw_text_label ();
-
 
2113
      dw2_code_info (d->more, mcode, args);
-
 
2114
      d->data.i_inl.hi_pc = set_dw_text_label ();
-
 
2115
      close_locdata (hold_pars);
-
 
2116
      local_objects = hold_pars.next;
-
 
2117
      break;
-
 
2118
    }
-
 
2119
 
2545
 
2120
    case DGA_INL_RES: {
-
 
2121
      dw2_code_info (d->more, mcode, args);
-
 
2122
      d->data.i_res.brk = set_dw_text_label ();
-
 
2123
      d->data.i_res.res = find_diag_res (args);
-
 
2124
      {
-
 
2125
	dg_tag cr = d->data.i_res.call;
-
 
2126
	dg_info * dl;
-
 
2127
	if (cr->key != DGK_INFO || cr->p.info->key != DGA_INL_CALL)
-
 
2128
	  failer ("inline result ref?");
-
 
2129
	dl = &(cr->p.info->data.i_inl.resref);
-
 
2130
	while (*dl) {
-
 
2131
	  if ((*dl)==d) {
-
 
2132
	    failer ("impossible cycle");
-
 
2133
	    return;
-
 
2134
	  }
-
 
2135
	  dl = &((*dl)->data.i_res.next);
-
 
2136
	}
2546
	}
2137
	*dl = d;
-
 
2138
      }
-
 
2139
      break;
-
 
2140
    }
-
 
2141
 
-
 
2142
    case DGA_X_TRY: {
-
 
2143
      d->data.i_try.lo_pc = set_dw_text_label ();
-
 
2144
      dw2_code_info (d->more, mcode, args);
-
 
2145
      d->data.i_try.hi_pc = set_dw_text_label ();
-
 
2146
      break;
-
 
2147
    }
-
 
2148
 
-
 
2149
    case DGA_X_CATCH: {
-
 
2150
      obj_list hold_obj;
-
 
2151
      hold_obj.obj = d->data.i_catch.ex;
-
 
2152
      hold_obj.islist = 0;
-
 
2153
      hold_obj.next = local_objects;
-
 
2154
      local_objects = &hold_obj;
-
 
2155
      set_locdata (hold_obj);
-
 
2156
      d->data.i_catch.lo_pc = set_dw_text_label ();
-
 
2157
      dw2_code_info (d->more, mcode, args);
-
 
2158
      d->data.i_catch.hi_pc = set_dw_text_label ();
-
 
2159
      close_locdata (hold_obj);
-
 
2160
      local_objects = hold_obj.next;
-
 
2161
      break;
-
 
2162
    }
-
 
2163
 
-
 
2164
    case DGA_X_RAISE: {
-
 
2165
      dw2_code_info (d->more, mcode, args);
-
 
2166
      break;
-
 
2167
    }
-
 
2168
 
-
 
2169
    case DGA_BRANCH: {
-
 
2170
      int old_db = dw_doing_branch_tests;
-
 
2171
      dw_doing_branch_tests = 1;
-
 
2172
      d->data.i_brn.brk = set_dw_text_label ();
-
 
2173
      dw2_code_info (d->more, mcode, args);
-
 
2174
      d->data.i_brn.cont = set_dw_text_label ();
-
 
2175
      dw_doing_branch_tests = old_db;
-
 
2176
      break;
-
 
2177
    }
-
 
2178
 
-
 
2179
    case DGA_TEST:
-
 
2180
    case DGA_JUMP:
-
 
2181
    case DGA_LJ: {
-
 
2182
      dg_info old = current_dg_info;
-
 
2183
      current_dg_info = d;
-
 
2184
      dw2_code_info (d->more, mcode, args);
-
 
2185
      current_dg_info = old;
-
 
2186
      break;
-
 
2187
    }
-
 
2188
 
-
 
2189
    case DGA_BEG: {
-
 
2190
      dg_tag tg = d->data.i_tg;
-
 
2191
      if (tg->key != DGK_INFO || tg->p.info->key != DGA_SCOPE)
-
 
2192
	failer ("statement_part_dg?");
-
 
2193
      tg->p.info->data.i_scope.begin_st = set_dw_text_label ();
-
 
2194
      dw2_code_info (d->more, mcode, args);
-
 
2195
      break;
-
 
2196
    }
-
 
2197
 
-
 
2198
    case DGA_DEST: {
-
 
2199
      d->data.i_dest.brk = set_dw_text_label ();
-
 
2200
      dw2_code_info (d->more, mcode, args);
-
 
2201
      break;
-
 
2202
    }
-
 
2203
 
-
 
2204
    case DGA_RVS: {
-
 
2205
      obj_list hold_pars;
-
 
2206
      hold_pars.next = local_objects;
-
 
2207
      if (d->data.i_rvs.rvs_key == DGR_ACC && d->data.i_rvs.n_code) {
-
 
2208
	hold_pars.obj = d->data.i_rvs.u2.p;
-
 
2209
	hold_pars.islist = 1;
-
 
2210
	local_objects = &hold_pars;
-
 
2211
	set_locdata (hold_pars);
-
 
2212
      }
-
 
2213
      if (d->data.i_rvs.n_code)
-
 
2214
	d->data.i_rvs.lo_pc = set_dw_text_label ();
-
 
2215
      if (d->data.i_rvs.u.tg) {
-
 
2216
	dg_info h;
-
 
2217
	if (d->data.i_rvs.u.tg->key != DGK_INFO || (
-
 
2218
		h = d->data.i_rvs.u.tg->p.info, h->key != DGA_RVS))
-
 
2219
	  failer ("incompatible rendezvous sequence");
-
 
2220
	d->data.i_rvs.u.iv = h->data.i_rvs.u.iv;
-
 
2221
	h->data.i_rvs.u.iv = d;
-
 
2222
	h->data.i_rvs.holder = 1;
-
 
2223
	d->data.i_rvs.info_e = current_dg_exp;
-
 
2224
	d->data.i_rvs.has_iv = 1;
-
 
2225
      }
-
 
2226
      dw2_code_info (d->more, mcode, args);
-
 
2227
      if ((unsigned int)d->data.i_rvs.n_code >= 2)
-
 
2228
	d->data.i_rvs.hi_pc = set_dw_text_label ();
-
 
2229
      if (d->data.i_rvs.rvs_key == DGR_ACC && d->data.i_rvs.n_code)
-
 
2230
	close_locdata (hold_pars);
-
 
2231
      local_objects = hold_pars.next;
-
 
2232
      break;
-
 
2233
    }
-
 
2234
 
-
 
2235
    case DGA_BAR: {
-
 
2236
      d->data.i_bar.lo_pc = set_dw_text_label ();
-
 
2237
      if (proc_dg_info) {
-
 
2238
	proc_dg_info->data.i_prc.barrier = d;
-
 
2239
      }
-
 
2240
      dw2_code_info (d->more, mcode, args);
-
 
2241
      d->data.i_bar.hi_pc = set_dw_text_label ();
-
 
2242
      break;
-
 
2243
    }
-
 
2244
 
-
 
2245
    case DGA_DETCH: {
-
 
2246
      if (d->data.i_detch.posn < 0) {
-
 
2247
	prepare_detch (d->data.i_detch.dl);
-
 
2248
	dw2_code_info (d->more, mcode, args);
-
 
2249
      }
-
 
2250
      else {
-
 
2251
	dw2_code_info (d->more, mcode, args);
-
 
2252
	prepare_detch (d->data.i_detch.dl);
-
 
2253
      }
-
 
2254
      break;
-
 
2255
    }
-
 
2256
 
-
 
2257
    case DGA_MOVD:
-
 
2258
    case DGA_HOIST: {
-
 
2259
      d->data.i_movd.lo_pc = set_dw_text_label ();
-
 
2260
      dw2_code_info (d->more, mcode, args);
-
 
2261
      d->data.i_movd.hi_pc = set_dw_text_label ();
-
 
2262
      break;
-
 
2263
    }
-
 
2264
 
-
 
2265
    case DGA_OPTIM: {
-
 
2266
      d->data.i_optim.lo_pc = set_dw_text_label ();
-
 
2267
      set_optim_objects (d, 1);
-
 
2268
      dw2_code_info (d->more, mcode, args);
-
 
2269
      d->data.i_optim.hi_pc = set_dw_text_label ();
-
 
2270
      set_optim_objects (d, 0);
-
 
2271
      break;
-
 
2272
    }
-
 
2273
 
-
 
2274
 
-
 
2275
    default:
-
 
2276
      failer ("unexpected dg_info");
-
 
2277
 
-
 
2278
  };
-
 
2279
  return;
2547
	return;
2280
}
2548
}