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 |
/**********************************************************************
|
|
|
32 |
$Author: release $
|
|
|
33 |
$Date: 1998/02/04 10:43:38 $
|
|
|
34 |
$Revision: 1.2 $
|
|
|
35 |
$Log: dwarf_proc.c,v $
|
|
|
36 |
* Revision 1.2 1998/02/04 10:43:38 release
|
|
|
37 |
* Changes during testing.
|
|
|
38 |
*
|
|
|
39 |
* Revision 1.1.1.1 1998/01/17 15:55:48 release
|
|
|
40 |
* First version to be checked into rolling release.
|
|
|
41 |
*
|
|
|
42 |
* Revision 1.3 1997/04/01 17:20:32 pwe
|
|
|
43 |
* diagnose pl_tests
|
|
|
44 |
*
|
|
|
45 |
* Revision 1.2 1995/09/28 12:39:56 pwe
|
|
|
46 |
* dwarf.h via import, and type changes for tcc checks
|
|
|
47 |
*
|
|
|
48 |
* Revision 1.1.1.1 1995/08/14 14:30:24 pwe
|
|
|
49 |
* transferred from DJCH
|
|
|
50 |
*
|
|
|
51 |
**********************************************************************/
|
|
|
52 |
|
|
|
53 |
/* LOG 7/9/93 changes for SPARC SVR4.2 djch
|
|
|
54 |
*/
|
|
|
55 |
/* LOG 25/11/93 removed redundant args with UNUSED djch */
|
|
|
56 |
|
|
|
57 |
#include "config.h"
|
|
|
58 |
#include "common_types.h"
|
|
|
59 |
#include "installtypes.h"
|
|
|
60 |
|
|
|
61 |
/* machine dependant */
|
|
|
62 |
#include "machine.h"
|
|
|
63 |
#include "codermacs.h"
|
|
|
64 |
#include "tags.h"
|
|
|
65 |
#include "out.h"
|
|
|
66 |
|
|
|
67 |
#include "shapemacs.h"
|
|
|
68 |
|
|
|
69 |
/* machine dependant */
|
|
|
70 |
#include "expmacs.h"
|
|
|
71 |
|
|
|
72 |
#include "basicread.h"
|
|
|
73 |
#include "diag_config.h"
|
|
|
74 |
#include "dwarf_types.h"
|
|
|
75 |
#include "dwarf_type.h"
|
|
|
76 |
#include "dwarf_out.h"
|
|
|
77 |
#include "dwarf_mc.h"
|
|
|
78 |
#include "cross_config.h"
|
|
|
79 |
|
|
|
80 |
#ifndef CROSS_INCLUDE
|
|
|
81 |
#include <dwarf.h>
|
|
|
82 |
#else
|
|
|
83 |
#include CROSS_INCLUDE/dwarf.h>
|
|
|
84 |
#endif
|
|
|
85 |
|
|
|
86 |
extern int continue_decs;
|
|
|
87 |
|
|
|
88 |
void out_dwarf_proc_args
|
|
|
89 |
PROTO_N ( (t) )
|
|
|
90 |
PROTO_T ( diag_type t )
|
|
|
91 |
{
|
|
|
92 |
if (t->key != DIAG_TYPE_PROC)
|
|
|
93 |
failer("Can't output args of non proc type");
|
|
|
94 |
|
|
|
95 |
if (t->data.proc.opt_args)
|
|
|
96 |
{
|
|
|
97 |
cont_sib_chain(TAG_unspecified_parameters);
|
|
|
98 |
leave_dwarf_blk();
|
|
|
99 |
}
|
|
|
100 |
}
|
|
|
101 |
|
|
|
102 |
void diag_proc_begin
|
|
|
103 |
PROTO_N ( (d_props, global, cname, pname) )
|
|
|
104 |
PROTO_T ( diag_global * d_props X int global X int cname X char *pname )
|
|
|
105 |
{
|
|
|
106 |
UNUSED(cname);
|
|
|
107 |
UNUSED(pname);
|
|
|
108 |
|
|
|
109 |
if (!d_props)
|
|
|
110 |
return;
|
|
|
111 |
|
|
|
112 |
outs(COMMENT_2("\t","\tHere beginneth a proc"));
|
|
|
113 |
outnl();
|
|
|
114 |
if (d_props->desc->key != DIAG_ID_KEY)
|
|
|
115 |
failer("proc beg without id");
|
|
|
116 |
|
|
|
117 |
next_dwarf_lab(&(d_props->lab));
|
|
|
118 |
OUT_DWARF_BEG(&(d_props->lab));
|
|
|
119 |
|
|
|
120 |
if (global)
|
|
|
121 |
cont_sib_chain(TAG_global_subroutine);
|
|
|
122 |
else
|
|
|
123 |
cont_sib_chain(TAG_subroutine);
|
|
|
124 |
|
|
|
125 |
out_dwarf_name_attr(TDFSTRING2CHAR(d_props->desc->data.id.nme));
|
|
|
126 |
out_dwarf_type_attr(d_props->desc->data.id.new_type->data.proc.result_type);
|
|
|
127 |
OUT_DWARF_ATTR(AT_low_pc);
|
|
|
128 |
dwarf4(LAB2CHAR(d_props->lab.beg));
|
|
|
129 |
OUT_DWARF_ATTR(AT_high_pc);
|
|
|
130 |
dwarf4(LAB2CHAR(d_props->lab.end));
|
|
|
131 |
leave_dwarf_blk();
|
|
|
132 |
make_next_new_chain();
|
|
|
133 |
|
|
|
134 |
out_dwarf_sourcemark(&d_props->desc->data.id.whence); /* must be OUTSIDE blk */
|
|
|
135 |
out_dwarf_proc_args(d_props->desc->data.id.new_type);
|
|
|
136 |
continue_decs = 1;
|
|
|
137 |
}
|
|
|
138 |
|
|
|
139 |
void diag_proc_end
|
|
|
140 |
PROTO_N ( (d_props) )
|
|
|
141 |
PROTO_T ( diag_global * d_props )
|
|
|
142 |
{
|
|
|
143 |
if (!d_props)
|
|
|
144 |
return;
|
|
|
145 |
|
|
|
146 |
outs(COMMENT_2("\t","\tHere endeth a proc"));
|
|
|
147 |
outnl();
|
|
|
148 |
OUT_DWARF_END(&(d_props->lab));
|
|
|
149 |
end_sib_chain();
|
|
|
150 |
}
|
|
|
151 |
|
|
|
152 |
void diag_val_begin
|
|
|
153 |
PROTO_N ( (d_props, global, cname, pname) )
|
|
|
154 |
PROTO_T ( diag_global * d_props X int global X int cname X char *pname )
|
|
|
155 |
{
|
|
|
156 |
UNUSED(d_props);
|
|
|
157 |
UNUSED(global);
|
|
|
158 |
UNUSED(cname);
|
|
|
159 |
UNUSED(pname);
|
|
|
160 |
|
|
|
161 |
outs(COMMENT_2("\t","\tHere beginneth a val"));
|
|
|
162 |
outnl();
|
|
|
163 |
}
|
|
|
164 |
|
|
|
165 |
void diag_val_end
|
|
|
166 |
PROTO_N ( (d_props) )
|
|
|
167 |
PROTO_T ( diag_global * d_props )
|
|
|
168 |
{
|
|
|
169 |
UNUSED(d_props);
|
|
|
170 |
|
|
|
171 |
outs(COMMENT_2("\t","\tHere endeth a val"));
|
|
|
172 |
outnl();
|
|
|
173 |
}
|