xref: /titanic_44/usr/src/tools/ctf/dwarf/common/dwarf_global.h (revision 8b1606b5d15e5e037182f32e0306c43206772082)
1 /*
2 
3   Copyright (C) 2000 Silicon Graphics, Inc.  All Rights Reserved.
4 
5   This program is free software; you can redistribute it and/or modify it
6   under the terms of version 2.1 of the GNU Lesser General Public License
7   as published by the Free Software Foundation.
8 
9   This program is distributed in the hope that it would be useful, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13   Further, this software is distributed without any warranty that it is
14   free of the rightful claim of any third person regarding infringement
15   or the like.  Any license provided herein, whether implied or
16   otherwise, applies only to this software file.  Patent licenses, if
17   any, provided herein do not apply to combinations of this program with
18   other software, or any other product whatsoever.
19 
20   You should have received a copy of the GNU Lesser General Public
21   License along with this program; if not, write the Free Software
22   Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
23   USA.
24 
25   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
26   Mountain View, CA 94043, or:
27 
28   http://www.sgi.com
29 
30   For further information regarding this notice, see:
31 
32   http://oss.sgi.com/projects/GenInfo/NoticeExplan
33 
34 */
35 
36 
37 
38 
39 typedef struct Dwarf_Global_Context_s *Dwarf_Global_Context;
40 
41 /*
42     This struct contains header information for a set of pubnames.
43     Essentially, they contain the context for a set of pubnames
44     belonging to a compilation-unit.
45 
46 
47     This is also used for the sgi-specific
48     weaknames, typenames, varnames, funcnames data:
49     the structs for those are incomplete and
50     instances of this are used instead.
51 
52 */
53 struct Dwarf_Global_Context_s {
54 
55     /*
56        Length in .debug_pubnames of a set of pubnames for a
57        compilation-unit. Dwarf_Word pu_length; The value is not made
58        available outside libdwarf and not used inside, so no need to
59        record it. */
60 
61     /* for this context, size of a length. 4 or 8 */
62     unsigned char pu_length_size;
63     /* for this CU, size of the extension 0 except for dwarf2 extension
64        64bit, in which case is 4. */
65     unsigned char pu_extension_size;
66 
67     /*
68        Offset into .debug_info of the compilation-unit header (not DIE)
69        for this set of pubnames. */
70     Dwarf_Off pu_offset_of_cu_header;
71 
72     /* Size of compilation-unit that these pubnames are in. */
73     Dwarf_Unsigned pu_info_length;
74 
75     Dwarf_Debug pu_dbg;
76 };
77 
78 
79 /* This struct contains information for a single pubname. */
80 struct Dwarf_Global_s {
81 
82     /*
83        Offset from the start of the corresponding compilation-unit of
84        the DIE for the given pubname CU. */
85     Dwarf_Off gl_named_die_offset_within_cu;
86 
87     /* Points to the given pubname. */
88     Dwarf_Small *gl_name;
89 
90     /* Context for this pubname. */
91     Dwarf_Global_Context gl_context;
92 };
93 
94 int _dwarf_internal_get_pubnames_like_data(Dwarf_Debug dbg,
95 					   Dwarf_Small *
96 					   section_data_ptr,
97 					   Dwarf_Unsigned
98 					   section_length,
99 					   Dwarf_Global ** globals,
100 					   Dwarf_Signed * return_count,
101 					   Dwarf_Error * error,
102 					   int allocation_code,
103 					   int length_err_num,
104 					   int version_err_num);
105