Subversion Repositories tendra.SVN

Rev

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

Rev 5 Rev 6
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
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
Line 10... Line 40...
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
 
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
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
Line 36... Line 66...
36
 * Revision 1.2  1998/02/04  10:43:38  release
66
 * Revision 1.2  1998/02/04  10:43:38  release
37
 * Changes during testing.
67
 * Changes during testing.
38
 *
68
 *
39
 * Revision 1.1.1.1  1998/01/17  15:55:48  release
69
 * Revision 1.1.1.1  1998/01/17  15:55:48  release
40
 * First version to be checked into rolling release.
70
 * First version to be checked into rolling release.
41
 *
71
 *
42
 * Revision 1.3  1997/04/01  17:20:32  pwe
72
 * Revision 1.3  1997/04/01  17:20:32  pwe
43
 * diagnose pl_tests
73
 * diagnose pl_tests
44
 *
74
 *
45
 * Revision 1.2  1995/09/28  12:39:56  pwe
75
 * Revision 1.2  1995/09/28  12:39:56  pwe
46
 * dwarf.h via import, and type changes for tcc checks
76
 * dwarf.h via import, and type changes for tcc checks
Line 63... Line 93...
63
#include "codermacs.h"
93
#include "codermacs.h"
64
#include "tags.h"
94
#include "tags.h"
65
#include "out.h"
95
#include "out.h"
66
 
96
 
67
#include "shapemacs.h"
97
#include "shapemacs.h"
68
 
98
 
69
/* machine dependant */
99
/* machine dependant */
70
#include "expmacs.h"
100
#include "expmacs.h"
71
 
101
 
72
#include "basicread.h"
102
#include "basicread.h"
73
#include "diag_config.h"
103
#include "diag_config.h"
Line 83... Line 113...
83
#include CROSS_INCLUDE/dwarf.h>
113
#include CROSS_INCLUDE/dwarf.h>
84
#endif
114
#endif
85
 
115
 
86
extern int continue_decs;
116
extern int continue_decs;
87
 
117
 
88
void out_dwarf_proc_args
118
void
89
    PROTO_N ( (t) )
-
 
90
    PROTO_T ( diag_type t )
119
out_dwarf_proc_args(diag_type t)
91
{
120
{
92
  if (t->key != DIAG_TYPE_PROC)
121
	if (t->key != DIAG_TYPE_PROC) {
93
    failer("Can't output args of non proc type");
122
		failer("Can't output args of non proc type");
-
 
123
	}
94
 
124
 
95
  if (t->data.proc.opt_args)
125
	if (t->data.proc.opt_args) {
96
  {
-
 
97
    cont_sib_chain(TAG_unspecified_parameters);
126
		cont_sib_chain(TAG_unspecified_parameters);
98
    leave_dwarf_blk();
127
		leave_dwarf_blk();
99
  }
128
	}
100
}
129
}
-
 
130
 
101
 
131
 
102
void diag_proc_begin
132
void
103
    PROTO_N ( (d_props, global, cname, pname) )
-
 
104
    PROTO_T ( diag_global * d_props X int global X int cname X char *pname )
