diff options
author | Surya Prakki <Surya.Prakki@Sun.COM> | 2010-04-18 23:59:57 -0700 |
---|---|---|
committer | Surya Prakki <Surya.Prakki@Sun.COM> | 2010-04-18 23:59:57 -0700 |
commit | 53fb31f030ae7dbbde33d469c081dfb5a9862c06 (patch) | |
tree | f988cbe6ac35bda236c36f411b47bffad67a90aa /usr/src/tools/ctf/cvt/st_parse.c | |
parent | f2e8686e6101ad6ab3df43205537e610151b5434 (diff) | |
download | illumos-joyent-53fb31f030ae7dbbde33d469c081dfb5a9862c06.tar.gz |
6941452 ctfconvert fails on VLAs with code generated by SS12u1
Diffstat (limited to 'usr/src/tools/ctf/cvt/st_parse.c')
-rw-r--r-- | usr/src/tools/ctf/cvt/st_parse.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/usr/src/tools/ctf/cvt/st_parse.c b/usr/src/tools/ctf/cvt/st_parse.c index b68e08fcbb..1530734a48 100644 --- a/usr/src/tools/ctf/cvt/st_parse.c +++ b/usr/src/tools/ctf/cvt/st_parse.c @@ -19,12 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 2008 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. */ @@ -992,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 */ } |