-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge SymResolver::find_code_info() into SymResolver::find_sym()
The SymResolver trait contains two methods used to fulfill symbolization requests: find_sym() unearths basic information about the symbol such as its name, address, and size, and find_code_info() reports additional source code level information, if present. This split is rather arbitrary and it can be the cause of inefficiencies. Specifically, source code information may be co-located with symbol information and by having this two-way split we may need to perform the same lookup twice. This is obviously the case already in the Breakpad resolver, but it is actually also happening in a more convoluted way in the DWARF logic. The only conceivable reason why such a split may have been desired in the past in the first place, is to "refine" symbol information from one source with that of another. For example, for kernel symbols one may use kallsyms to report the symbol name, but then look at a potential DWARF file for reporting source code information. While a valid use case, it is niche and generally not all that necessary: if one were to fall back to using *only* DWARF, there should be no issue in practice. This arbitrary split also means that we need to stitch together the final Sym object based on some IntSym and an optional AddrCodeInfo, which requires the existence of those internal types in the first place. This change merges these two methods into one. It does so in the dumbest way possible: just adjusting the signature of find_sym() and then reusing find_code_info() internally. This is making for some complex logic, but this will get simplified down the line. Note that, while conceptually a refactoring, this change introduces a slight semantic change to the kernel resolver: where previously it may consult two "resolvers" and stitch the result together, it now only ever consults a single resolver. Signed-off-by: Daniel Müller <[email protected]>
- Loading branch information
1 parent
6b434a2
commit 7ee10af
Showing
9 changed files
with
166 additions
and
122 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
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
Oops, something went wrong.