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