VirtualBox

source: vbox/trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_error.c

Last change on this file was 53657, checked in by vboxsync, 10 years ago

VBoxDTrace: CTF compiles and links. (r33)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#ifndef VBOX
28#pragma ident "%Z%%M% %I% %E% SMI"
29#endif
30
31#include <ctf_impl.h>
32
33static const char *const _ctf_errlist[] = {
34 "File is not in CTF or ELF format", /* ECTF_FMT */
35 "File uses more recent ELF version than libctf", /* ECTF_ELFVERS */
36 "File uses more recent CTF version than libctf", /* ECTF_CTFVERS */
37 "File is a different endian-ness than libctf", /* ECTF_ENDIAN */
38 "Symbol table uses invalid entry size", /* ECTF_SYMTAB */
39 "Symbol table data buffer is not valid", /* ECTF_SYMBAD */
40 "String table data buffer is not valid", /* ECTF_STRBAD */
41 "File data structure corruption detected", /* ECTF_CORRUPT */
42 "File does not contain CTF data", /* ECTF_NOCTFDATA */
43 "Buffer does not contain CTF data", /* ECTF_NOCTFBUF */
44 "Symbol table information is not available", /* ECTF_NOSYMTAB */
45 "Type information is in parent and unavailable", /* ECTF_NOPARENT */
46 "Cannot import types with different data model", /* ECTF_DMODEL */
47 "Failed to mmap a needed data section", /* ECTF_MMAP */
48 "Decompression package SUNWzlib not installed", /* ECTF_ZMISSING */
49 "Failed to initialize decompression library", /* ECTF_ZINIT */
50 "Failed to allocate decompression buffer", /* ECTF_ZALLOC */
51 "Failed to decompress CTF data", /* ECTF_DECOMPRESS */
52 "External string table is not available", /* ECTF_STRTAB */
53 "String name offset is corrupt", /* ECTF_BADNAME */
54 "Invalid type identifier", /* ECTF_BADID */
55 "Type is not a struct or union", /* ECTF_NOTSOU */
56 "Type is not an enum", /* ECTF_NOTENUM */
57 "Type is not a struct, union, or enum", /* ECTF_NOTSUE */
58 "Type is not an integer or float", /* ECTF_NOTINTFP */
59 "Type is not an array", /* ECTF_NOTARRAY */
60 "Type does not reference another type", /* ECTF_NOTREF */
61 "Input buffer is too small for type name", /* ECTF_NAMELEN */
62 "No type information available for that name", /* ECTF_NOTYPE */
63 "Syntax error in type name", /* ECTF_SYNTAX */
64 "Symbol table entry is not a function", /* ECTF_NOTFUNC */
65 "No function information available for symbol", /* ECTF_NOFUNCDAT */
66 "Symbol table entry is not a data object", /* ECTF_NOTDATA */
67 "No type information available for symbol", /* ECTF_NOTYPEDAT */
68 "No label information available for that name", /* ECTF_NOLABEL */
69 "File does not contain any labels", /* ECTF_NOLABELDATA */
70 "Feature not supported", /* ECTF_NOTSUP */
71 "Invalid enum element name", /* ECTF_NOENUMNAM */
72 "Invalid member name", /* ECTF_NOMEMBNAM */
73 "CTF container is read-only", /* ECTF_RDONLY */
74 "Limit on number of dynamic type members reached", /* ECTF_DTFULL */
75 "Limit on number of dynamic types reached", /* ECTF_FULL */
76 "Duplicate member name definition", /* ECTF_DUPMEMBER */
77 "Conflicting type is already defined", /* ECTF_CONFLICT */
78};
79
80static const int _ctf_nerr = sizeof (_ctf_errlist) / sizeof (_ctf_errlist[0]);
81
82const char *
83ctf_errmsg(int error)
84{
85 const char *str;
86
87 if (error >= ECTF_BASE && (error - ECTF_BASE) < _ctf_nerr)
88 str = _ctf_errlist[error - ECTF_BASE];
89 else
90 str = ctf_strerror(error);
91
92 return (str ? str : "Unknown error");
93}
94
95int
96ctf_errno(ctf_file_t *fp)
97{
98 return (fp->ctf_errno);
99}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette