diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2010-08-02 12:13:33 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2010-08-02 12:13:33 +0000 |
commit | 679969c11d8f283ad56fa4b5bbd853cd1e7aa8fa (patch) | |
tree | c60a223241eda8965f3bd77678af238462427a7a /tools | |
parent | 82ca49cf3cb6c76f3e24bdef2e6fb06eaf01d76f (diff) | |
download | FreeBSD-src-679969c11d8f283ad56fa4b5bbd853cd1e7aa8fa.zip FreeBSD-src-679969c11d8f283ad56fa4b5bbd853cd1e7aa8fa.tar.gz |
Update DTrace userland code to the latest available.
Summary of changes:
- libdtrace
changeset: 12902:3bb859a7330c
user: Bryan Cantrill <Bryan.Cantrill@Sun.COM>
date: Fri Jul 23 17:34:02 2010 -0700
summary: 6679140 asymmetric alloc/dealloc activity can induce dynamic variable drops
changeset: 12692:4341b447c069
user: Ali Bahrami <Ali.Bahrami@Oracle.COM>
date: Thu Jun 24 18:16:42 2010 -0600
summary: 6916796 OSnet mapfiles should use version 2 link-editor syntax
changeset: 12507:501806a754d2
user: Alan Maguire <Alan.Maguire@Sun.COM>
date: Thu May 27 17:29:51 2010 -0400
summary: PSARC 2010/106 DTrace TCP and UDP providers
changeset: 11798:1e7f1f154004
user: Roger A. Faulkner <Roger.Faulkner@Sun.COM>
date: Sun Feb 28 18:42:20 2010 -0800
summary: PSARC 2009/657 delete obsolete system call traps
changeset: 11466:d60272412fb0
user: Roger A. Faulkner <Roger.Faulkner@Sun.COM>
date: Mon Jan 11 17:42:13 2010 -0800
summary: 6915578 MUTEX_HELD() and RW_LOCK_HELD() macros should be available to Posix threads
changeset: 11237:0d23e47ed228
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Thu Dec 03 13:39:19 2009 +0000
summary: 6795386 macro arguments and globbing in DTrace probe descriptions don't mix
changeset: 10791:944abfb5b345
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Wed Oct 14 11:25:23 2009 +0100
summary: 6886953 large symbols lead to stack exhaustion
changeset: 10326:8e3fbeec2d76
user: Siddheshwar Mahesh <Siddheshwar.Mahesh@Sun.COM>
date: Mon Aug 17 13:26:49 2009 -0500
summary: 6868411 NFS provider generates error on ci_remote on RDMA operations
changeset: 10207:87c40ea3fc4b
user: jmcp <James.McPherson@Sun.COM>
date: Wed Jul 29 16:56:03 2009 -0700
summary: 6864230 hiho, hiho, it'ch chtime for CH to go
changeset: 10044:2643c1cd9e2a
user: Priya Krishnan <Priya.Krishnan@Sun.COM>
date: Mon Jul 06 21:19:41 2009 -0400
summary: 6855027 iscsit.d breaks dtrace in osol based on snv_117
changeset: 9900:1b86d65a4f9e
user: Ali Bahrami <Ali.Bahrami@Sun.COM>
date: Thu Jun 18 13:16:39 2009 -0600
summary: 6851224 elf_getshnum() and elf_getshstrndx() incompatible with 2002 ELF gABI agreement
changeset: 9885:a3d5e9d9e779
user: Robert Mastors <Robert.Mastors@Sun.COM>
date: Tue Jun 16 15:25:25 2009 -0500
summary: 6711844 assert: vp->v_shrlocks == 0L, file: ../../common/fs/vnode.c, line: 2333
changeset: 9881:741c9e4e094c
user: Charles Ting <Charles.Ting@Sun.COM>
date: Tue Jun 16 14:51:40 2009 -0400
summary: 6849606 SRP DTrace Probe for xfer-done misses completion of READ transfers
changeset: 9829:e8059fcaee97
user: Charles Ting <Charles.Ting@Sun.COM>
date: Tue Jun 09 10:11:35 2009 -0400
summary: 6804431 Add Dtrace probes to SRPT
changeset: 9812:a2990074321f
user: Priya Krishnan <Priya.Krishnan@Sun.COM>
date: Mon Jun 08 09:49:48 2009 -0400
summary: 6847237 The iscsit.d DTrace translator should include iscsi.d for the definition of iscsiinfo_t
changeset: 9721:4f7e194c7c37
user: Priya Krishnan <Priya.Krishnan@Sun.COM>
date: Tue May 26 10:40:43 2009 -0400
summary: 6809997 COMSTAR iscsi target DTrace Provider needed
changeset: 9625:8aa5731291b4
user: Sam Cramer <Sam.Cramer@Sun.COM>
date: Wed May 13 17:10:06 2009 -0700
summary: 6840354 "/usr/lib/dtrace/fc.d", line 59: syntax error near "fct_local_port_t"
changeset: 9609:8874cc8d5e3f
user: Sam Cramer <Sam.Cramer@Sun.COM>
date: Mon May 11 21:02:27 2009 -0700
summary: 6809580 fct DTrace providers needed for qlt
changeset: 9578:c4b38ec17f4e
user: Sam Cramer <Sam.Cramer@Sun.COM>
date: Fri May 08 12:12:40 2009 -0700
summary: 6809580 fct DTrace providers needed for qlt
changeset: 9531:dc8924ef7839
user: Rafael Vanoni <rafael.vanoni@sun.com>
date: Mon May 04 11:48:15 2009 -0700
summary: 6730130 dtrace missing printf handler for stdev
changeset: 9389:750ed3471e90
user: Vamsi Nagineni <Vamsi.Krishna@Sun.COM>
date: Fri Apr 17 06:26:47 2009 -0700
summary: 6812050 dtrace should translate curpsinfo->pr_contract
changeset: 9085:ff7eb0bace56
user: Ali Bahrami <Ali.Bahrami@Sun.COM>
date: Wed Mar 18 13:28:28 2009 -0600
summary: 6813909 generalize eh_frame support to non-amd64 platforms
changeset: 8803:8c01b39012c9
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Fri Feb 13 07:13:13 2009 +0000
summary: PSARC 2008/480 DTrace CPC Provider
changeset: 8744:03d5725cda56
user: Ali Bahrami <Ali.Bahrami@Sun.COM>
date: Tue Feb 10 09:38:02 2009 -0700
summary: 6798660 Cadmium .NOT file processing problem with CWD relative file paths
changeset: 8337:079ecc003ca6
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Thu Dec 11 11:26:47 2008 +0000
summary: 6750659 drti.o crashes app due to corrupt environment
changeset: 7991:d3b751ef3d85
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Mon Nov 03 10:26:23 2008 +0000
summary: 6738982 Representative thread after DTrace stop() action is incorrect
changeset: 7208:568549b138d8
user: vv149972
date: Mon Jul 28 23:14:31 2008 -0700
summary: 6696397 NFS v3 provider reports all UDP clients as 0.0.0.0
changeset: 6878:360e73ea6b0c
user: brendan
date: Fri Jun 13 19:06:55 2008 -0700
summary: PSARC 2008/302 DTrace IP Provider
changeset: 6554:b5817e112852
user: ahl
date: Mon May 05 14:38:24 2008 -0700
summary: 6677812 race between dtrace activities in non-local zones
----
- ctf tools:
changeset: 12177:800b7f847f1e
user: Surya Prakki <Surya.Prakki@Sun.COM>
date: Sun Apr 18 23:59:57 2010 -0700
summary: 6941452 ctfconvert fails on VLAs with code generated by SS12u1
changeset: 11432:c1c450bf62f2
user: John Levon <john.levon@sun.com>
date: Tue Jan 05 06:57:53 2010 -0800
summary: 6905711 anonymous and empty SOUs crash ctfconvert
changeset: 11227:cd2ac59c39f2
user: Ali Bahrami <Ali.Bahrami@Sun.COM>
date: Wed Dec 02 15:37:55 2009 -0700
summary: 6900241 ld should track SHT_GROUP sections by symbol name, not section name
changeset: 10380:5394a7172e1f
user: Ali Bahrami <Ali.Bahrami@Sun.COM>
date: Tue Aug 25 13:51:43 2009 -0600
summary: 6866605 SUNWonbld ELF analysis tools need overhaul (fix ctfmerge/libc dependency)
changeset: 10207:87c40ea3fc4b
user: jmcp <James.McPherson@Sun.COM>
date: Wed Jul 29 16:56:03 2009 -0700
summary: 6864230 hiho, hiho, it'ch chtime for CH to go
changeset: 10206:51f52702df72
user: John Levon <john.levon@sun.com>
date: Wed Jul 29 14:36:30 2009 -0700
summary: 6854065 CTF tools should error out given 1024+-member structures
changeset: 7230:429b4f7acf1a
user: sn199410
date: Wed Jul 30 16:10:30 2008 -0700
summary: 6575435 ctf tools cannot handle C99 VLAs ("variable length arrays")
changeset: 6936:72189fcd99e4
user: sommerfe
date: Sun Jun 22 09:13:44 2008 -0700
summary: 6716983 left-for-dead ctfmerge worker threads awake to take out maker
----
- dtrace command utility:
changeset: 12507:501806a754d2
user: Alan Maguire <Alan.Maguire@Sun.COM>
date: Thu May 27 17:29:51 2010 -0400
summary: PSARC 2010/106 DTrace TCP and UDP providers
changeset: 11838:32bb5d254240
user: Liane Praza <Liane.Praza@Sun.COM>
date: Tue Mar 02 19:29:26 2010 -0700
summary: PSARC 2010/067 Interim modernization updates
changeset: 11270:47a962fe7b45
user: Frank Van Der Linden <Frank.Vanderlinden@Sun.COM>
date: Mon Dec 07 13:47:36 2009 -0800
summary: 6907170 fix for 6875656 left out updates to DTrace test suite
changeset: 11237:0d23e47ed228
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Thu Dec 03 13:39:19 2009 +0000
summary: 6795386 macro arguments and globbing in DTrace probe descriptions don't mix
changeset: 11153:dec430d20576
user: Frank Van Der Linden <Frank.Vanderlinden@Sun.COM>
date: Sun Nov 22 19:22:26 2009 -0800
summary: 6875656 xdt needs to support more XenTrace probes
changeset: 11102:b91faef0c984
user: Gavin Maltby <Gavin.Maltby@Sun.COM>
date: Thu Nov 19 15:28:11 2009 +1100
summary: PSARC/2009/554 door_xcreate - extended door creation interface for private doors
changeset: 11066:cebb50cbe4f9
user: Rafael Vanoni <rafael.vanoni@sun.com>
date: Fri Nov 13 01:32:32 2009 -0800
summary: PSARC/2009/396 Tickless Kernel Architecture / lbolt decoupling
changeset: 10791:944abfb5b345
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Wed Oct 14 11:25:23 2009 +0100
summary: 6886953 large symbols lead to stack exhaustion
changeset: 10207:87c40ea3fc4b
user: jmcp <James.McPherson@Sun.COM>
date: Wed Jul 29 16:56:03 2009 -0700
summary: 6864230 hiho, hiho, it'ch chtime for CH to go
changeset: 9531:dc8924ef7839
user: Rafael Vanoni <rafael.vanoni@sun.com>
date: Mon May 04 11:48:15 2009 -0700
summary: 6730130 dtrace missing printf handler for stdev
changeset: 9397:e667d620a75c
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Mon Apr 20 07:58:44 2009 +0100
summary: 6806023 cpc provider event name validation needs to be a bit tighter
changeset: 8803:8c01b39012c9
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Fri Feb 13 07:13:13 2009 +0000
summary: PSARC 2008/480 DTrace CPC Provider
changeset: 8605:0189cb9c5358
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Thu Jan 22 12:09:13 2009 +0000
summary: 6749441 intrstat(1M) shows zeroed values after suspend/resume
changeset: 8337:079ecc003ca6
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Thu Dec 11 11:26:47 2008 +0000
summary: 6750659 drti.o crashes app due to corrupt environment
changeset: 8287:771477e4b843
user: John Sonnenschein <John.Sonnenschein@Sun.COM>
date: Fri Dec 05 19:08:38 2008 -0800
summary: PSARC 2005/462 Removal of Perl 5.6.1 from Solaris 11
changeset: 7991:d3b751ef3d85
user: Jonathan Haslam <Jonathan.Haslam@Sun.COM>
date: Mon Nov 03 10:26:23 2008 +0000
summary: 6738982 Representative thread after DTrace stop() action is incorrect
changeset: 7502:da077e5d991e
user: Aruna Ramakrishna <aruna@cs.umn.edu>
date: Sat Sep 06 05:36:02 2008 -0400
summary: 6706947 tcp_trace should be replaced with dtrace probes.
changeset: 7484:a48e950bad22
user: Tom Erickson <tomee@eng.sun.com>
date: Wed Sep 03 15:14:25 2008 -0700
summary: 6737926 getAggregate() method fails to specify anonymous aggregation explicitly
changeset: 7299:d9a056040774
user: John Beck <John.Beck@Sun.COM>
date: Thu Aug 07 12:44:26 2008 -0700
summary: 6734627 protocmp complains about opt/SUNWdtrt/README after TW -> Hg switch
changeset: 6998:58787ea78303
user: brendan
date: Tue Jul 01 18:28:22 2008 -0700
summary: 6721426 tst.sdtargs.d passes despite dtrace "invalid address" error
changeset: 6878:360e73ea6b0c
user: brendan
date: Fri Jun 13 19:06:55 2008 -0700
summary: PSARC 2008/302 DTrace IP Provider
changeset: 6670:1961a43f2335
user: tariq
date: Tue May 20 15:08:16 2008 -0700
summary: 6685348 Hypervisor event provider for DTrace
changeset: 6554:b5817e112852
user: ahl
date: Mon May 05 14:38:24 2008 -0700
summary: 6677812 race between dtrace activities in non-local zones
changeset: 6543:465433824d87
user: rie
date: Fri May 02 15:01:06 2008 -0700
summary: 6683064 check_rtime could do with some spring cleaning
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ctf/cvt/ctf.c | 32 | ||||
-rw-r--r-- | tools/ctf/cvt/ctfmerge.c | 30 | ||||
-rw-r--r-- | tools/ctf/cvt/ctfmerge.h | 9 | ||||
-rw-r--r-- | tools/ctf/cvt/st_parse.c | 34 | ||||
-rw-r--r-- | tools/ctf/cvt/tdata.c | 9 |
5 files changed, 83 insertions, 31 deletions
diff --git a/tools/ctf/cvt/ctf.c b/tools/ctf/cvt/ctf.c index 91e0f61..1e42575 100644 --- a/tools/ctf/cvt/ctf.c +++ b/tools/ctf/cvt/ctf.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Create and parse buffers containing CTF data. */ @@ -172,6 +170,12 @@ write_functions(iidesc_t *idp, ctf_buf_t *b) } nargs = idp->ii_nargs + (idp->ii_vargs != 0); + + if (nargs > CTF_MAX_VLEN) { + terminate("function %s has too many args: %d > %d\n", + idp->ii_name, nargs, CTF_MAX_VLEN); + } + fdata[0] = CTF_TYPE_INFO(CTF_K_FUNCTION, 1, nargs); fdata[1] = idp->ii_dtype->t_id; ctf_buf_write(b, fdata, sizeof (fdata)); @@ -312,6 +316,11 @@ write_type(tdesc_t *tp, ctf_buf_t *b) for (i = 0, mp = tp->t_members; mp != NULL; mp = mp->ml_next) i++; /* count up struct or union members */ + if (i > CTF_MAX_VLEN) { + terminate("sou %s has too many members: %d > %d\n", + tdesc_name(tp), i, CTF_MAX_VLEN); + } + if (tp->t_type == STRUCT) ctt.ctt_info = CTF_TYPE_INFO(CTF_K_STRUCT, isroot, i); else @@ -351,6 +360,11 @@ write_type(tdesc_t *tp, ctf_buf_t *b) for (i = 0, ep = tp->t_emem; ep != NULL; ep = ep->el_next) i++; /* count up enum members */ + if (i > CTF_MAX_VLEN) { + terminate("enum %s has too many values: %d > %d\n", + tdesc_name(tp), i, CTF_MAX_VLEN); + } + ctt.ctt_info = CTF_TYPE_INFO(CTF_K_ENUM, isroot, i); write_sized_type_rec(b, &ctt, tp->t_size); @@ -387,8 +401,14 @@ write_type(tdesc_t *tp, ctf_buf_t *b) break; case FUNCTION: - ctt.ctt_info = CTF_TYPE_INFO(CTF_K_FUNCTION, isroot, - tp->t_fndef->fn_nargs + tp->t_fndef->fn_vargs); + i = tp->t_fndef->fn_nargs + tp->t_fndef->fn_vargs; + + if (i > CTF_MAX_VLEN) { + terminate("function %s has too many args: %d > %d\n", + i, CTF_MAX_VLEN); + } + + ctt.ctt_info = CTF_TYPE_INFO(CTF_K_FUNCTION, isroot, i); ctt.ctt_type = tp->t_fndef->fn_ret->t_id; write_unsized_type_rec(b, &ctt); @@ -927,7 +947,7 @@ resurrect_types(ctf_header_t *h, tdata_t *td, tdesc_t **tdarr, int tdsize, if (CTF_NAME_STID(ctt->ctt_name) != CTF_STRTAB_0) parseterminate( - "Unable to cope with non-zero strtab id"); + "Unable to cope with non-zero strtab id"); if (CTF_NAME_OFFSET(ctt->ctt_name) != 0) { tdp->t_name = xstrdup(sbuf + CTF_NAME_OFFSET(ctt->ctt_name)); diff --git a/tools/ctf/cvt/ctfmerge.c b/tools/ctf/cvt/ctfmerge.c index 2def4904..2d00a56 100644 --- a/tools/ctf/cvt/ctfmerge.c +++ b/tools/ctf/cvt/ctfmerge.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -640,6 +640,7 @@ wq_init(workqueue_t *wq, int nfiles) wq->wq_wip = xcalloc(sizeof (wip_t) * nslots); wq->wq_nwipslots = nslots; wq->wq_nthreads = MIN(sysconf(_SC_NPROCESSORS_ONLN) * 3 / 2, nslots); + wq->wq_thread = xmalloc(sizeof (pthread_t) * wq->wq_nthreads); if (getenv("CTFMERGE_INPUT_THROTTLE")) throttle = atoi(getenv("CTFMERGE_INPUT_THROTTLE")); @@ -682,7 +683,6 @@ wq_init(workqueue_t *wq, int nfiles) static void start_threads(workqueue_t *wq) { - pthread_t thrid; sigset_t sets; int i; @@ -693,8 +693,8 @@ start_threads(workqueue_t *wq) pthread_sigmask(SIG_BLOCK, &sets, NULL); for (i = 0; i < wq->wq_nthreads; i++) { - pthread_create(&thrid, NULL, (void *(*)(void *))worker_thread, - wq); + pthread_create(&wq->wq_thread[i], NULL, + (void *(*)(void *))worker_thread, wq); } sigset(SIGINT, handle_sig); @@ -703,6 +703,16 @@ start_threads(workqueue_t *wq) pthread_sigmask(SIG_UNBLOCK, &sets, NULL); } +static void +join_threads(workqueue_t *wq) +{ + int i; + + for (i = 0; i < wq->wq_nthreads; i++) { + pthread_join(wq->wq_thread[i], NULL); + } +} + static int strcompare(const void *p1, const void *p2) { @@ -712,10 +722,18 @@ strcompare(const void *p1, const void *p2) return (strcmp(s1, s2)); } +/* + * Core work queue structure; passed to worker threads on thread creation + * as the main point of coordination. Allocate as a static structure; we + * could have put this into a local variable in main, but passing a pointer + * into your stack to another thread is fragile at best and leads to some + * hard-to-debug failure modes. + */ +static workqueue_t wq; + int main(int argc, char **argv) { - workqueue_t wq; tdata_t *mstrtd, *savetd; char *uniqfile = NULL, *uniqlabel = NULL; char *withfile = NULL; @@ -897,6 +915,8 @@ main(int argc, char **argv) pthread_cond_wait(&wq.wq_alldone_cv, &wq.wq_queue_lock); pthread_mutex_unlock(&wq.wq_queue_lock); + join_threads(&wq); + /* * All requested files have been merged, with the resulting tree in * mstrtd. savetd is the tree that will be placed into the output file. diff --git a/tools/ctf/cvt/ctfmerge.h b/tools/ctf/cvt/ctfmerge.h index 38560ea..ce40803 100644 --- a/tools/ctf/cvt/ctfmerge.h +++ b/tools/ctf/cvt/ctfmerge.h @@ -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,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -78,6 +77,8 @@ typedef struct workqueue { int wq_nomorefiles; + pthread_t *wq_thread; + barrier_t wq_bar1; barrier_t wq_bar2; } workqueue_t; diff --git a/tools/ctf/cvt/st_parse.c b/tools/ctf/cvt/st_parse.c index d4d4921..1530734 100644 --- a/tools/ctf/cvt/st_parse.c +++ b/tools/ctf/cvt/st_parse.c @@ -19,12 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * This file is a sewer. */ @@ -482,7 +479,8 @@ whitesp(char *cp) { char c; - for (c = *cp++; isspace(c); c = *cp++); + for (c = *cp++; isspace(c); c = *cp++) + ; --cp; return (cp); } @@ -497,8 +495,8 @@ name(char *cp, char **w) c = *cp++; if (c == ':') *w = NULL; - else if (isalpha(c) || strchr("_.$", c)) { - for (c = *cp++; isalnum(c) || strchr(" _.$", c); c = *cp++) + else if (isalpha(c) || strchr("_.$#", c)) { + for (c = *cp++; isalnum(c) || strchr(" _.$#", c); c = *cp++) ; if (c != ':') reset(); @@ -991,14 +989,28 @@ arraydef(char *cp, tdesc_t **rtdp) expected("arraydef/2", ";", cp - 1); if (*cp == 'S') { - /* variable length array - treat as null dimensioned */ + /* + * variable length array - treat as null dimensioned + * + * For VLA variables on sparc, SS12 generated stab entry + * looks as follows: + * .stabs "buf:(0,28)=zr(0,4);0;S-12;(0,1)", 0x80, 0, 0, -16 + * Whereas SS12u1 generated stab entry looks like this: + * .stabs "buf:(0,28)=zr(0,4);0;S0;(0,1)", 0x80, 0, 0, 0 + * On x86, both versions generate the first type of entry. + * We should be able to parse both. + */ cp++; - if (*cp++ != '-') - expected("arraydef/fpoff-sep", "-", cp - 1); + if (*cp == '-') + cp++; cp = number(cp, &end); end = start; } else { - /* normal fixed-dimension array */ + /* + * normal fixed-dimension array + * Stab entry for this looks as follows : + * .stabs "x:(0,28)=ar(0,4);0;9;(0,3)", 0x80, 0, 40, 0 + */ cp = number(cp, &end); /* upper */ } diff --git a/tools/ctf/cvt/tdata.c b/tools/ctf/cvt/tdata.c index 32d8482..2959285 100644 --- a/tools/ctf/cvt/tdata.c +++ b/tools/ctf/cvt/tdata.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines for manipulating tdesc and tdata structures */ @@ -86,9 +84,10 @@ tdesc_layouthash(int nbuckets, void *node) * Unnamed structures, which cannot have forward * declarations pointing to them. We can therefore * incorporate the name of the first member into - * the hash value. + * the hash value, assuming there are any. */ - name = tdp->t_members->ml_name; + if (tdp->t_members != NULL) + name = tdp->t_members->ml_name; break; case ENUM: /* Use the first element in the hash value */ |