summaryrefslogtreecommitdiff
path: root/library.c
AgeCommit message (Collapse)AuthorFilesLines
2014-08-22minor whitespace-only style fixDima Kogan1-2/+2
2014-08-22Copy struct library.should_activate_latent on clonePetr Machata1-0/+1
- I don't think it makes actual difference, as the only consumer of this symbol is proc_add_library, and that's not called from proc_clone (the clone is done by directly iterating the library list). But the code is more obviously right this way.
2014-08-22Fix cloning of libraries with Dwarf supportPetr Machata1-1/+9
- struct library::dwfl_module was left unitialized after library_clone. Garbage was kept in, which prevented proper initialization later, and resulted in segmentation violation.
2014-08-22I now always build the export listDima Kogan1-0/+1
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
2014-08-22un-consted some variables to build with older (<= gcc-4.6) compilersDima Kogan1-5/+5
2014-08-22Made activate_latent_in() iterations much more efficientDima Kogan1-28/+9
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.
2014-08-22library_exported_names_each_alias(), library_exported_names_each() now ↵Dima Kogan1-30/+21
restartable These function now takes a *start_after, and return a pointer to the first failing key, like the other ltrace iterators
2014-08-22added forgotten free(), forgotten returnDima Kogan1-1/+4
2014-08-22clarified some int return code checkingDima Kogan1-6/+6
2014-08-22whitespace 'if(' -> 'if ('Dima Kogan1-14/+14
2014-08-22renamed _dtor_* and _clone_* functions to remove the leading _Dima Kogan1-9/+9
2014-08-22We now use known prototypes for all aliased symbols (same address)Dima Kogan1-30/+211
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
2014-08-22Making sure to not double-examine the same DWARF CUDima Kogan1-1/+1
2014-08-22moved DWARF prototype reading to library_get_prototype()Dima Kogan1-0/+4
2014-08-22Imported Upstream version 0.7.91upstream/0.7.91upstreamChanho Park1-44/+119
2013-01-15Imported Upstream version 0.7.2upstream/0.7.2Anas Nashif1-0/+428