133
diag_proc_begin(diag_global *d_props, int global, int cname, char *pname)
105
{
134
{
106
  UNUSED(cname);
135
	UNUSED(cname);
107
  UNUSED(pname);
136
	UNUSED(pname);
108
 
137
 
109
  if (!d_props)
138
	if (!d_props) {
110
    return;
139
		return;
-
 
140
	}
111
 
141
 
112
  outs(COMMENT_2("\t","\tHere beginneth a proc"));
142
	outs(COMMENT_2("\t", "\tHere beginneth a proc"));
113
  outnl();
143
	outnl();
114
  if (d_props->desc->key != DIAG_ID_KEY)
144
	if (d_props->desc->key != DIAG_ID_KEY) {
115
    failer("proc beg without id");
145
		failer("proc beg without id");
-
 
146
	}
116
 
147
 
117
  next_dwarf_lab(&(d_props->lab));
148
	next_dwarf_lab(&(d_props->lab));
118
  OUT_DWARF_BEG(&(d_props->lab));
149
	OUT_DWARF_BEG(&(d_props->lab));
119
 
150
 
120
  if (global)
151
	if (global) {
121
    cont_sib_chain(TAG_global_subroutine);
152
		cont_sib_chain(TAG_global_subroutine);
122
  else
153
	} else {
123
    cont_sib_chain(TAG_subroutine);
154
		cont_sib_chain(TAG_subroutine);
-
 
155
	}
124
 
156
 
125
  out_dwarf_name_attr(TDFSTRING2CHAR(d_props->desc->data.id.nme));
157
	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);
158
	out_dwarf_type_attr(d_props->desc->data.id.new_type->data.proc.result_type);
127
  OUT_DWARF_ATTR(AT_low_pc);
159
	OUT_DWARF_ATTR(AT_low_pc);
128
  dwarf4(LAB2CHAR(d_props->lab.beg));
160
	dwarf4(LAB2CHAR(d_props->lab.beg));
129
  OUT_DWARF_ATTR(AT_high_pc);
161
	OUT_DWARF_ATTR(AT_high_pc);
130
  dwarf4(LAB2CHAR(d_props->lab.end));
162
	dwarf4(LAB2CHAR(d_props->lab.end));
131
  leave_dwarf_blk();
163
	leave_dwarf_blk();
132
  make_next_new_chain();
164
	make_next_new_chain();
133
 
165
 
-
 
166
	/* must be OUTSIDE blk */
134
  out_dwarf_sourcemark(&d_props->desc->data.id.whence); /* must be OUTSIDE blk */
167
	out_dwarf_sourcemark(&d_props->desc->data.id.whence);
-
 
168
 
135
  out_dwarf_proc_args(d_props->desc->data.id.new_type);
169
	out_dwarf_proc_args(d_props->desc->data.id.new_type);
136
  continue_decs = 1;
170
	continue_decs = 1;
137
}
171
}
-
 
172
 
138
 
173
 
139
void diag_proc_end
174
void
140
    PROTO_N ( (d_props) )
-
 
141
    PROTO_T ( diag_global * d_props )
175
diag_proc_end(diag_global *d_props)
142
{
176
{
143
  if (!d_props)
177
	if (!d_props) {
144
    return;
178
		return;
-
 
179
	}
145
 
180
 
146
  outs(COMMENT_2("\t","\tHere endeth a proc"));
181
	outs(COMMENT_2("\t", "\tHere endeth a proc"));
147
  outnl();
182
	outnl();
148
  OUT_DWARF_END(&(d_props->lab));
183
	OUT_DWARF_END(& (d_props->lab));
149
  end_sib_chain();
184
	end_sib_chain();
150
}
185
}
-
 
186
 
151
 
187
 
152
void diag_val_begin
188
void
153
    PROTO_N ( (d_props, global, cname, pname) )
-
 
154
    PROTO_T ( diag_global * d_props X int global X int cname X char *pname )
189
diag_val_begin(diag_global *d_props, int global, int cname, char *pname)
155
{
190
{
156
  UNUSED(d_props);
191
	UNUSED(d_props);
157
  UNUSED(global);
192
	UNUSED(global);
158
  UNUSED(cname);
193
	UNUSED(cname);
159
  UNUSED(pname);
194
	UNUSED(pname);
160
 
195
 
161
  outs(COMMENT_2("\t","\tHere beginneth a val"));
196
	outs(COMMENT_2("\t", "\tHere beginneth a val"));
162
  outnl();
197
	outnl();
163
}
198
}
164
 
199
 
-
 
200
 
165
void diag_val_end
201
void
166
    PROTO_N ( (d_props) )
-
 
167
    PROTO_T ( diag_global * d_props )
202
diag_val_end(diag_global *d_props)
168
{
203
{
169
  UNUSED(d_props);
204
	UNUSED(d_props);
170
 
205
 
171
  outs(COMMENT_2("\t","\tHere endeth a val"));
206
	outs(COMMENT_2("\t", "\tHere endeth a val"));
172
  outnl();
207
	outnl();
173
}
208
}