PERFORCE change 97229 for review
John Birrell
jb at FreeBSD.org
Tue May 16 02:57:23 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=97229
Change 97229 by jb at jb_freebsd2 on 2006/05/16 02:55:48
Merge from OpenSolaris ON (OS/Net) Consolidation - 20060508
Affected files ...
.. //depot/projects/dtrace/src/contrib/opensolaris/cmd/sgs/include/debug.h#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/cmd/sgs/libelf/common/output.c#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_dof.c#3 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_printf.c#4 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/lib/libproc/common/Psymtab.c#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/ctf.c#4 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/ctftools.h#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/dwarf.c#3 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/input.c#3 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/merge.c#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/output.c#3 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/st_parse.c#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/stabs.c#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/tdata.c#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/traverse.c#2 integrate
.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/util.c#3 integrate
Differences ...
==== //depot/projects/dtrace/src/contrib/opensolaris/cmd/sgs/include/debug.h#2 (text) ====
@@ -27,7 +27,7 @@
#ifndef _DEBUG_H
#define _DEBUG_H
-#pragma ident "@(#)debug.h 1.135 06/03/07 SMI"
+#pragma ident "@(#)debug.h 1.136 06/04/14 SMI"
/*
* Global include file for lddbg debugging.
@@ -353,6 +353,7 @@
#define Dbg_util_edge_in Dbg64_util_edge_in
#define Dbg_util_edge_out Dbg64_util_edge_out
#define Dbg_util_intoolate Dbg64_util_intoolate
+#define Dbg_util_lcinterface Dbg64_util_lcinterface
#define Dbg_util_nl Dbg64_util_nl
#define Dbg_util_no_init Dbg64_util_no_init
#define Dbg_util_scc_entry Dbg64_util_scc_entry
@@ -361,7 +362,7 @@
#define Dbg_util_wait Dbg64_util_wait
#define Dbg_unused_file Dbg64_unused_file
-#define Dbg_unused_rtldinfo Dbg64_unused_rtldinfo
+#define Dbg_unused_lcinterface Dbg64_unused_lcinterface
#define Dbg_unused_sec Dbg64_unused_sec
#define Dbg_unused_unref Dbg64_unused_unref
@@ -544,6 +545,7 @@
#define Dbg_util_edge_in Dbg32_util_edge_in
#define Dbg_util_edge_out Dbg32_util_edge_out
#define Dbg_util_intoolate Dbg32_util_intoolate
+#define Dbg_util_lcinterface Dbg32_util_lcinterface
#define Dbg_util_nl Dbg32_util_nl
#define Dbg_util_no_init Dbg32_util_no_init
#define Dbg_util_scc_entry Dbg32_util_scc_entry
@@ -552,7 +554,7 @@
#define Dbg_util_wait Dbg32_util_wait
#define Dbg_unused_file Dbg32_unused_file
-#define Dbg_unused_rtldinfo Dbg32_unused_rtldinfo
+#define Dbg_unused_lcinterface Dbg32_unused_lcinterface
#define Dbg_unused_sec Dbg32_unused_sec
#define Dbg_unused_unref Dbg32_unused_unref
@@ -777,6 +779,7 @@
int, int);
extern void Dbg_util_edge_out(Rt_map *, Rt_map *);
extern void Dbg_util_intoolate(Rt_map *);
+extern void Dbg_util_lcinterface(Rt_map *, int, char *);
extern void Dbg_util_nl(Lm_list *, int);
extern void Dbg_util_no_init(Rt_map *);
extern void Dbg_util_str(Lm_list *, const char *);
@@ -785,7 +788,7 @@
extern void Dbg_util_wait(Rt_map *, Rt_map *, int);
extern void Dbg_unused_file(Lm_list *, const char *, int, uint_t);
-extern void Dbg_unused_rtldinfo(Rt_map *);
+extern void Dbg_unused_lcinterface(Rt_map *, Rt_map *, int);
extern void Dbg_unused_sec(Lm_list *, Is_desc *);
extern void Dbg_unused_unref(Rt_map *, const char *);
==== //depot/projects/dtrace/src/contrib/opensolaris/cmd/sgs/libelf/common/output.c#2 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -19,17 +18,16 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 1988 AT&T
+ * All Rights Reserved
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "@(#)output.c 1.19 05/06/08 SMI" /* SVr4.0 1.3 */
+#pragma ident "@(#)output.c 1.20 06/04/19 SMI" /* SVr4.0 1.3 */
#include "syn.h"
#include <sys/mman.h>
@@ -98,11 +96,10 @@
_elf_seterr(EIO_SYNC, err);
return (0);
}
- if (lseek(fd, 0L, SEEK_SET) == 0) {
- if (write(fd, p, sz) == sz) {
- (void) free(p);
- return (sz);
- }
+ if ((lseek(fd, 0L, SEEK_SET) == 0) &&
+ (write(fd, p, sz) == sz) && (fsync(fd) == 0)) {
+ (void) free(p);
+ return (sz);
}
_elf_seterr(EIO_WRITE, errno);
return (0);
==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_dof.c#3 (text) ====
@@ -24,7 +24,7 @@
* Use is subject to license terms.
*/
-#pragma ident "@(#)dt_dof.c 1.11 06/03/30 SMI"
+#pragma ident "@(#)dt_dof.c 1.13 06/04/28 SMI"
#include <sys/types.h>
#if defined(sun)
@@ -444,7 +444,12 @@
dofpr.dofpr_func = dof_add_string(ddo, pip->pi_fname);
- assert(pip->pi_noffs > 0);
+ /*
+ * There should be one probe offset or is-enabled probe offset
+ * or else this probe instance won't have been created. The
+ * kernel will reject DOF which has a probe with no offsets.
+ */
+ assert(pip->pi_noffs + pip->pi_nenoffs > 0);
dofpr.dofpr_offidx =
dt_buf_len(&ddo->ddo_offs) / sizeof (uint32_t);
@@ -456,7 +461,7 @@
dt_buf_len(&ddo->ddo_enoffs) / sizeof (uint32_t);
dofpr.dofpr_nenoffs = pip->pi_nenoffs;
dt_buf_write(dtp, &ddo->ddo_enoffs, pip->pi_enoffs,
- pip->pi_noffs * sizeof (uint32_t), sizeof (uint32_t));
+ pip->pi_nenoffs * sizeof (uint32_t), sizeof (uint32_t));
/*
* If pi_rname isn't set, the relocation will be against the
@@ -491,6 +496,7 @@
dof_relohdr_t dofr;
dof_secidx_t *dofs;
ulong_t xr, nxr;
+ size_t sz;
id_t i;
if (pvp->pv_flags & DT_PROVIDER_IMPL)
@@ -533,15 +539,17 @@
dt_buf_concat(dtp, &ddo->ddo_ldata, &ddo->ddo_args, sizeof (uint8_t));
- assert(dt_buf_len(&ddo->ddo_offs) > 0);
-
dofpv.dofpv_proffs = dof_add_lsect(ddo, NULL, DOF_SECT_PROFFS,
sizeof (uint_t), 0, sizeof (uint_t), dt_buf_len(&ddo->ddo_offs));
dt_buf_concat(dtp, &ddo->ddo_ldata, &ddo->ddo_offs, sizeof (uint_t));
- dofpv.dofpv_prenoffs = dof_add_lsect(ddo, NULL, DOF_SECT_PRENOFFS,
- sizeof (uint_t), 0, sizeof (uint_t), dt_buf_len(&ddo->ddo_enoffs));
+ if ((sz = dt_buf_len(&ddo->ddo_enoffs)) != 0) {
+ dofpv.dofpv_prenoffs = dof_add_lsect(ddo, NULL,
+ DOF_SECT_PRENOFFS, sizeof (uint_t), 0, sizeof (uint_t), sz);
+ } else {
+ dofpv.dofpv_prenoffs = DOF_SECT_NONE;
+ }
dt_buf_concat(dtp, &ddo->ddo_ldata, &ddo->ddo_enoffs, sizeof (uint_t));
==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_printf.c#4 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -25,7 +24,7 @@
* Use is subject to license terms.
*/
-#pragma ident "@(#)dt_printf.c 1.19 06/01/07 SMI"
+#pragma ident "@(#)dt_printf.c 1.20 06/04/29 SMI"
#if defined(sun)
#include <sys/sysmacros.h>
@@ -1608,7 +1607,7 @@
* file descriptor for the fopen()'d file. This way, if the fopen()
* fails, we can fail the operation without destroying stdout.
*/
- if ((nfp = fopen(filename, "aw")) == NULL) {
+ if ((nfp = fopen(filename, "aF")) == NULL) {
char *msg = strerror(errno);
char *faultstr;
int len = 80;
@@ -1640,7 +1639,7 @@
}
}
- if (freopen(selfbuf, "aw", fp) == NULL) {
+ if (freopen(selfbuf, "aF", fp) == NULL) {
(void) fclose(nfp);
return (dt_set_errno(dtp, errno));
}
==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libproc/common/Psymtab.c#2 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -19,12 +18,13 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)Psymtab.c 1.38 05/12/16 SMI"
+#pragma ident "@(#)Psymtab.c 1.39 06/04/24 SMI"
#include <stdio.h>
#include <stdlib.h>
@@ -2003,6 +2003,15 @@
}
/*
+ * Prefer the symbol that doesn't begin with a '$' since compilers and
+ * other symbol generators often use it as a prefix.
+ */
+ if (*bname == '$')
+ return (-1);
+ if (*aname == '$')
+ return (1);
+
+ /*
* Prefer the name with fewer leading underscores in the name.
*/
while (*aname == '_' && *bname == '_') {
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/ctf.c#4 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)ctf.c 1.12 05/06/08 SMI"
+#pragma ident "@(#)ctf.c 1.13 06/04/20 SMI"
/*
* Create and parse buffers containing CTF data.
@@ -420,8 +419,7 @@
warning("Can't write unknown type %d\n", tp->t_type);
}
- debug(3, "Wrote type %d %s\n", tp->t_id,
- (tp->t_name ? tp->t_name : "(anon)"));
+ debug(3, "Wrote type %d %s\n", tp->t_id, tdesc_name(tp));
return (1);
}
@@ -459,8 +457,15 @@
}
static ssize_t
+>>>> ORIGINAL ctf.c#1
+compress_buffer(caddr_t buf, size_t n, resbuf_t *rb)
+==== THEIRS ctf.c#2
+compress_buffer(const void *buf, size_t n, void *data)
+==== YOURS ctf.c
compress_buffer(void *buf, size_t n, void *arg)
+<<<<
{
+ resbuf_t *rb = (resbuf_t *)data;
int rc;
resbuf_t *rb = (resbuf_t *) arg;
@@ -477,7 +482,13 @@
parseterminate("zlib deflate failed: %s", zError(rc));
}
rb->rb_ptr = (caddr_t)rb->rb_zstr.next_out;
+>>>> ORIGINAL ctf.c#1
+==== THEIRS ctf.c#2
+
+ return (n);
+==== YOURS ctf.c
return n;
+<<<<
}
static void
@@ -527,12 +538,28 @@
}
static ssize_t
+>>>> ORIGINAL ctf.c#1
+bcopy_data(void *buf, size_t n, caddr_t *posp)
+==== THEIRS ctf.c#2
+bcopy_data(const void *buf, size_t n, void *data)
+==== YOURS ctf.c
bcopy_data(void *buf, size_t n, void *arg)
+<<<<
{
+>>>> ORIGINAL ctf.c#1
+==== THEIRS ctf.c#2
+ caddr_t *posp = (caddr_t *)data;
+==== YOURS ctf.c
caddr_t *posp = (caddr_t *) arg;
+<<<<
bcopy(buf, *posp, n);
*posp += n;
+>>>> ORIGINAL ctf.c#1
+==== THEIRS ctf.c#2
+ return (n);
+==== YOURS ctf.c
return n;
+<<<<
}
static caddr_t
@@ -545,11 +572,18 @@
+ buf->ctb_strtab.str_size);
bufpos = outbuf;
- bcopy_data(h, sizeof (ctf_header_t), &bufpos);
- bcopy_data(buf->ctb_base, buf->ctb_ptr - buf->ctb_base,
+ (void) bcopy_data(h, sizeof (ctf_header_t), &bufpos);
+ (void) bcopy_data(buf->ctb_base, buf->ctb_ptr - buf->ctb_base,
&bufpos);
+>>>> ORIGINAL ctf.c#1
+ if (strtab_write(&buf->ctb_strtab, (ssize_t (*)())bcopy_data,
+ &bufpos) < 0)
+==== THEIRS ctf.c#2
+ if (strtab_write(&buf->ctb_strtab, bcopy_data, &bufpos) < 0)
+==== YOURS ctf.c
if (strtab_write(&buf->ctb_strtab, bcopy_data,
(void *) &bufpos) < 0)
+<<<<
terminate("strtab_write failed\n");
*resszp = bufpos - outbuf;
return (outbuf);
@@ -571,10 +605,18 @@
resbuf.rb_ptr = resbuf.rb_base + sizeof (ctf_header_t);
compress_start(&resbuf);
- compress_buffer(buf->ctb_base, buf->ctb_ptr - buf->ctb_base, &resbuf);
+ (void) compress_buffer(buf->ctb_base, buf->ctb_ptr - buf->ctb_base,
+ &resbuf);
compress_flush(&resbuf, Z_FULL_FLUSH);
+>>>> ORIGINAL ctf.c#1
+ if (strtab_write(&buf->ctb_strtab, (ssize_t (*)())compress_buffer,
+ &resbuf) < 0)
+==== THEIRS ctf.c#2
+ if (strtab_write(&buf->ctb_strtab, compress_buffer, &resbuf) < 0)
+==== YOURS ctf.c
if (strtab_write(&buf->ctb_strtab, compress_buffer,
(void *) &resbuf) < 0)
+<<<<
terminate("strtab_write failed\n");
compress_end(&resbuf);
@@ -1137,7 +1179,7 @@
debug(3, "Resurrected %d %stype %s (%d)\n", tdp->t_type,
(CTF_INFO_ISROOT(ctt->ctt_info) ? "root " : ""),
- (tdp->t_name ? tdp->t_name : "(anon)"), tdp->t_id);
+ tdesc_name(tdp), tdp->t_id);
}
debug(3, "Resurrected %d types (%d were roots)\n", tcnt, iicnt);
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/ctftools.h#2 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,14 +19,14 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _CTFTOOLS_H
#define _CTFTOOLS_H
-#pragma ident "@(#)ctftools.h 1.13 05/06/08 SMI"
+#pragma ident "@(#)ctftools.h 1.14 06/04/20 SMI"
/*
* Functions and data structures used in the manipulation of stabs and CTF data
@@ -412,6 +411,7 @@
tdata_t *tdata_new(void);
void tdata_free(tdata_t *);
void tdata_build_hashes(tdata_t *td);
+const char *tdesc_name(tdesc_t *);
int tdesc_idhash(int, void *);
int tdesc_idcmp(void *, void *);
int tdesc_namehash(int, void *);
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/dwarf.c#3 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)dwarf.c 1.4 05/08/26 SMI"
+#pragma ident "@(#)dwarf.c 1.5 06/04/20 SMI"
/*
* DWARF to tdata conversion
@@ -755,7 +754,7 @@
if ((sz = tdesc_size(tdp->t_ardef->ad_contents)) == 0) {
debug(3, "unable to resolve array %s (%d) contents %d\n",
- (tdp->t_name == NULL ? "(anon)" : tdp->t_name), tdp->t_id,
+ tdesc_name(tdp), tdp->t_id,
tdp->t_ardef->ad_contents->t_id);
dw->dw_nunres++;
@@ -780,8 +779,7 @@
return (1);
fprintf(stderr, "Array %d: failed to size contents type %s (%d)\n",
- tdp->t_id, (cont->t_name == NULL ? "(anon)" : cont->t_name),
- cont->t_id);
+ tdp->t_id, tdesc_name(cont), cont->t_id);
return (1);
}
@@ -884,12 +882,12 @@
* so don't even try.
*/
if (full == NULL) {
- terminate("tdp %u: enum %s has no members\n",
- tdp->t_id, (tdp->t_name == NULL ? "(anon)" : tdp->t_name));
+ terminate("tdp %u: enum %s has no members\n", tdp->t_id,
+ tdesc_name(tdp));
}
debug(3, "tdp %u: enum %s redirected to %u\n", tdp->t_id,
- (tdp->t_name == NULL ? "(anon)" : tdp->t_name), full->t_id);
+ tdesc_name(tdp), full->t_id);
tdp->t_flags |= TDESC_F_RESOLVED;
@@ -902,7 +900,7 @@
tdesc_t *fwd = arg1, *sou = arg2;
debug(3, "tdp %u: mapped forward %s to sou %u\n", fwd->t_id,
- fwd->t_name, sou->t_id);
+ tdesc_name(fwd), sou->t_id);
fwd->t_tdesc = sou;
return (0);
@@ -926,7 +924,7 @@
debug(3, "die %llu: creating %s %s\n", off,
(tdp->t_type == FORWARD ? "forward decl" : typename),
- (tdp->t_name == NULL ? "(anon)" : tdp->t_name));
+ tdesc_name(tdp));
if (tdp->t_type == FORWARD) {
hash_add(dw->dw_fwdhash, tdp);
@@ -1014,13 +1012,12 @@
* change the name.
*/
if (tdp->t_members == NULL) {
- char *old = (tdp->t_name == NULL ? "" : tdp->t_name);
+ const char *old = tdesc_name(tdp);
size_t newsz = 7 + strlen(old) + 1;
char *new = xmalloc(newsz);
(void) snprintf(new, newsz, "orphan %s", old);
- debug(3, "die %llu: worked around %s %s\n", off, typename,
- (tdp->t_name == NULL ? "<anon>" : tdp->t_name));
+ debug(3, "die %llu: worked around %s %s\n", off, typename, old);
if (tdp->t_name != NULL)
free(tdp->t_name);
@@ -1061,7 +1058,7 @@
if (tdp->t_flags & TDESC_F_RESOLVED)
return (1);
- debug(3, "resolving sou %s\n", tdp->t_name);
+ debug(3, "resolving sou %s\n", tdesc_name(tdp));
for (ml = tdp->t_members; ml != NULL; ml = ml->ml_next) {
if (ml->ml_size == 0) {
@@ -1111,8 +1108,7 @@
if (ml->ml_size == 0) {
fprintf(stderr, "%s %d: failed to size member %s of "
"type %s (%d)\n", typename, tdp->t_id, ml->ml_name,
- (ml->ml_type->t_name == NULL ? "(anon)" :
- ml->ml_type->t_name), ml->ml_type->t_id);
+ tdesc_name(ml->ml_type), ml->ml_type->t_id);
}
}
@@ -1399,7 +1395,7 @@
if ((intr = die_base_name_parse(tdp->t_name, &new)) != NULL) {
/* Found it. We'll use the parsed version */
debug(3, "die %llu: name \"%s\" remapped to \"%s\"\n", off,
- tdp->t_name, new);
+ tdesc_name(tdp), new);
free(tdp->t_name);
tdp->t_name = new;
@@ -1409,7 +1405,7 @@
* based on the DWARF data.
*/
debug(3, "die %llu: using dwarf data for base \"%s\"\n", off,
- tdp->t_name);
+ tdesc_name(tdp));
intr = die_base_from_dwarf(dw, base, off, sz);
}
@@ -1607,7 +1603,8 @@
return (1);
if (fwd->t_tdesc != NULL) {
- debug(3, "tdp %u: unforwarded %s\n", fwd->t_id, fwd->t_name);
+ debug(3, "tdp %u: unforwarded %s\n", fwd->t_id,
+ tdesc_name(fwd));
*fwdp = fwd->t_tdesc;
}
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/input.c#3 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)input.c 1.7 05/06/08 SMI"
+#pragma ident "@(#)input.c 1.8 06/04/21 SMI"
/*
* Routines for retrieving CTF data from a .SUNW_ctf ELF section
@@ -40,6 +39,7 @@
#include "ctftools.h"
#include "memory.h"
+#include "symbol.h"
typedef int read_cb_f(tdata_t *, char *, void *);
@@ -387,6 +387,7 @@
symit_next(symit_data_t *si, int type)
{
GElf_Sym sym;
+ int check_sym = (type == STT_OBJECT || type == STT_FUNC);
for (; si->si_next < si->si_nument; si->si_next++) {
gelf_getsym(si->si_symd, si->si_next, &si->si_cursym);
@@ -400,6 +401,9 @@
sym.st_shndx == SHN_UNDEF)
continue;
+ if (check_sym && ignore_symbol(&sym, si->si_curname))
+ continue;
+
si->si_next++;
return (&si->si_cursym);
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/merge.c#2 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)merge.c 1.11 05/06/08 SMI"
+#pragma ident "@(#)merge.c 1.12 06/04/20 SMI"
/*
* This file contains routines that merge one tdata_t tree, called the child,
@@ -453,8 +452,7 @@
ed.ed_node = ctdp;
ed.ed_selfuniquify = 0;
- debug(3, "map_td_tree_post on %d %s\n", ctdp->t_id,
- ctdp->t_name == NULL ? "(anon)" : ctdp->t_name);
+ debug(3, "map_td_tree_post on %d %s\n", ctdp->t_id, tdesc_name(ctdp));
if (hash_find_iter(mcd->md_parent->td_layouthash, ctdp,
equiv_cb, &ed) < 0) {
@@ -479,7 +477,7 @@
* means that the "name" hash function is broken.
*/
terminate("Second pass for %d (%s) == %d\n", ctdp->t_id,
- (ctdp->t_name ? ctdp->t_name : "(anon)"), ed.ed_tgt->t_id);
+ tdesc_name(ctdp), ed.ed_tgt->t_id);
} else {
int id = mcd->md_tgt->td_nextid++;
@@ -521,8 +519,7 @@
* function is broken.
*/
terminate("Self-unique second pass for %d (%s) == %d\n",
- ctdp->t_id, (ctdp->t_name ? ctdp->t_name : "(anon)"),
- ed.ed_tgt->t_id);
+ ctdp->t_id, tdesc_name(ctdp), ed.ed_tgt->t_id);
} else {
int id = mcd->md_tgt->td_nextid++;
@@ -878,8 +875,7 @@
if (!alist_find(map, (void *)fwd, (void **)&defn))
return (0);
- debug(3, "Redirecting an edge to %s\n",
- (defn->t_name ? defn->t_name : "(anon)"));
+ debug(3, "Redirecting an edge to %s\n", tdesc_name(defn));
*fwdp = defn;
@@ -922,11 +918,10 @@
if (!hash_find(rmd->rmd_tgt->td_idhash, (void *)&template,
(void *)&defn)) {
terminate("Couldn't unforward %d (%s)\n", defnid,
- (defn->t_name ? defn->t_name : "(anon)"));
+ tdesc_name(defn));
}
- debug(3, "Forward map: resolved %d to %s\n",
- defnid, (defn->t_name ? defn->t_name : "(anon)"));
+ debug(3, "Forward map: resolved %d to %s\n", defnid, tdesc_name(defn));
alist_add(rmd->rmd_map, (void *)fwd, (void *)defn);
@@ -993,8 +988,7 @@
(void *)&template, NULL) == 0);
debug(3, "trying to conjure %d %s (%d) as %d\n",
- oldtdp->t_type, (oldtdp->t_name ? oldtdp->t_name : "(anon)"),
- oldtdp->t_id, newid);
+ oldtdp->t_type, tdesc_name(oldtdp), oldtdp->t_id, newid);
if ((newtdp = tdesc_ops[oldtdp->t_type].conjure(oldtdp, newid,
mcd)) == NULL)
@@ -1032,8 +1026,7 @@
tdesc_t **tdpp = data;
merge_cb_data_t *mcd = arg;
- debug(3, "Remapping %s (%d)\n",
- ((*tdpp)->t_name ? (*tdpp)->t_name : "(anon)"), (*tdpp)->t_id);
+ debug(3, "Remapping %s (%d)\n", tdesc_name(*tdpp), (*tdpp)->t_id);
if (!remap_node(tdpp, *tdpp, -1, NULL, mcd))
return (0);
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/output.c#3 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)output.c 1.13 05/06/08 SMI"
+#pragma ident "@(#)output.c 1.14 06/04/20 SMI"
/*
* Routines for preparing tdata trees for conversion into CTF data, and
@@ -708,7 +707,7 @@
if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL)
elfterminate(curname, "Cannot re-read");
- if ((tfd = open(newname, O_WRONLY | O_CREAT | O_TRUNC, st.st_mode)) < 0)
+ if ((tfd = open(newname, O_RDWR | O_CREAT | O_TRUNC, st.st_mode)) < 0)
terminate("Cannot open temp file %s for writing", newname);
if ((telf = elf_begin(tfd, ELF_C_WRITE, NULL)) == NULL)
elfterminate(curname, "Cannot write");
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/st_parse.c#2 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)st_parse.c 1.12 05/06/08 SMI"
+#pragma ident "@(#)st_parse.c 1.13 06/04/20 SMI"
/*
* This file is a sewer.
@@ -372,8 +371,7 @@
tdp->t_tdesc = rtdp;
addhash(tdp, tid); /* for *(x,y) types */
parse_debug(3, NULL, " %s defined as %s(%d)",
- idp->ii_name, (rtdp->t_name != NULL) ?
- rtdp->t_name : "anon", tid);
+ idp->ii_name, tdesc_name(rtdp), tid);
} else if (rtdp->t_name == NULL) {
rtdp->t_name = xstrdup(idp->ii_name);
addhash(rtdp, tid);
@@ -561,11 +559,9 @@
addhash(tdp, h);
else if (otdp != tdp) {
warning("duplicate entry\n");
- warning(" old: %s %d (%d,%d)\n",
- otdp->t_name ? otdp->t_name : "(anon)",
+ warning(" old: %s %d (%d,%d)\n", tdesc_name(otdp),
otdp->t_type, TYPEFILE(otdp->t_id), TYPENUM(otdp->t_id));
- warning(" new: %s %d (%d,%d)\n",
- tdp->t_name ? tdp->t_name : "(anon)",
+ warning(" new: %s %d (%d,%d)\n", tdesc_name(tdp),
tdp->t_type, TYPEFILE(tdp->t_id), TYPENUM(tdp->t_id));
return (-1);
}
@@ -912,8 +908,7 @@
cp += 3;
}
- parse_debug(3, cp, "soudef: %s size=%d",
- (*rtdp)->t_name ? (*rtdp)->t_name : "(anonsou)",
+ parse_debug(3, cp, "soudef: %s size=%d", tdesc_name(*rtdp),
(*rtdp)->t_size);
prev = &((*rtdp)->t_members);
@@ -954,8 +949,7 @@
}
} else {
parse_debug(3, NULL, " refers to %s (%d, %s)",
- w ? w : "anon", h,
- tdp->t_name ? tdp->t_name : "anon");
+ w ? w : "anon", h, tdesc_name(tdp));
}
cp = offsize(cp, mlp);
@@ -964,7 +958,7 @@
if (itdp->t_type == INTRINSIC) {
if (mlp->ml_size != itdp->t_intr->intr_nbits) {
parse_debug(4, cp, "making %d bit intrinsic "
- "from %s", mlp->ml_size, itdp->t_name);
+ "from %s", mlp->ml_size, tdesc_name(itdp));
mlp->ml_type = bitintrinsic(itdp, mlp->ml_size);
} else
mlp->ml_type = tdp;
@@ -1037,8 +1031,7 @@
cp = name(cp, &w);
elp->el_name = w;
cp = number(cp, &elp->el_number);
- parse_debug(3, NULL, "enum %s: %s=%d",
- (*rtdp)->t_name ? (*rtdp)->t_name : "(anon enum)",
+ parse_debug(3, NULL, "enum %s: %s=%d", tdesc_name(*rtdp),
elp->el_name, elp->el_number);
prev = &elp->el_next;
if (*cp++ != ',')
@@ -1171,11 +1164,11 @@
case INTRINSIC:
if (ml->ml_size != tdp->t_intr->intr_nbits) {
debug(3, "making %d bit intrinsic from %s",
- ml->ml_size, tdp->t_name);
+ ml->ml_size, tdesc_name(tdp));
ml->ml_type = bitintrinsic(tdp, ml->ml_size);
} else {
debug(3, "using existing %d bit %s intrinsic",
- ml->ml_size, tdp->t_name);
+ ml->ml_size, tdesc_name(tdp));
ml->ml_type = tdp;
}
return (1);
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/stabs.c#2 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "@(#)stabs.c 1.9 05/06/08 SMI"
+#pragma ident "@(#)stabs.c 1.10 06/04/20 SMI"
/*
* Routines used to read stabs data from a file, and to build a tdata structure
@@ -64,8 +63,7 @@
{
tdesc_t *new;
- debug(3, "Trying to resolve %s (%d)\n",
- (node->t_name ? node->t_name : "(anon)"), node->t_id);
+ debug(3, "Trying to resolve %s (%d)\n", tdesc_name(node), node->t_id);
new = lookup(node->t_id);
if (new == NULL) {
@@ -85,8 +83,7 @@
{
tdesc_t *new = lookupname(node->t_name);
- debug(3, "Trying to unforward %s (%d)\n",
- (node->t_name ? node->t_name : "(anon)"), node->t_id);
+ debug(3, "Trying to unforward %s (%d)\n", tdesc_name(node), node->t_id);
if (!new || (new->t_type != STRUCT && new->t_type != UNION))
return (0);
==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/tdata.c#2 (text) ====
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,11 +19,11 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list