2 |
7u83 |
1 |
/*
|
6 |
7u83 |
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 |
*/
|
|
|
31 |
/*
|
2 |
7u83 |
32 |
Crown Copyright (c) 1997
|
|
|
33 |
|
|
|
34 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
35 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
36 |
acting through the Defence Evaluation and Research Agency
|
|
|
37 |
(DERA). It is made available to Recipients with a
|
|
|
38 |
royalty-free licence for its use, reproduction, transfer
|
|
|
39 |
to other parties and amendment for any purpose not excluding
|
|
|
40 |
product development provided that any such use et cetera
|
|
|
41 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
42 |
|
|
|
43 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
44 |
reproduced upon any copies or amended versions of it;
|
|
|
45 |
|
|
|
46 |
(2) Any amended version of it shall be clearly marked to
|
|
|
47 |
show both the nature of and the organisation responsible
|
|
|
48 |
for the relevant amendment or amendments;
|
|
|
49 |
|
|
|
50 |
(3) Its onward transfer from a recipient to another
|
|
|
51 |
party shall be deemed to be that party's acceptance of
|
|
|
52 |
these conditions;
|
|
|
53 |
|
|
|
54 |
(4) DERA gives no warranty or assurance as to its
|
|
|
55 |
quality or suitability for any purpose and DERA accepts
|
|
|
56 |
no liability whatsoever in relation to any use to which
|
|
|
57 |
it may be put.
|
|
|
58 |
*/
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
/**********************************************************************
|
|
|
62 |
$Author: release $
|
|
|
63 |
$Date: 1998/02/04 10:43:38 $
|
|
|
64 |
$Revision: 1.2 $
|
|
|
65 |
$Log: dwarf_proc.c,v $
|
|
|
66 |
* Revision 1.2 1998/02/04 10:43:38 release
|
|
|
67 |
* Changes during testing.
|
|
|
68 |
*
|
|
|
69 |
* Revision 1.1.1.1 1998/01/17 15:55:48 release
|
|
|
70 |
* First version to be checked into rolling release.
|
|
|
71 |
*
|
|
|
72 |
* Revision 1.3 1997/04/01 17:20:32 pwe
|
|
|
73 |
* diagnose pl_tests
|
|
|
74 |
*
|
|
|
75 |
* Revision 1.2 1995/09/28 12:39:56 pwe
|
|
|
76 |
* dwarf.h via import, and type changes for tcc checks
|
|
|
77 |
*
|
|
|
78 |
* Revision 1.1.1.1 1995/08/14 14:30:24 pwe
|
|
|
79 |
* transferred from DJCH
|
|
|
80 |
*
|
|
|
81 |
**********************************************************************/
|
|
|
82 |
|
|
|
83 |
/* LOG 7/9/93 changes for SPARC SVR4.2 djch
|
|
|
84 |
*/
|
|
|
85 |
/* LOG 25/11/93 removed redundant args with UNUSED djch */
|
|
|
86 |
|
|
|
87 |
#include "config.h"
|
|
|
88 |
#include "common_types.h"
|
|
|
89 |
#include "installtypes.h"
|
|
|
90 |
|
|
|
91 |
/* machine dependant */
|
|
|
92 |
#include "machine.h"
|
|
|
93 |
#include "codermacs.h"
|
|
|
94 |
#include "tags.h"
|
|
|
95 |
#include "out.h"
|
|
|
96 |
|
|
|
97 |
#include "shapemacs.h"
|
|
|
98 |
|
|
|
99 |
/* machine dependant */
|
|
|
100 |
#include "expmacs.h"
|
|
|
101 |
|
|
|
102 |
#include "basicread.h"
|
|
|
103 |
#include "diag_config.h"
|
|
|
104 |
#include "dwarf_types.h"
|
|
|
105 |
#include "dwarf_type.h"
|
|
|
106 |
#include "dwarf_out.h"
|
|
|
107 |
#include "dwarf_mc.h"
|
|
|
108 |
#include "cross_config.h"
|
|
|
109 |
|
|
|
110 |
#ifndef CROSS_INCLUDE
|
|
|
111 |
#include <dwarf.h>
|
|
|
112 |
#else
|
|
|
113 |
#include CROSS_INCLUDE/dwarf.h>
|
|
|
114 |
#endif
|
|
|
115 |
|
|
|
116 |
extern int continue_decs;
|
|
|
117 |
|
6 |
7u83 |
118 |
void
|
|
|
119 |
out_dwarf_proc_args(diag_type t)
|
2 |
7u83 |
120 |
{
|
6 |
7u83 |
121 |
if (t->key != DIAG_TYPE_PROC) {
|
|
|
122 |
failer("Can't output args of non proc type");
|
|
|
123 |
}
|
2 |
7u83 |
124 |
|
6 |
7u83 |
125 |
if (t->data.proc.opt_args) {
|
|
|
126 |
cont_sib_chain(TAG_unspecified_parameters);
|
|
|
127 |
leave_dwarf_blk();
|
|
|
128 |
}
|
2 |
7u83 |
129 |
}
|
|
|
130 |
|
6 |
7u83 |
131 |
|
|
|
132 |
void
|
|
|
133 |
diag_proc_begin(diag_global *d_props, int global, int cname, char *pname)
|
2 |
7u83 |
134 |
{
|
6 |
7u83 |
135 |
UNUSED(cname);
|
|
|
136 |
UNUSED(pname);
|
2 |
7u83 |
137 |
|
6 |
7u83 |
138 |
if (!d_props) {
|
|
|
139 |
return;
|
|
|
140 |
}
|
2 |
7u83 |
141 |
|
6 |
7u83 |
142 |
outs(COMMENT_2("\t", "\tHere beginneth a proc"));
|
|
|
143 |
outnl();
|
|
|
144 |
if (d_props->desc->key != DIAG_ID_KEY) {
|
|
|
145 |
failer("proc beg without id");
|
|
|
146 |
}
|
2 |
7u83 |
147 |
|
6 |
7u83 |
148 |
next_dwarf_lab(&(d_props->lab));
|
|
|
149 |
OUT_DWARF_BEG(&(d_props->lab));
|
2 |
7u83 |
150 |
|
6 |
7u83 |
151 |
if (global) {
|
|
|
152 |
cont_sib_chain(TAG_global_subroutine);
|
|
|
153 |
} else {
|
|
|
154 |
cont_sib_chain(TAG_subroutine);
|
|
|
155 |
}
|
2 |
7u83 |
156 |
|
6 |
7u83 |
157 |
out_dwarf_name_attr(TDFSTRING2CHAR(d_props->desc->data.id.nme));
|
|
|
158 |
out_dwarf_type_attr(d_props->desc->data.id.new_type->data.proc.result_type);
|
|
|
159 |
OUT_DWARF_ATTR(AT_low_pc);
|
|
|
160 |
dwarf4(LAB2CHAR(d_props->lab.beg));
|
|
|
161 |
OUT_DWARF_ATTR(AT_high_pc);
|
|
|
162 |
dwarf4(LAB2CHAR(d_props->lab.end));
|
|
|
163 |
leave_dwarf_blk();
|
|
|
164 |
make_next_new_chain();
|
2 |
7u83 |
165 |
|
6 |
7u83 |
166 |
/* must be OUTSIDE blk */
|
|
|
167 |
out_dwarf_sourcemark(&d_props->desc->data.id.whence);
|
|
|
168 |
|
|
|
169 |
out_dwarf_proc_args(d_props->desc->data.id.new_type);
|
|
|
170 |
continue_decs = 1;
|
2 |
7u83 |
171 |
}
|
|
|
172 |
|
6 |
7u83 |
173 |
|
|
|
174 |
void
|
|
|
175 |
diag_proc_end(diag_global *d_props)
|
2 |
7u83 |
176 |
{
|
6 |
7u83 |
177 |
if (!d_props) {
|
|
|
178 |
return;
|
|
|
179 |
}
|
2 |
7u83 |
180 |
|
6 |
7u83 |
181 |
outs(COMMENT_2("\t", "\tHere endeth a proc"));
|
|
|
182 |
outnl();
|
|
|
183 |
OUT_DWARF_END(& (d_props->lab));
|
|
|
184 |
end_sib_chain();
|
2 |
7u83 |
185 |
}
|
|
|
186 |
|
6 |
7u83 |
187 |
|
|
|
188 |
void
|
|
|
189 |
diag_val_begin(diag_global *d_props, int global, int cname, char *pname)
|
2 |
7u83 |
190 |
{
|
6 |
7u83 |
191 |
UNUSED(d_props);
|
|
|
192 |
UNUSED(global);
|
|
|
193 |
UNUSED(cname);
|
|
|
194 |
UNUSED(pname);
|
2 |
7u83 |
195 |
|
6 |
7u83 |
196 |
outs(COMMENT_2("\t", "\tHere beginneth a val"));
|
|
|
197 |
outnl();
|
2 |
7u83 |
198 |
}
|
|
|
199 |
|
6 |
7u83 |
200 |
|
|
|
201 |
void
|
|
|
202 |
diag_val_end(diag_global *d_props)
|
2 |
7u83 |
203 |
{
|
6 |
7u83 |
204 |
UNUSED(d_props);
|
2 |
7u83 |
205 |
|
6 |
7u83 |
206 |
outs(COMMENT_2("\t", "\tHere endeth a val"));
|
|
|
207 |
outnl();
|
2 |
7u83 |
208 |
}
|