Lines Matching refs:result
74 check_section (Dwarf *result, size_t shstrndx, Elf_Scn *scn, bool inscngrp) in check_section() argument
90 return result; in check_section()
99 return result; in check_section()
104 const char *scnname = elf_strptr (result->elf, shstrndx, in check_section()
111 Dwarf_Sig8_Hash_free (&result->sig8_hash); in check_section()
113 free (result); in check_section()
144 return result; in check_section()
146 if (unlikely (result->sectiondata[cnt] != NULL)) in check_section()
148 return result; in check_section()
162 return result; in check_section()
173 return result; in check_section()
176 result->sectiondata[cnt] = data; in check_section()
178 return result; in check_section()
204 valid_p (Dwarf *result) in valid_p() argument
210 if (likely (result != NULL) in valid_p()
211 && unlikely (result->sectiondata[IDX_debug_info] == NULL in valid_p()
212 && result->sectiondata[IDX_debug_line] == NULL in valid_p()
213 && result->sectiondata[IDX_debug_frame] == NULL)) in valid_p()
215 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
217 free (result); in valid_p()
218 result = NULL; in valid_p()
224 if (result != NULL && result->sectiondata[IDX_debug_loc] != NULL) in valid_p()
226 result->fake_loc_cu = (Dwarf_CU *) calloc (1, sizeof (Dwarf_CU)); in valid_p()
227 if (unlikely (result->fake_loc_cu == NULL)) in valid_p()
229 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
231 free (result); in valid_p()
232 result = NULL; in valid_p()
236 result->fake_loc_cu->sec_idx = IDX_debug_loc; in valid_p()
237 result->fake_loc_cu->dbg = result; in valid_p()
238 result->fake_loc_cu->startp in valid_p()
239 = result->sectiondata[IDX_debug_loc]->d_buf; in valid_p()
240 result->fake_loc_cu->endp in valid_p()
241 = (result->sectiondata[IDX_debug_loc]->d_buf in valid_p()
242 + result->sectiondata[IDX_debug_loc]->d_size); in valid_p()
246 if (result != NULL && result->sectiondata[IDX_debug_loclists] != NULL) in valid_p()
248 result->fake_loclists_cu = (Dwarf_CU *) calloc (1, sizeof (Dwarf_CU)); in valid_p()
249 if (unlikely (result->fake_loclists_cu == NULL)) in valid_p()
251 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
253 free (result->fake_loc_cu); in valid_p()
254 free (result); in valid_p()
255 result = NULL; in valid_p()
259 result->fake_loclists_cu->sec_idx = IDX_debug_loclists; in valid_p()
260 result->fake_loclists_cu->dbg = result; in valid_p()
261 result->fake_loclists_cu->startp in valid_p()
262 = result->sectiondata[IDX_debug_loclists]->d_buf; in valid_p()
263 result->fake_loclists_cu->endp in valid_p()
264 = (result->sectiondata[IDX_debug_loclists]->d_buf in valid_p()
265 + result->sectiondata[IDX_debug_loclists]->d_size); in valid_p()
273 if (result != NULL && result->sectiondata[IDX_debug_addr] != NULL) in valid_p()
275 result->fake_addr_cu = (Dwarf_CU *) calloc (1, sizeof (Dwarf_CU)); in valid_p()
276 if (unlikely (result->fake_addr_cu == NULL)) in valid_p()
278 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
280 free (result->fake_loc_cu); in valid_p()
281 free (result->fake_loclists_cu); in valid_p()
282 free (result); in valid_p()
283 result = NULL; in valid_p()
287 result->fake_addr_cu->sec_idx = IDX_debug_addr; in valid_p()
288 result->fake_addr_cu->dbg = result; in valid_p()
289 result->fake_addr_cu->startp in valid_p()
290 = result->sectiondata[IDX_debug_addr]->d_buf; in valid_p()
291 result->fake_addr_cu->endp in valid_p()
292 = (result->sectiondata[IDX_debug_addr]->d_buf in valid_p()
293 + result->sectiondata[IDX_debug_addr]->d_size); in valid_p()
297 if (result != NULL) in valid_p()
298 result->debugdir = __libdw_debugdir (result->elf->fildes); in valid_p()
300 return result; in valid_p()
305 global_read (Dwarf *result, Elf *elf, size_t shstrndx) in global_read() argument
309 while (result != NULL && (scn = elf_nextscn (elf, scn)) != NULL) in global_read()
310 result = check_section (result, shstrndx, scn, false); in global_read()
312 return valid_p (result); in global_read()
317 scngrp_read (Dwarf *result, Elf *elf, size_t shstrndx, Elf_Scn *scngrp) in scngrp_read() argument
323 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
325 free (result); in scngrp_read()
332 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
334 free (result); in scngrp_read()
344 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
345 free (result); in scngrp_read()
360 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
362 free (result); in scngrp_read()
366 result = check_section (result, shstrndx, scn, true); in scngrp_read()
367 if (result == NULL) in scngrp_read()
371 return valid_p (result); in scngrp_read()
400 Dwarf *result = (Dwarf *) calloc (1, sizeof (Dwarf) + mem_default_size); in dwarf_begin_elf() local
401 if (unlikely (result == NULL) in dwarf_begin_elf()
402 || unlikely (Dwarf_Sig8_Hash_init (&result->sig8_hash, 11) < 0)) in dwarf_begin_elf()
404 free (result); in dwarf_begin_elf()
412 result->other_byte_order = true; in dwarf_begin_elf()
414 result->elf = elf; in dwarf_begin_elf()
415 result->alt_fd = -1; in dwarf_begin_elf()
418 result->mem_default_size = mem_default_size; in dwarf_begin_elf()
419 result->oom_handler = __libdw_oom; in dwarf_begin_elf()
420 result->mem_tail = (struct libdw_memblock *) (result + 1); in dwarf_begin_elf()
421 result->mem_tail->size = (result->mem_default_size in dwarf_begin_elf()
423 result->mem_tail->remaining = result->mem_tail->size; in dwarf_begin_elf()
424 result->mem_tail->prev = NULL; in dwarf_begin_elf()
433 Dwarf_Sig8_Hash_free (&result->sig8_hash); in dwarf_begin_elf()
435 free (result); in dwarf_begin_elf()
445 return global_read (result, elf, shstrndx); in dwarf_begin_elf()
447 return scngrp_read (result, elf, shstrndx, scngrp); in dwarf_begin_elf()
451 Dwarf_Sig8_Hash_free (&result->sig8_hash); in dwarf_begin_elf()
453 free (result); in dwarf_begin_elf()
457 Dwarf_Sig8_Hash_free (&result->sig8_hash); in dwarf_begin_elf()
459 free (result); in dwarf_begin_elf()