• Home
  • Raw
  • Download

Lines Matching refs:result

76 scn_dwarf_type (Dwarf *result, size_t shstrndx, Elf_Scn *scn)  in scn_dwarf_type()  argument
83 const char *scnname = elf_strptr (result->elf, shstrndx, in scn_dwarf_type()
101 check_section (Dwarf *result, size_t shstrndx, Elf_Scn *scn, bool inscngrp) in check_section() argument
117 return result; in check_section()
126 return result; in check_section()
131 const char *scnname = elf_strptr (result->elf, shstrndx, in check_section()
138 Dwarf_Sig8_Hash_free (&result->sig8_hash); in check_section()
140 free (result); in check_section()
162 if (result->type == TYPE_PLAIN) in check_section()
165 else if (result->type == TYPE_DWO) in check_section()
178 if (result->type == TYPE_PLAIN) in check_section()
184 else if (result->type <= TYPE_DWO) in check_section()
194 if (result->type == TYPE_GNU_LTO) in check_section()
201 return result; in check_section()
203 if (unlikely (result->sectiondata[cnt] != NULL)) in check_section()
205 return result; in check_section()
219 return result; in check_section()
230 return result; in check_section()
233 result->sectiondata[cnt] = data; in check_section()
235 return result; in check_section()
261 valid_p (Dwarf *result) in valid_p() argument
267 if (likely (result != NULL) in valid_p()
268 && unlikely (result->sectiondata[IDX_debug_info] == NULL in valid_p()
269 && result->sectiondata[IDX_debug_line] == NULL in valid_p()
270 && result->sectiondata[IDX_debug_frame] == NULL)) in valid_p()
272 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
274 free (result); in valid_p()
275 result = NULL; in valid_p()
281 if (result != NULL) in valid_p()
284 if (gelf_getehdr (result->elf, &ehdr) == NULL) in valid_p()
286 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
288 free (result); in valid_p()
289 result = NULL; in valid_p()
298 if (result != NULL && result->sectiondata[IDX_debug_loc] != NULL) in valid_p()
300 result->fake_loc_cu = malloc (sizeof (Dwarf_CU)); in valid_p()
301 if (unlikely (result->fake_loc_cu == NULL)) in valid_p()
303 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
305 free (result); in valid_p()
306 result = NULL; in valid_p()
310 result->fake_loc_cu->sec_idx = IDX_debug_loc; in valid_p()
311 result->fake_loc_cu->dbg = result; in valid_p()
312 result->fake_loc_cu->startp in valid_p()
313 = result->sectiondata[IDX_debug_loc]->d_buf; in valid_p()
314 result->fake_loc_cu->endp in valid_p()
315 = (result->sectiondata[IDX_debug_loc]->d_buf in valid_p()
316 + result->sectiondata[IDX_debug_loc]->d_size); in valid_p()
317 result->fake_loc_cu->locs = NULL; in valid_p()
318 result->fake_loc_cu->address_size = elf_addr_size; in valid_p()
319 result->fake_loc_cu->offset_size = 4; in valid_p()
320 result->fake_loc_cu->version = 4; in valid_p()
321 result->fake_loc_cu->split = NULL; in valid_p()
325 if (result != NULL && result->sectiondata[IDX_debug_loclists] != NULL) in valid_p()
327 result->fake_loclists_cu = malloc (sizeof (Dwarf_CU)); in valid_p()
328 if (unlikely (result->fake_loclists_cu == NULL)) in valid_p()
330 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
332 free (result->fake_loc_cu); in valid_p()
333 free (result); in valid_p()
334 result = NULL; in valid_p()
338 result->fake_loclists_cu->sec_idx = IDX_debug_loclists; in valid_p()
339 result->fake_loclists_cu->dbg = result; in valid_p()
340 result->fake_loclists_cu->startp in valid_p()
341 = result->sectiondata[IDX_debug_loclists]->d_buf; in valid_p()
342 result->fake_loclists_cu->endp in valid_p()
343 = (result->sectiondata[IDX_debug_loclists]->d_buf in valid_p()
344 + result->sectiondata[IDX_debug_loclists]->d_size); in valid_p()
345 result->fake_loclists_cu->locs = NULL; in valid_p()
346 result->fake_loclists_cu->address_size = elf_addr_size; in valid_p()
347 result->fake_loclists_cu->offset_size = 4; in valid_p()
348 result->fake_loclists_cu->version = 5; in valid_p()
349 result->fake_loclists_cu->split = NULL; in valid_p()
357 if (result != NULL && result->sectiondata[IDX_debug_addr] != NULL) in valid_p()
359 result->fake_addr_cu = malloc (sizeof (Dwarf_CU)); in valid_p()
360 if (unlikely (result->fake_addr_cu == NULL)) in valid_p()
362 Dwarf_Sig8_Hash_free (&result->sig8_hash); in valid_p()
364 free (result->fake_loc_cu); in valid_p()
365 free (result->fake_loclists_cu); in valid_p()
366 free (result); in valid_p()
367 result = NULL; in valid_p()
371 result->fake_addr_cu->sec_idx = IDX_debug_addr; in valid_p()
372 result->fake_addr_cu->dbg = result; in valid_p()
373 result->fake_addr_cu->startp in valid_p()
374 = result->sectiondata[IDX_debug_addr]->d_buf; in valid_p()
375 result->fake_addr_cu->endp in valid_p()
376 = (result->sectiondata[IDX_debug_addr]->d_buf in valid_p()
377 + result->sectiondata[IDX_debug_addr]->d_size); in valid_p()
378 result->fake_addr_cu->locs = NULL; in valid_p()
379 result->fake_addr_cu->address_size = elf_addr_size; in valid_p()
380 result->fake_addr_cu->offset_size = 4; in valid_p()
381 result->fake_addr_cu->version = 5; in valid_p()
382 result->fake_addr_cu->split = NULL; in valid_p()
386 if (result != NULL) in valid_p()
387 result->debugdir = __libdw_debugdir (result->elf->fildes); in valid_p()
389 return result; in valid_p()
394 global_read (Dwarf *result, Elf *elf, size_t shstrndx) in global_read() argument
400 while ((scn = elf_nextscn (elf, scn)) != NULL && result->type != TYPE_PLAIN) in global_read()
402 enum dwarf_type type = scn_dwarf_type (result, shstrndx, scn); in global_read()
403 if (type > result->type) in global_read()
404 result->type = type; in global_read()
408 while (result != NULL && (scn = elf_nextscn (elf, scn)) != NULL) in global_read()
409 result = check_section (result, shstrndx, scn, false); in global_read()
411 return valid_p (result); in global_read()
416 scngrp_read (Dwarf *result, Elf *elf, size_t shstrndx, Elf_Scn *scngrp) in scngrp_read() argument
422 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
424 free (result); in scngrp_read()
431 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
433 free (result); in scngrp_read()
443 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
444 free (result); in scngrp_read()
462 Dwarf_Sig8_Hash_free (&result->sig8_hash); in scngrp_read()
464 free (result); in scngrp_read()
468 enum dwarf_type type = scn_dwarf_type (result, shstrndx, scn); in scngrp_read()
469 if (type > result->type) in scngrp_read()
470 result->type = type; in scngrp_read()
473 for (cnt = 1; cnt * sizeof (Elf32_Word) <= data->d_size && result != NULL; ++cnt) in scngrp_read()
477 result = check_section (result, shstrndx, scn, true); in scngrp_read()
478 if (result == NULL) in scngrp_read()
482 return valid_p (result); in scngrp_read()
511 Dwarf *result = calloc (1, sizeof (Dwarf)); in dwarf_begin_elf() local
512 if (unlikely (result == NULL) in dwarf_begin_elf()
513 || unlikely (Dwarf_Sig8_Hash_init (&result->sig8_hash, 11) < 0)) in dwarf_begin_elf()
515 free (result); in dwarf_begin_elf()
523 result->other_byte_order = true; in dwarf_begin_elf()
525 result->elf = elf; in dwarf_begin_elf()
526 result->alt_fd = -1; in dwarf_begin_elf()
530 result->mem_default_size = mem_default_size; in dwarf_begin_elf()
531 result->oom_handler = __libdw_oom; in dwarf_begin_elf()
532 if (pthread_rwlock_init(&result->mem_rwl, NULL) != 0) in dwarf_begin_elf()
534 free (result); in dwarf_begin_elf()
538 result->mem_stacks = 0; in dwarf_begin_elf()
539 result->mem_tails = NULL; in dwarf_begin_elf()
548 Dwarf_Sig8_Hash_free (&result->sig8_hash); in dwarf_begin_elf()
550 free (result); in dwarf_begin_elf()
560 return global_read (result, elf, shstrndx); in dwarf_begin_elf()
562 return scngrp_read (result, elf, shstrndx, scngrp); in dwarf_begin_elf()
566 Dwarf_Sig8_Hash_free (&result->sig8_hash); in dwarf_begin_elf()
568 free (result); in dwarf_begin_elf()
572 Dwarf_Sig8_Hash_free (&result->sig8_hash); in dwarf_begin_elf()
574 free (result); in dwarf_begin_elf()