From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17201 invoked by alias); 16 Apr 2002 14:47:38 -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 17141 invoked from network); 16 Apr 2002 14:47:28 -0000 Received: from unknown (HELO work.ro) (212.93.130.242) by sources.redhat.com with SMTP; 16 Apr 2002 14:47:28 -0000 Received: (qmail 29369 invoked from network); 16 Apr 2002 14:47:26 -0000 Received: from localhost (vpopmail@127.0.0.1) by localhost with QMQP; 16 Apr 2002 14:47:26 -0000 Message-ID: <20020416144726.29365.qmail@designed_by_php> From: "Calin Vatavu" To: gcc-help@gcc.gnu.org Subject: function logging Date: Tue, 16 Apr 2002 08:37:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Sender: cvatavu@bumerang.ro X-SW-Source: 2002-04/txt/msg00167.txt.bz2 I'm trying to log EVERY function call in a library (gtk+ for example) and I did it by inserting the line: int dummy = printf (" %s %d", __FILE__, __LINE__); in ALL functions (at the beginning). I used a perl script which can, ofcourse, be fooled in some cases (like enum {...). thus I think I need a c-parser which can give me the position of the starting of the function body in the file. Cab gcc give me the access to its internals to accomplish this ? And a second problem, how can I know the caller of the current function (like the perl's caller() function) ? I need the backtrace in every function call. Does anybody know some debugging tricks like this ?