Lines Matching refs:mod
57 dwar (Dwfl_Module *mod, unsigned int idx)
59 return &mod->dw->aranges->info[mod->aranges[idx].arange];
64 addrarange (Dwfl_Module *mod, Dwarf_Addr addr, struct dwfl_arange **arange)
66 if (mod->aranges == NULL)
71 if (INTUSE(dwarf_getaranges) (mod->dw, &dwaranges, &naranges) != 0)
102 mod->naranges = naranges;
103 mod->aranges = (realloc (aranges, naranges * sizeof aranges[0])
105 mod->lazycu += naranges;
109 addr -= mod->debug.bias;
112 size_t l = 0, u = mod->naranges;
116 Dwarf_Addr start = dwar (mod, idx)->addr;
124 if (idx + 1 < mod->naranges)
126 if (addr >= dwar (mod, idx + 1)->addr)
136 = &mod->dw->aranges->info[mod->dw->aranges->naranges - 1];
142 *arange = &mod->aranges[idx];
157 assert (cu->mod->lazycu == 0);
162 less_lazy (Dwfl_Module *mod)
164 if (--mod->lazycu > 0)
168 tdestroy (mod->lazy_cu_root, nofree);
169 mod->lazy_cu_root = NULL;
186 intern_cu (Dwfl_Module *mod, Dwarf_Off cuoff, struct dwfl_cu **result)
193 struct dwfl_cu **found = tsearch (&key, &mod->lazy_cu_root, &compare_cukey);
199 if (unlikely (cuoff + 4 >= mod->dw->sectiondata[IDX_debug_info]->d_size))
202 One increment in MOD->lazycu counts not having hit EOF yet. */
204 less_lazy (mod);
216 cu->mod = mod;
221 Dwarf_Die *die = INTUSE(dwarf_offdie) (mod->dw, cuoff, &cu->die);
226 struct dwfl_cu **newvec = realloc (mod->cu, ((mod->ncu + 1)
227 * sizeof (mod->cu[0])));
233 mod->cu = newvec;
235 mod->cu[mod->ncu++] = cu;
237 mod->first_cu = cu;
252 __libdwfl_nextcu (Dwfl_Module *mod, struct dwfl_cu *lastcu,
262 nextp = &mod->first_cu;
275 int end = INTUSE(dwarf_nextcu) (mod->dw, cuoff, &nextoff, &cuhdrsz,
285 Dwfl_Error result = intern_cu (mod, cuoff + cuhdrsz, nextp);
301 arangecu (Dwfl_Module *mod, struct dwfl_arange *arange, struct dwfl_cu **cu)
305 const Dwarf_Arange *dwarange = &mod->dw->aranges->info[arange->arange];
306 Dwfl_Error result = intern_cu (mod, dwarange->offset, &arange->cu);
310 less_lazy (mod); /* Each arange with null ->cu counts once. */
319 __libdwfl_addrcu (Dwfl_Module *mod, Dwarf_Addr addr, struct dwfl_cu **cu)
322 return addrarange (mod, addr, &arange) ?: arangecu (mod, arange, cu);