int dwarf_type_cu_offset(Dwarf_Type type_in, Dwarf_Off * ret_offset, Dwarf_Error * error) { Dwarf_Global type = (Dwarf_Global) type_in; return dwarf_global_cu_offset(type, ret_offset, error); }
int dwarf_weak_cu_offset(Dwarf_Weak weak_in, Dwarf_Off * weak_off, Dwarf_Error * error) { Dwarf_Global weak = (Dwarf_Global) weak_in; return dwarf_global_cu_offset(weak, weak_off, error); }
int dwarf_var_cu_offset(Dwarf_Var var_in, Dwarf_Off * returned_offset, Dwarf_Error * error) { Dwarf_Global var = (Dwarf_Global) var_in; return dwarf_global_cu_offset(var, returned_offset, error); }
int dwarf_func_cu_offset(Dwarf_Func func_in, Dwarf_Off * return_offset, Dwarf_Error * error) { Dwarf_Global func = (Dwarf_Global) func_in; return dwarf_global_cu_offset(func, return_offset, error); }
/* Get all the data in .debug_pubnames */ void print_pubnames(Dwarf_Debug dbg) { Dwarf_Global *globbuf = NULL; Dwarf_Signed count = 0; Dwarf_Signed i = 0; Dwarf_Off die_off = 0; Dwarf_Off cu_off = 0; /* Offset to previous CU */ Dwarf_Off prev_cu_off = elf_max_address; char *name = 0; int res = 0; current_section_id = DEBUG_PUBNAMES; if (do_print_dwarf) { printf("\n.debug_pubnames\n"); } res = dwarf_get_globals(dbg, &globbuf, &count, &err); if (res == DW_DLV_ERROR) { print_error(dbg, "dwarf_get_globals", res, err); } else if (res == DW_DLV_NO_ENTRY) { /* (err == 0 && count == DW_DLV_NOCOUNT) means there are no pubnames. */ } else { Dwarf_Unsigned maxoff = get_info_max_offset(dbg); for (i = 0; i < count; i++) { int nres = 0; int cures3 = 0; Dwarf_Off global_cu_off = 0; nres = dwarf_global_name_offsets(globbuf[i], &name, &die_off, &cu_off, &err); deal_with_name_offset_err(dbg, "dwarf_global_name_offsets", name, die_off, nres, err); cures3 = dwarf_global_cu_offset(globbuf[i], &global_cu_off, &err); if (cures3 != DW_DLV_OK) { print_error(dbg, "dwarf_global_cu_offset", cures3, err); } if (check_pubname_attr) { Dwarf_Bool has_attr; int ares; int dres; Dwarf_Die die; /* We are processing a new set of pubnames for a different CU; get the producer ID, at 'cu_off' to see if we need to skip these pubnames */ if (cu_off != prev_cu_off) { /* Record offset for previous CU */ prev_cu_off = cu_off; dres = dwarf_offdie(dbg, cu_off, &die, &err); if (dres != DW_DLV_OK) { print_error(dbg, "print pubnames: dwarf_offdie a", dres,err); } { /* Get producer name for this CU and update compiler list */ struct esb_s producername; esb_constructor(&producername); get_producer_name(dbg,die,err,&producername); update_compiler_target(esb_get_string(&producername)); esb_destructor(&producername); } dwarf_dealloc(dbg, die, DW_DLA_DIE); } /* get die at die_off */ dres = dwarf_offdie(dbg, die_off, &die, &err); if (dres != DW_DLV_OK) { print_error(dbg, "print pubnames: dwarf_offdie b", dres, err); } ares = dwarf_hasattr(die, DW_AT_external, &has_attr, &err); if (ares == DW_DLV_ERROR) { print_error(dbg, "hassattr on DW_AT_external", ares, err); } /* Check for specific compiler */ if (checking_this_compiler()) { DWARF_CHECK_COUNT(pubname_attr_result,1); if (ares == DW_DLV_OK && has_attr) { /* Should the value of flag be examined? */ } else { DWARF_CHECK_ERROR2(pubname_attr_result,name, "pubname does not have DW_AT_external"); } } dwarf_dealloc(dbg, die, DW_DLA_DIE); } /* Now print pubname, after the test */ if (do_print_dwarf || (record_dwarf_error && check_verbose_mode)) { print_pubname_style_entry(dbg, "global", name, die_off, cu_off, global_cu_off, maxoff); record_dwarf_error = FALSE; /* Clear error condition */ } } dwarf_globals_dealloc(dbg, globbuf, count); } } /* print_pubnames() */