5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #include "msg.h"
28 #include "_debug.h"
29 #include "libld.h"
30
31 /*
32 * If any run-time linker debugging is being carried out always indicate the
33 * fact and specify the point at which we transfer control to the main program.
34 */
35 void
36 Dbg_util_call_main(Rt_map *lmp)
37 {
38 Lm_list *lml = LIST(lmp);
39
40 Dbg_util_nl(lml, DBG_NL_FRC);
41 dbg_print(lml, MSG_INTL(MSG_UTL_TRANS), NAME(lmp));
42 Dbg_util_nl(lml, DBG_NL_FRC);
43 }
44
325 * using the DBG_NL_FRC flag.
326 */
327 void
328 Dbg_util_nl(Lm_list *lml, int flag)
329 {
330 if ((flag == DBG_NL_STD) && (dbg_desc->d_extra & DBG_E_STDNL))
331 return;
332
333 dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
334
335 if (flag == DBG_NL_STD)
336 dbg_desc->d_extra |= DBG_E_STDNL;
337 }
338
339 /*
340 * Define name demanglers.
341 */
342 const char *
343 Dbg_demangle_name(const char *name)
344 {
345 if (DBG_NOTCLASS(DBG_C_DEMANGLE))
346 return (name);
347
348 return (conv_demangle_name(name));
349 }
350
351 const char *
352 Elf_demangle_name(const char *name)
353 {
354 if (DBG_ISDEMANGLE())
355 return (conv_demangle_name(name));
356 return (name);
357 }
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 *
26 * Copyright 2018 Jason King
27 */
28
29 #include "msg.h"
30 #include "_debug.h"
31 #include "libld.h"
32
33 /*
34 * If any run-time linker debugging is being carried out always indicate the
35 * fact and specify the point at which we transfer control to the main program.
36 */
37 void
38 Dbg_util_call_main(Rt_map *lmp)
39 {
40 Lm_list *lml = LIST(lmp);
41
42 Dbg_util_nl(lml, DBG_NL_FRC);
43 dbg_print(lml, MSG_INTL(MSG_UTL_TRANS), NAME(lmp));
44 Dbg_util_nl(lml, DBG_NL_FRC);
45 }
46
327 * using the DBG_NL_FRC flag.
328 */
329 void
330 Dbg_util_nl(Lm_list *lml, int flag)
331 {
332 if ((flag == DBG_NL_STD) && (dbg_desc->d_extra & DBG_E_STDNL))
333 return;
334
335 dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
336
337 if (flag == DBG_NL_STD)
338 dbg_desc->d_extra |= DBG_E_STDNL;
339 }
340
341 /*
342 * Define name demanglers.
343 */
344 const char *
345 Dbg_demangle_name(const char *name)
346 {
347 static char *buf = NULL;
348
349 if (DBG_NOTCLASS(DBG_C_DEMANGLE))
350 return (name);
351
352 free(buf);
353 buf = (char *)conv_demangle_name(name);
354 if (buf == name) {
355 buf = NULL;
356 return (name);
357 }
358
359 return (buf);
360 }
361
362 const char *
363 Elf_demangle_name(const char *name)
364 {
365 static char *buf = NULL;
366
367 if (!DBG_ISDEMANGLE())
368 return (name);
369
370 free(buf);
371 buf = (char *)conv_demangle_name(name);
372 if (buf == name) {
373 buf = NULL;
374 return (name);
375 }
376
377 return (buf);
378 }
|