From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16807 invoked by alias); 12 Nov 2005 07:19:01 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 16794 invoked by uid 22791); 12 Nov 2005 07:18:58 -0000 Received: from mail.soc-soft.com (HELO IGateway.soc-soft.com) (202.56.254.199) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 12 Nov 2005 07:18:58 +0000 Received: from keys.soc-soft.com ([192.168.4.44]) by IGateway.soc-soft.com with InterScan VirusWall; Sat, 12 Nov 2005 12:48:52 +0530 Received: from soc-mail.soc-soft.com ([192.168.4.25]) by keys.soc-soft.com (PGP Universal service); Sat, 12 Nov 2005 12:45:48 +0530 X-PGP-Universal: processed; by keys.soc-soft.com on Sat, 12 Nov 2005 12:45:48 +0530 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Help with -finstrument-functions Date: Sat, 12 Nov 2005 07:19:00 -0000 Message-ID: <4BF47D56A0DD2346A1B8D622C5C5902CFF36E3@soc-mail.soc-soft.com> From: To: X-SW-Source: 2005-11/txt/msg00185.txt.bz2 Hi, I am facing a strange problem when I tried to profile the call trace of my = application using -finstrument-functions switch in gcc. We have our application built as a shared library and we use python scripti= ng language to test all the interfaces provided by this shared library. It is the call trace of this shared library that I want to print.=0D When I create an executable by linking this shared library to a main.o (as = follows), I get the call trace.=0D $ gcc main.o libtest_app.so -o app $ app This main.o contains only a main function that calls one of the interfaces = present in libtest_app.so. But when I import this shared library (libtest_app.so) into python, I do no= t get the call trace. I analyzed the scenario in detail and these are my observations. I have defined the functions __cyg_profile_func_enter and __cyg_profile_fun= c_exit in my application, and I can see them in nm output. $ nm libtest_app.so | grep __cyg=0D 00177518 T __cyg_profile_func_enter 001775c4 T __cyg_profile_func_exit Case 1: When I debug my application, built as an exe (app) I see that whene= ver it enters any function, it jumps to these above defined functions in li= btest_app.so Case 2: But when I debug my application, imported as an module in python, I= see that whenever it enters any function it jumps to some symbol of the sa= me name (__cyg_profile_func_enter) in glibc (source filename is displayed a= s noophooks.c). The library is the same in both cases. What I don't understand is that if t= he shared library is built and linked, why should a reference to one functi= on (__cyg_profile_func_enter) result in different jumps in different situat= ions. Ideally all jumps to __cyg_profile_func_enter should have been resolv= ed to refer to the symbol defined in my library, when I build the shared li= brary (as follows), $ gcc -shared -L/usr/lib/python2.2/config -lpython2.2 -o test/lib/libtest_a= pp.so -lapp.a -lpthread -lrt -lm -ldl -lutil =0D Why doesn't this happen in the second case? Am I missing something here? GCC version 3.3.1 Warm regards, Thulasidhar J.K=A0 The information contained in this e-mail message and in any annexure is confidential to the recipient and may contain privileged information. If y= ou are not the intended recipient, please notify the sender and delete the message alo= ng with any annexure. You should not disclose, copy or otherwise use the informatio= n contained in the message or any annexure. Any views expressed in this e-mail are thos= e of the individual sender except where the sender specifically states them to be th= e views of SoCrates Software India Pvt Ltd., Bangalore.