Returns a spec DIE linked to the passed one. The caller should deallocate the DIE
| 2679 | // Returns a spec DIE linked to the passed one. The caller should |
| 2680 | // deallocate the DIE |
| 2681 | static Dwarf_Die get_spec_die(dwarf_fileobject& fobj, Dwarf_Die die) |
| 2682 | { |
| 2683 | Dwarf_Debug dwarf = fobj.dwarf_handle.get(); |
| 2684 | Dwarf_Error error = DW_DLE_NE; |
| 2685 | Dwarf_Off die_offset; |
| 2686 | if (fobj.current_cu && dwarf_die_CU_offset(die, &die_offset, &error) == DW_DLV_OK) { |
| 2687 | die_specmap_t::iterator it = fobj.current_cu->spec_section.find(die_offset); |
| 2688 | |
| 2689 | // If we have a DIE that completes the current one, check if |
| 2690 | // that one has the pc we are looking for |
| 2691 | if (it != fobj.current_cu->spec_section.end()) { |
| 2692 | Dwarf_Die spec_die = 0; |
| 2693 | if (dwarf_offdie(dwarf, it->second, &spec_die, &error) == DW_DLV_OK) { |
| 2694 | return spec_die; |
| 2695 | } |
| 2696 | } |
| 2697 | } |
| 2698 | |
| 2699 | // Maybe we have an abstract origin DIE with the function information? |
| 2700 | return get_referenced_die(fobj.dwarf_handle.get(), die, DW_AT_abstract_origin, true); |
| 2701 | } |
| 2702 | |
| 2703 | static bool die_has_pc(dwarf_fileobject& fobj, Dwarf_Die die, Dwarf_Addr pc) |
| 2704 | { |
no test coverage detected