4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * This is a test program designed to catch mismerges and mistranslations from
33 * Given a file with stabs data and a file with CTF data, determine whether
34 * or not all of the data structures and objects described by the stabs data
35 * are present in the CTF data.
45 int debug_level
= DEBUG_LEVEL
;
50 fprintf(stderr
, "Usage: %s ctf_file stab_file\n", progname
);
54 main(int argc
, char **argv
)
56 tdata_t
*ctftd
, *stabrtd
, *stabtd
, *difftd
;
57 char *ctfname
, *stabname
;
70 stabrtd
= tdata_new();
74 if (read_stabs(stabrtd
, stabname
, 0) != 0)
75 merge_into_master(stabrtd
, stabtd
, NULL
, 1);
76 else if (read_ctf(&stabname
, 1, NULL
, read_ctf_save_cb
, &stabtd
, 0)
78 terminate("%s doesn't have stabs or CTF\n", stabname
);
80 if (read_ctf(&ctfname
, 1, NULL
, read_ctf_save_cb
, &ctftd
, 0) == 0)
81 terminate("%s doesn't contain CTF data\n", ctfname
);
83 merge_into_master(stabtd
, ctftd
, difftd
, 0);
85 if ((new = hash_count(difftd
->td_iihash
)) != 0) {
86 (void) hash_iter(difftd
->td_iihash
, (int (*)())iidesc_dump
,
88 terminate("%s grew by %d\n", stabname
, new);