Quote:
Originally Posted by hansel
Antartica: any idea why ltrace doesn't work? I Tried several versions... They all fail with 'unexpected events' and stack overflows... :-(
|
Same here; tried several versions and none of the worked. I don't have any idea of the reason of failing to work as I don't know how it does its magic.
Personally, the method I would use to do it would be examining the list of shared libraries,creating .so with stubs but with a trace prior to calling the "real" function the original library and load that .so with LD_LIBRARY_PRELOAD. But it seems that ltrace is far more smart that the method I supposed (it patches the elf in memory, it seems), so...
I've just found this link about the internals of ltrace:
http://people.redhat.com/~pmachata/r...ace-works.html
Browsing the document, it says that ltrace uses the debugging facilities of the system (it's a special-purpose gdb)... perhaps there is a problem placing breakpoints :-?.