forked from osandov/drgn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ctf: Allow searching all modules for types
The CTF type finder has previously used the "filename" parameter to indicate the kernel module in which a type should be searched. However, the default was to search vmlinux, which excluded all the types from modules. Normally in drgn, looking up a type by name would search for types from the vmlinux and modules. To make this behave correctly, factor out the basic logic of searching a CTF dictionary for a type with a given name into drgn_ctf_lookup_by_name(). Then, create a new helper drgn_ctf_find_type_name_all_dicts() which has the correct logic to be used in the case that no filename/module is specified: 1. Search vmlinux 2. Search modules Note that osandov#2 could still be improved. CTF contains type data for all modules, but ideally we would only search dictionaries related to modules which are actually loaded. We could also probably improve performance by using a cache for the most-recently-used CTF dict. With these two helpers, we can overhaul the CTF type finder's logic: when filename is provided, search just that module. Otherwise, use the all-modules logic described above. Signed-off-by: Stephen Brennan <[email protected]>
- Loading branch information
Showing
2 changed files
with
91 additions
and
18 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