HomeFreeBSD

MFC addr2line label checks when DW_AT_range and DW_AT_low_pc cannot be used

Description

MFC addr2line label checks when DW_AT_range and DW_AT_low_pc cannot be used

addr2line: swap if conditions for diff reduction in upcoming change

No functional change intended.

(cherry picked from commit 65c207758a9586116a023dea8eb3d173e85cb0a9)

addr2line: add label checks when DW_AT_range and DW_AT_low_pc cannot be used

Check label's ranges for address we want to translate if a CU doesn't
have usable DW_AT_range or DW_AT_low_pc.

Use more appropriate names: "struct CU" -> "struct range"

Developed as part of upstream ELF Tool Chain bug report
https://sourceforge.net/p/elftoolchain/tickets/552/ although this does
not address the specific case reported there.

Submitted by: Tiger Gao <tig@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation
Differential Revision: D23782

(cherry picked from commit a36179937e7e768d1840896ac1ea13ba6f118a09)

addr2line: rework check_range conditions

Simplify logic and reduce indentation for DW_AT_low_pc case.

Reviewed by: Tiger Gao, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: D27426

(cherry picked from commit f4d6ed9a5c5f5e78b9e20ae0c4b3ab78922aaf20)

addr2line: fix allocation leak in error path

CID: 1437677
Reported by: Coverity Scan
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 67b94fc58e61a78225930d54eadaba77f46a73b7)

Details

Provenance
emasteAuthored on Nov 19 2020, 9:10 PM
Reviewer
markj
Differential Revision
D23782: addr2line: add label checks when DW_AT_range and DW_AT_low_pc cannot be used
Parents
rGce87312019a1: MFC: contrib/tzdata: import tzdata 2020f
Branches
Unknown
Tags
Unknown