| 1 |
/* |
| 2 |
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. |
| 3 |
Portions Copyright (C) 2008-2023 David Anderson. All Rights Reserved. |
| 4 |
|
| 5 |
This program is free software; you can redistribute it |
| 6 |
and/or modify it under the terms of version 2.1 of the |
| 7 |
GNU Lesser General Public License as published by the Free |
| 8 |
Software Foundation. |
| 9 |
|
| 10 |
This program is distributed in the hope that it would be |
| 11 |
useful, but WITHOUT ANY WARRANTY; without even the implied |
| 12 |
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 13 |
PURPOSE. |
| 14 |
|
| 15 |
Further, this software is distributed without any warranty |
| 16 |
that it is free of the rightful claim of any third person |
| 17 |
regarding infringement or the like. Any license provided |
| 18 |
herein, whether implied or otherwise, applies only to this |
| 19 |
software file. Patent licenses, if any, provided herein |
| 20 |
do not apply to combinations of this program with other |
| 21 |
software, or any other product whatsoever. |
| 22 |
|
| 23 |
You should have received a copy of the GNU Lesser General |
| 24 |
Public License along with this program; if not, write |
| 25 |
the Free Software Foundation, Inc., 51 Franklin Street - |
| 26 |
Fifth Floor, Boston MA 02110-1301, USA. |
| 27 |
|
| 28 |
*/ |
| 29 |
|
| 30 |
#ifndef DWARF_ABBREV_H |
| 31 |
#define DWARF_ABBREV_H |
| 32 |
|
| 33 |
#ifdef __cplusplus |
| 34 |
extern "C" { |
| 35 |
#endif /* __cplusplus */ |
| 36 |
|
| 37 |
/* In a given CU, one of these is (eventually) set up |
| 38 |
for every abbreviation we need to find (and for all |
| 39 |
those earlier in the abbreviations for that CU). |
| 40 |
So we don't want elements needlessly big. |
| 41 |
*/ |
| 42 |
struct Dwarf_Abbrev_s { |
| 43 |
/* No TAG should exceed DW_TAG_hi_user, 0xffff, but |
| 44 |
we do allow a larger value here. */ |
| 45 |
Dwarf_Unsigned dab_tag; |
| 46 |
/* Abbreviations are numbered (normally sequentially from |
| 47 |
1 and so 16 bits is not enough! */ |
| 48 |
Dwarf_Unsigned dab_code; |
| 49 |
Dwarf_Small dab_has_child; |
| 50 |
/* dab_abbrev_ptr points to the abbreviations |
| 51 |
themselves in memory, the list of attr/form |
| 52 |
integers terminated by 0,0. */ |
| 53 |
Dwarf_Byte_Ptr dab_abbrev_ptr; |
| 54 |
Dwarf_Debug dab_dbg; |
| 55 |
|
| 56 |
/* Section global offset of the abbrev. */ |
| 57 |
Dwarf_Off dab_goffset; |
| 58 |
/* dab_count is the number of attr/form uleb pairs */ |
| 59 |
Dwarf_Off dab_count; |
| 60 |
/* The number of DW_FORM_implicit_const in the uleb pairs*/ |
| 61 |
Dwarf_Unsigned dab_implicit_count; |
| 62 |
|
| 63 |
/* When the caller cycles through attr/form pairs |
| 64 |
by index from zero this lets the code read just one |
| 65 |
pair to work. */ |
| 66 |
Dwarf_Byte_Ptr dab_next_ptr; |
| 67 |
Dwarf_Unsigned dab_next_index; |
| 68 |
}; |
| 69 |
|
| 70 |
int _dwarf_count_abbrev_entries(Dwarf_Debug dbg, |
| 71 |
Dwarf_Byte_Ptr abbrev_ptr, |
| 72 |
Dwarf_Byte_Ptr abbrev_section_end, |
| 73 |
Dwarf_Unsigned *abbrev_count_out, |
| 74 |
Dwarf_Unsigned *abbrev_implicit_const_count_out, |
| 75 |
Dwarf_Byte_Ptr *abbrev_ptr_out, |
| 76 |
Dwarf_Error *error); |
| 77 |
|
| 78 |
#ifdef __cplusplus |
| 79 |
} |
| 80 |
#endif /* __cplusplus */ |
| 81 |
|
| 82 |
#endif /* DWARF_ABBREV_H */ |