-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hook up GNU debug link support to DwarfResolver
This change adds debug link support to our DwarfResolver. Specifically, when a DwarfResolver is created, we check whether the opened file contains a debug link. If so, we try to find the target file it represents in a list of known directories and then load the DWARF information from there. If none of the directories contains the file, the debug link will be silently ignored. The reason for this behavior is that many distributions seem to distribute binaries with debug links in them, but then make the linked debug information optional by having it contained in a dedicated package. There are many locations at which this functionality could fit it. Considered candidates are: 1) ElfResolverData::elf_resolver(), 2) ElfResolver itself, and 3) DwarfResolver (the approach taken). 1) is somewhat nice because it keep the existing resolver simple and to the point. However, it is insufficient, because we expose ElfResolver publicly and we most certainly want to enable debug link support for users. Implementation inside ElfResolver is possible, but it seems inferior to putting everything into DwarfResolver: we only intend to follow debug links if DWARF support is enabled and eventually we could consider checking both the original ELF file as well as the linkee ELF file as fallback options when no symbol is found. As such, DwarfResolver seems like the most apt location. Refs: #60 Signed-off-by: Daniel Müller <[email protected]>
- Loading branch information
1 parent
6f42787
commit 4249bb7
Showing
4 changed files
with
221 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters