callgraph: teach callgraph to use alternative symbol roots

This allows us to have a sysroot different than /, so that we can resolve
symbols that are not necessarily installed on the system. For example, if
we are running an application in an alternate mount namespace, we will want
to resolve the symbols starting from the location of the checkout for that
namespace.

Generally alternate mount namespaces will have paths like "/newroot/usr/.."
so by setting the source to "/newroot/usr/" to "~/.local/" you can do
some fancy remapping.
This commit is contained in:
Christian Hergert
2017-02-25 19:34:58 -08:00
parent 9839869d98
commit 222d0ad53f
4 changed files with 114 additions and 10 deletions

View File

@ -27,7 +27,9 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (SpElfSymbolResolver, sp_elf_symbol_resolver, SP, ELF_SYMBOL_RESOLVER, GObject)
SpSymbolResolver *sp_elf_symbol_resolver_new (void);
SpSymbolResolver *sp_elf_symbol_resolver_new (void);
void sp_elf_symbol_resolver_set_symbol_dirs (SpElfSymbolResolver *self,
GHashTable *symbol_dirs);
G_END_DECLS