@@ -33,7 +33,7 @@
#include "cfi.h"
#include "encoded-value.h"
#include <assert.h>
-#include <search.h>
+#include <eu-search.h>
#include <stdlib.h>
@@ -144,7 +144,7 @@ intern_new_cie (Dwarf_CFI *cache, Dwarf_Off offset, const Dwarf_CIE *info)
cie->initial_state = NULL;
/* Add the new entry to the search tree. */
- if (tsearch (cie, &cache->cie_tree, &compare_cie) == NULL)
+ if (eu_tsearch (cie, &cache->cie_tree, &compare_cie) == NULL)
{
free (cie);
__libdw_seterrno (DWARF_E_NOMEM);
@@ -160,7 +160,7 @@ internal_function
__libdw_find_cie (Dwarf_CFI *cache, Dwarf_Off offset)
{
const struct dwarf_cie cie_key = { .offset = offset };
- struct dwarf_cie **found = tfind (&cie_key, &cache->cie_tree, &compare_cie);
+ struct dwarf_cie **found = eu_tfind (&cie_key, &cache->cie_tree, &compare_cie);
if (found != NULL)
return *found;
@@ -189,7 +189,7 @@ internal_function
__libdw_intern_cie (Dwarf_CFI *cache, Dwarf_Off offset, const Dwarf_CIE *info)
{
const struct dwarf_cie cie_key = { .offset = offset };
- struct dwarf_cie **found = tfind (&cie_key, &cache->cie_tree, &compare_cie);
+ struct dwarf_cie **found = eu_tfind (&cie_key, &cache->cie_tree, &compare_cie);
if (found == NULL)
/* We have not read this CIE yet. Enter it. */
(void) intern_new_cie (cache, offset, info);
@@ -31,7 +31,7 @@
#endif
#include <dwarf.h>
-#include <search.h>
+#include <eu-search.h>
#include <stdlib.h>
#include <assert.h>
@@ -137,7 +137,7 @@ loc_compare (const void *p1, const void *p2)
/* For each DW_OP_implicit_value, we store a special entry in the cache.
This points us directly to the block data for later fetching.
- Returns zero on success, -1 on bad DWARF or 1 if tsearch failed. */
+ Returns zero on success, -1 on bad DWARF or 1 if eu_tsearch failed. */
static int
store_implicit_value (Dwarf *dbg, void **cache, Dwarf_Op *op)
{
@@ -154,7 +154,7 @@ store_implicit_value (Dwarf *dbg, void **cache, Dwarf_Op *op)
block->addr = op;
block->data = (unsigned char *) data;
block->length = op->number;
- if (unlikely (tsearch (block, cache, loc_compare) == NULL))
+ if (unlikely (eu_tsearch (block, cache, loc_compare) == NULL))
return 1;
return 0;
}
@@ -167,7 +167,7 @@ dwarf_getlocation_implicit_value (Dwarf_Attribute *attr, const Dwarf_Op *op,
return -1;
struct loc_block_s fake = { .addr = (void *) op };
- struct loc_block_s **found = tfind (&fake, &attr->cu->locs, loc_compare);
+ struct loc_block_s **found = eu_tfind (&fake, &attr->cu->locs, loc_compare);
if (unlikely (found == NULL))
{
__libdw_seterrno (DWARF_E_NO_BLOCK);
@@ -211,7 +211,7 @@ is_constant_offset (Dwarf_Attribute *attr,
/* Check whether we already cached this location. */
struct loc_s fake = { .addr = attr->valp };
- struct loc_s **found = tfind (&fake, &attr->cu->locs, loc_compare);
+ struct loc_s **found = eu_tfind (&fake, &attr->cu->locs, loc_compare);
if (found == NULL)
{
@@ -235,7 +235,7 @@ is_constant_offset (Dwarf_Attribute *attr,
newp->loc = result;
newp->nloc = 1;
- found = tsearch (newp, &attr->cu->locs, loc_compare);
+ found = eu_tsearch (newp, &attr->cu->locs, loc_compare);
}
assert ((*found)->nloc == 1);
@@ -266,7 +266,7 @@ __libdw_intern_expression (Dwarf *dbg, bool other_byte_order,
/* Check whether we already looked at this list. */
struct loc_s fake = { .addr = block->data };
- struct loc_s **found = tfind (&fake, cache, loc_compare);
+ struct loc_s **found = eu_tfind (&fake, cache, loc_compare);
if (found != NULL)
{
/* We already saw it. */
@@ -655,7 +655,7 @@ __libdw_intern_expression (Dwarf *dbg, bool other_byte_order,
newp->addr = block->data;
newp->loc = result;
newp->nloc = *listlen;
- (void) tsearch (newp, cache, loc_compare);
+ (void) eu_tsearch (newp, cache, loc_compare);
/* We did it. */
return 0;
@@ -32,7 +32,7 @@
#include <assert.h>
#include <dwarf.h>
-#include <search.h>
+#include <eu-search.h>
#include <stdlib.h>
#include <string.h>
@@ -293,7 +293,7 @@ cache_op_table (Dwarf *dbg, int sec_index, Dwarf_Off macoff,
Dwarf_Die *cudie)
{
Dwarf_Macro_Op_Table fake = { .offset = macoff, .sec_index = sec_index };
- Dwarf_Macro_Op_Table **found = tfind (&fake, &dbg->macro_ops,
+ Dwarf_Macro_Op_Table **found = eu_tfind (&fake, &dbg->macro_ops,
macro_op_compare);
if (found != NULL)
return *found;
@@ -305,7 +305,7 @@ cache_op_table (Dwarf *dbg, int sec_index, Dwarf_Off macoff,
if (table == NULL)
return NULL;
- Dwarf_Macro_Op_Table **ret = tsearch (table, &dbg->macro_ops,
+ Dwarf_Macro_Op_Table **ret = eu_tsearch (table, &dbg->macro_ops,
macro_op_compare);
if (unlikely (ret == NULL))
{
@@ -33,7 +33,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <search.h>
+#include <eu-search.h>
#include "dwarf.h"
#include "libdwP.h"
@@ -1138,7 +1138,7 @@ __libdw_getsrclines (Dwarf *dbg, Dwarf_Off debug_line_offset,
Dwarf_Lines **linesp, Dwarf_Files **filesp)
{
struct files_lines_s fake = { .debug_line_offset = debug_line_offset };
- struct files_lines_s **found = tfind (&fake, &dbg->files_lines,
+ struct files_lines_s **found = eu_tfind (&fake, &dbg->files_lines,
files_lines_compare);
if (found == NULL)
{
@@ -1160,7 +1160,7 @@ __libdw_getsrclines (Dwarf *dbg, Dwarf_Off debug_line_offset,
node->debug_line_offset = debug_line_offset;
- found = tsearch (node, &dbg->files_lines, files_lines_compare);
+ found = eu_tsearch (node, &dbg->files_lines, files_lines_compare);
if (found == NULL)
{
__libdw_seterrno (DWARF_E_NOMEM);
@@ -31,7 +31,7 @@
#endif
#include "cfi.h"
-#include <search.h>
+#include <eu-search.h>
#include <stdlib.h>
#include "encoded-value.h"
@@ -122,7 +122,7 @@ intern_fde (Dwarf_CFI *cache, const Dwarf_FDE *entry)
fde->instructions += cie->fde_augmentation_data_size;
/* Add the new entry to the search tree. */
- struct dwarf_fde **tres = tsearch (fde, &cache->fde_tree, &compare_fde);
+ struct dwarf_fde **tres = eu_tsearch (fde, &cache->fde_tree, &compare_fde);
if (tres == NULL)
{
free (fde);
@@ -252,7 +252,7 @@ __libdw_find_fde (Dwarf_CFI *cache, Dwarf_Addr address)
/* Look for a cached FDE covering this address. */
const struct dwarf_fde fde_key = { .start = address, .end = 0 };
- struct dwarf_fde **found = tfind (&fde_key, &cache->fde_tree, &compare_fde);
+ struct dwarf_fde **found = eu_tfind (&fde_key, &cache->fde_tree, &compare_fde);
if (found != NULL)
return *found;
@@ -33,7 +33,7 @@
#include "libdwflP.h"
#include "libdwP.h"
#include "memory-access.h"
-#include <search.h>
+#include <eu-search.h>
static inline Dwarf_Arange *
@@ -198,7 +198,7 @@ intern_cu (Dwfl_Module *mod, Dwarf_Off cuoff, struct dwfl_cu **result)
struct dwfl_cu key;
key.die.cu = die->cu;
- struct dwfl_cu **found = tsearch (&key, &mod->lazy_cu_root, &compare_cukey);
+ struct dwfl_cu **found = eu_tsearch (&key, &mod->lazy_cu_root, &compare_cukey);
if (unlikely (found == NULL))
return DWFL_E_NOMEM;