Date: | Fri, 28 Apr 2006 00:28:14 +0300 |
From: | Diomidis Spinellis <dds@aueb.gr> |
Organization: | Athens University of Economics and Business |
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060404 SeaMonkey/1.0.1 |
MIME-Version: | 1.0 |
Newsgroups: | comp.os.linux.development.apps |
Subject: | Re: How can hook C++ functions |
References: | <1146157504.362777.265530@i39g2000cwa.googlegroups.com> |
In-Reply-To: | <1146157504.362777.265530@i39g2000cwa.googlegroups.com> |
Content-Type: | text/plain; charset=ISO-8859-1; format=flowed |
Content-Transfer-Encoding: | 7bit |
JK wrote: > Hi, anybody know how to hook C++ functions? I have a program that uses > shared libraries and I need to implement hook for the library > functions. I need to catch the function call before the library > function is called and after handling the call in my function, I need > to call the original function from the library. GCC support is needed > only. Examine the source code of ltrace(1) <http://packages.debian.org/unstable/utils/ltrace.html>. It does exactly what you want. -- Diomidis Spinellis Code Quality: The Open Source Perspective (Addison-Wesley 2006) http://www.spinellis.gr/codequality?colda