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