xref: /illumos-gate/usr/src/lib/libdwarf/common/dwarf_tied_decls.h (revision 16b76d3cb933ff92018a2a75594449010192eacb)
1 /*
2 
3   Copyright (C) 2015-2015 David Anderson. 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., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
23   USA.
24 
25 */
26 
27 
28 
29 #define HASHSEARCH
30 
31 #ifdef HASHSEARCH
32 /* Only needed for hash based search in a tsearch style. */
33 #define INITTREE(x,y) x = dwarf_initialize_search_hash(&(x),(y),0)
34 #else
35 #define INITTREE(x,y)
36 #endif /* HASHSEARCH */
37 
38 
39 /* Contexts are in a list in a dbg and
40    do not move once established.
41    So saving one is ok. as long as the dbg
42    exists. */
43 struct Dwarf_Tied_Entry_s {
44   Dwarf_Sig8 dt_key;
45   Dwarf_CU_Context dt_context;
46 };
47 
48 int _dwarf_tied_compare_function(const void *l, const void *r);
49 void * _dwarf_tied_make_entry(Dwarf_Sig8 *key, Dwarf_CU_Context val);
50 DW_TSHASHTYPE _dwarf_tied_data_hashfunc(const void *keyp);
51 
52 int
53 _dwarf_loop_reading_debug_info_for_cu(
54     Dwarf_Debug tieddbg,
55     Dwarf_Sig8 sig,
56     Dwarf_Error *error);
57