[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] Bug fixes in libunwind git = make another "release

From: Lassi Tuura
Subject: Re: [Libunwind-devel] Bug fixes in libunwind git = make another "release"?
Date: Tue, 22 Mar 2011 00:00:30 +0100


>>> 1. On many distributions, _dl_debug_state compiles to a single 'ret'.
>> For us it happens not to be an issue. Our profiler has limited ability to
>> rewrite code on the fly, so as long as we can get a symbol address we can
>> inject a trap into the function code and have all the calls vectored into
>> our code.
> It sounds like you are ptracing the executable, in which case you *are*
> an external debugger, and so (naturally) have no difficulty.

Not that it matters much, but we're not ptracing. We literally rewrite the 
machine code on the fly (well, part of the prologue). We save the original 
prologue, relocate it for any %rip-relative addresses etc., patch in a call 
into our own code, which then decides to do whatever it wants - usually calls 
the original code plus does some bookkeeping work.

As long as _dl_debug_state() has enough space to patch in the jump to our code, 
it should work for us. The dynamic linkers I looked seem to be built with 
enough code padding that there's space to replace the ret with a jump.

Anyway, it's not a general solution.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]