xref: /illumos-gate/usr/src/lib/libdwarf/common/dwarf_dsc.h (revision 4d9fdb46b215739778ebc12079842c9905586999)
1 /*
2   Copyright (C) 2016-2016 David Anderson. All Rights Reserved.
3 
4   This program is free software; you can redistribute it and/or modify it
5   under the terms of version 2.1 of the GNU Lesser General Public License
6   as published by the Free Software Foundation.
7 
8   This program is distributed in the hope that it would be useful, but
9   WITHOUT ANY WARRANTY; without even the implied warranty of
10   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 
12   Further, this software is distributed without any warranty that it is
13   free of the rightful claim of any third person regarding infringement
14   or the like.  Any license provided herein, whether implied or
15   otherwise, applies only to this software file.  Patent licenses, if
16   any, provided herein do not apply to combinations of this program with
17   other software, or any other product whatsoever.
18 
19   You should have received a copy of the GNU Lesser General Public
20   License along with this program; if not, write the Free Software
21   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
22   USA.
23 */
24 
25 /*  dsc_type: if 0, then dsc_low is a single discriminant value
26     and dsc_high is zero..
27     If 1, then dsc_low, dsc_high are a discriminant range
28 
29     All the messy complexity here is so we can have both
30     a set of values read as uleb and as sleb.
31     We make our own copy of the block for the same reason.
32 */
33 struct Dwarf_Dsc_Entry_s {
34     /*  Type is a 1 byte leb that reads the same as sleb or uleb
35         because its value can only be zero or one. */
36     Dwarf_Half     dsc_type;
37     Dwarf_Unsigned dsc_low_u;
38     Dwarf_Unsigned dsc_high_u;
39     Dwarf_Signed dsc_low_s;
40     Dwarf_Signed dsc_high_s;
41 };
42 struct Dwarf_Dsc_Head_s {
43     Dwarf_Debug     dsh_debug;
44     Dwarf_Unsigned  dsh_count;
45     Dwarf_Small    *dsh_block;
46     Dwarf_Unsigned  dsh_block_len;
47     /*  Following two are flags to tell us whether
48         lebs already read in a given signedness. */
49     Dwarf_Bool      dsh_set_unsigned;
50     Dwarf_Bool      dsh_set_signed;
51 
52     struct Dwarf_Dsc_Entry_s *dsh_array;
53 };
54 
55 
56 void _dwarf_dsc_destructor(void *m);
57