xref: /onnv-gate/usr/src/cmd/sgs/liblddbg/common/support.c (revision 1618:8c9a4f31d225)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*1618Srie  * Common Development and Distribution License (the "License").
6*1618Srie  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*1618Srie 
220Sstevel@tonic-gate /*
23*1618Srie  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*1618Srie  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #include	"msg.h"
290Sstevel@tonic-gate #include	"_debug.h"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate void
32*1618Srie Dbg_support_req(Lm_list *lml, const char *define, int flag)
330Sstevel@tonic-gate {
340Sstevel@tonic-gate 	const char	*str;
350Sstevel@tonic-gate 
36*1618Srie 	if (DBG_NOTCLASS(DBG_C_SUPPORT))
370Sstevel@tonic-gate 		return;
380Sstevel@tonic-gate 
390Sstevel@tonic-gate 	if (flag == DBG_SUP_ENVIRON)
400Sstevel@tonic-gate 		str = MSG_INTL(MSG_SUP_REQ_ENV);
410Sstevel@tonic-gate 	else if (flag == DBG_SUP_CMDLINE)
420Sstevel@tonic-gate 		str = MSG_INTL(MSG_SUP_REQ_CMD);
430Sstevel@tonic-gate 	else
440Sstevel@tonic-gate 		str = MSG_INTL(MSG_SUP_REQ_DEF);
450Sstevel@tonic-gate 
46*1618Srie 	dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
47*1618Srie 	dbg_print(lml, MSG_INTL(MSG_SUP_REQ), define, str);
480Sstevel@tonic-gate }
490Sstevel@tonic-gate 
500Sstevel@tonic-gate void
51*1618Srie Dbg_support_load(Lm_list *lml, const char *obj, const char *func)
520Sstevel@tonic-gate {
53*1618Srie 	if (DBG_NOTCLASS(DBG_C_SUPPORT))
540Sstevel@tonic-gate 		return;
550Sstevel@tonic-gate 
56*1618Srie 	dbg_print(lml, MSG_INTL(MSG_SUP_ROUTINE), obj, func);
570Sstevel@tonic-gate }
580Sstevel@tonic-gate 
590Sstevel@tonic-gate void
60*1618Srie Dbg_support_action(Lm_list *lml, const char *obj, const char *func,
61*1618Srie     Support_ndx ndx, const char *name)
620Sstevel@tonic-gate {
630Sstevel@tonic-gate 	const char	*str;
640Sstevel@tonic-gate 
65*1618Srie 	if (DBG_NOTCLASS(DBG_C_SUPPORT))
660Sstevel@tonic-gate 		return;
670Sstevel@tonic-gate 	if (DBG_NOTDETAIL())
680Sstevel@tonic-gate 		return;
690Sstevel@tonic-gate 
700Sstevel@tonic-gate 	if (ndx == LDS_START)
710Sstevel@tonic-gate 		str = MSG_INTL(MSG_SUP_OUTFILE);
720Sstevel@tonic-gate 	else if (ndx == LDS_FILE)
730Sstevel@tonic-gate 		str = MSG_INTL(MSG_SUP_INFILE);
740Sstevel@tonic-gate 	else if (ndx == LDS_INP_SECTION)
750Sstevel@tonic-gate 		str = MSG_INTL(MSG_SUP_INSEC);
760Sstevel@tonic-gate 	else if (ndx == LDS_SECTION)
770Sstevel@tonic-gate 		str = MSG_INTL(MSG_SUP_SEC);
780Sstevel@tonic-gate 
790Sstevel@tonic-gate 	if ((ndx == LDS_ATEXIT) || (ndx == LDS_VERSION) ||
800Sstevel@tonic-gate 	    (ndx == LDS_INPUT_DONE))
81*1618Srie 		dbg_print(lml, MSG_INTL(MSG_SUP_CALLING_1), func, obj);
820Sstevel@tonic-gate 	else
83*1618Srie 		dbg_print(lml, MSG_INTL(MSG_SUP_CALLING_2), func, obj,
84*1618Srie 		    str, name);
850Sstevel@tonic-gate }
86