/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <inttypes.h>
#include <libintl.h>
#include "itmcomp.h"
#if defined(ENABLE_TRACE)
static char *itmc_obj_names[] = {
"ITMC_OBJ_NONE(0)",
"ITMC_OBJ_ITM(1)",
"ITMC_OBJ_STRING(2)",
"ITMC_OBJ_DIREC(3)",
"ITMC_OBJ_COND(4)",
"ITMC_OBJ_MAP(5)",
"ITMC_OBJ_OP(6)",
"ITMC_OBJ_EXPR(7)",
"ITMC_OBJ_DATA(8)",
"ITMC_OBJ_ACTION(9)",
"ITMC_OBJ_RANGE(10)",
"ITMC_OBJ_RAGISTER(11)",
"ITMC_OBJ_ESCAPESEQ(12)"
};
#endif
(not_refer)))
enum {
NOREFER = 0,
};
{ itmc_name_t *name;\
TRACE_MESSAGE('p', \
(TRACE_FMT(" "),\
}\
}
/* static int not_refer = (~0); */
static void analysis(itm_info_hdr_t *);
static void analysis2(void);
/*
* Assemble main function
*/
int
{
int i;
int j;
union {
long longval;
} mach_spec;
if (0 < error_deferred) {
}
itm_header->ident[0] = ITM_IDENT_0;
switch (sizeof (long)) {
case 4:
} else {
}
break;
case 8:
} else {
}
break;
}
TRACE_MESSAGE('r',
(" ref name referencee reloc(10)"
"size(10) referencer next\n"));
for (i = ITMC_OBJ_FIRST; i <= ITMC_OBJ_LAST; i++) {
TRACE_MESSAGE('r',
(" %2d:%08p:%08p:%08p:%8p:%8ld:%08p:%08p\n",
j, ref,
}
}
analysis2();
if (0 < error_deferred) {
}
return (0);
}
/*
* Fix reloc of itmc_ref_t, and fix reloc of itmc_name_t
*/
static void
{
/*
* determin section size
*/
/* string section */
/* direction */
/* condition */
/* map */
}
/* operation */
}
/* range section */
/* escapeseq section */
/* data section */
/* name section */
sec_num2 = 0;
sec_num2 += 1;
}
sec_num += 1;
}
}
sec_num2 += 1;
}
sec_num += 1;
}
}
/*
* adjust place
*/
0 +
(sizeof (itm_hdr_t));
/*
* adjust place: optional
*/
(sizeof (itm_info_hdr_t));
/* name SECTION */
}
/*
* size of ITM
*/
} else {
}
/*
* trace
*/
#if defined(ENABLE_TRACE)
#endif
}
/*
* Fix referencer of itmc_ref_t
*/
static void
{
/*
* reloc
*/
/* string section */
}
/* direction */
}
/* condition */
}
/* map */
}
/* operation */
}
/* range */
}
/* escape sequence */
}
/* data section */
}
}
/* name section */
continue;
}
}
}
}
continue;
}
#if !defined(_LP64)
#endif
}
place += (sizeof (itm_data_t));
}
continue;
}
"reference to %1$s \"%2$s\" is not resolved\n"),
error_deferred += 1;
continue;
} /* else */
}
"reference to %1$s \"%2$s\" is not resolved\n"),
error_deferred += 1;
}
"%1$s \"%2$s\" is defined, but not referred\n"),
error_deferred += 1;
}
}
/*
* initial direction table
*/
} else {
}
/*
* init operation and reset operation
*/
case ITM_TBL_OP_INIT:
break;
case ITM_TBL_OP_RESET:
break;
default:
break;
}
}
}
/*
* Fix reloc and referencer
*/
static void
{
#if !defined(_LP64)
#endif
}
TRACE_MESSAGE('f',
("fix_itmc_ref_reloc: "
"0x%08p 0x%08p\n",
TRACE_MESSAGE('F',
("fix_itmc_ref_reloc: \"%s\"\n",
NULL)));
}
}
}
}
/*
* Analysis
*/
static void
{
if (ITMC_OBJ_DIREC == obj_type) {
continue;
}
char *tbl_type;
continue;
} else if ((ITM_TBL_MAP ==
continue;
} else {
gettext("multiple unamed map's "
"defined\n"));
error_deferred += 1;
continue;
}
}
case ITM_TBL_ITM:
tbl_type =
break;
case ITM_TBL_DIREC:
tbl_type =
break;
case ITM_TBL_COND:
tbl_type =
break;
case ITM_TBL_OP:
tbl_type =
break;
case ITM_TBL_MAP:
tbl_type =
break;
case ITM_TBL_RANGE:
tbl_type =
break;
case ITM_TBL_ESCAPESEQ:
tbl_type =
break;
default:
tbl_type =
break;
}
gettext("unnamed %1$s-type object is "
"defined, but not referenced\n"),
tbl_type);
error_deferred += 1;
}
}
}
}
/*
* Analysis2 (check #nest of operation)
*/
static void
analysis2(void)
{
int i, j, k, n_op;
int indegree_zero;
struct op_nest_vertex {
struct op_nest_edge *e; /* link of edge list */
int n_nest;
};
struct op_nest_edge {
struct op_nest_edge *e; /* link of edge list */
};
#ifdef ENABLE_TRACE
}
#endif
i = 0;
} else {
}
o->ref->vertex_index = i;
i++;
break;
}
}
}
n_op = i;
if (n_op == 0)
return;
sizeof (struct op_nest_vertex) * n_op));
continue;
}
}
continue;
}
/* make edge */
i = o->ref->vertex_index;
e = malloc_vital(sizeof (struct op_nest_edge));
e->index = j;
e->e = vertexes[i].e;
vertexes[i].e = e;
TRACE_MESSAGE('l',
(" edge: vertexes[%d]:(%s) ->vertex[%d]:(%s)\n",
i,
j,
}
}
indegree_zero = NIL;
for (i = 0; i < n_op; i++) {
indegree_zero = i;
}
}
for (i = 0; i < n_op; i++) {
if (indegree_zero == NIL) {
gettext("operation loop detected\n"));
}
k = indegree_zero;
gettext("operation nested more than %d\n"),
}
TRACE_MESSAGE('l',
("take out first vertex: vertexes[%d] (i.e.%s) "
"#depth=%d\n", k, name_to_str(
j = e->index;
}
"(#indegree=%d,#depth = %d)\n",
indegree_zero = j;
}
}
}
}
/*
* Output ITM compiled data
*/
void
{
int fd;
return;
} else if (NULL == itm_output_file) {
fd = 1;
} else {
case 0:
if (0 == cmd_opt.force_overwrite) {
gettext("target file exists\n"));
}
break;
case -1:
}
break;
default:
break;
}
if (fd == -1) {
}
}
}
}
/* ITM header */
/* string section */
}
/* direction */
}
/* condition */
}
/* map */
}
/* operation */
}
/* range */
}
/* escape sequence */
SEEK_SET);
}
/* data section */
sec_size = 0;
}
}
}
} else {
/* ITM Info header */
SEEK_SET);
}
SEEK_SET);
}
SEEK_SET);
}
SEEK_SET);
}
SEEK_SET);
#if !defined(_LP64)
#endif
}
SEEK_SET);
}
SEEK_SET);
}
SEEK_SET);
}
}
SEEK_SET);
continue;
}
#if !defined(_LP64)
#endif
#if !defined(_LP64)
#endif
} else {
}
}
SEEK_SET);
for (name = name_first;
continue;
}
#if !defined(_LP64)
#endif
#if !defined(_LP64)
#endif
} else {
}
}
/* Name section */
continue;
}
}
continue;
}
}
}
}
}