Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Previously I only built the export list when tracing with -l. Since I was using
this export list to resolve aliased symbols in addition to setting breakpoints,
this aliased symbol resolution was only working with -l. I now always build the
export list to make aliased symbol resolution always work.
I now have a separate variable to control whether we should activate latent
symbols or not; previously the existence of the export list was used to make
this determination.
Furthermore populate_this_symtab() now takes an extra argument to indicate that
ONLY the export list should be filled in
|
|
|
|
Previously activate_latent_in() iterations looked like
for(export names in lib1) // hash table iteration
{
for(symbol names in lib2) // list iteration
{
if(names equal && libsym->latent)
{
proc_activate_latent_symbol(proc, libsym)
}
}
}
This is inefficient both due to the double iteration but also since iterating
over a hash table in slow (have to look through all cells, even empty ones).
This patch turns this logic into
for(symbol names in lib2) // list iteration
{
if(name in lib1 export names && libsym->latent) // hash table lookup
{
proc_activate_latent_symbol(proc, libsym)
}
}
So there's no more double iteration, and the hash iteration was turned into a
hash lookup. Much better.
|
|
|
|
restartable
These function now takes a *start_after, and return a pointer to the first
failing key, like the other ltrace iterators
|
|
Some libraries have multiple names for the same function. Prior to this patch,
it was possible to define a prototype for a symbol, and not have ltrace use it
because it saw a different symbol be called. libc is a common source of this.
For instance (on my amd64 Debian box) it defines the nanosleep symbol as both
'nanosleep' and '__GI___nanosleep', at the same address. If a calling library
calls '__GI___nanosleep', then an ltrace prototype for 'nanosleep' would not be
used, even though it should apply to this call
|
|
|
|
|
|
|
|
|