This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

other/5199: Feature request: function call logging



>Number:         5199
>Category:       other
>Synopsis:       Feature request: function call logging
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 26 18:06:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     ghudson@mit.edu
>Release:        n/a
>Organization:
>Environment:

>Description:
I would like to see a gcc option, similar to the profiling option, to enable logging of function calls.  The idea is that, when the flag is set, a little bit of code would be added to the top of each function to write out the function name and argument values (and possibly some other relevant information, like the filename/lineno of the function and the current pid) to some standard filename.  The arguments could be written out in a binary format to be interpreted by some tool, or in text format; it doesn't really matter.  (You'd also need to write out something on function exit.)

Why I'd like this: most of my job is about integrating large software packages into a unified environment.  Frequently I need to make local changes or bug fixes.  As time goes on and open source software expands in scope, I find myself working with larger and more complicated software packages, which are harder to understand.  Simply finding the code responsible for a particular feature or behavior can take days of effort.  With a gcc logging flag, I could analyze the trace of a program's execution when I exercise a feature, making it easy to locate the responsible code.

(Sometimes I can get the information I want by stepping through a program with gdb.  But that can be tedious when you don't have a good starting point other than main(), and tricky when a program makes heavy use of threads and/or subprocesses.  Function call logging would let me get all of the call trace information into one place where I could sort through it in a variety of ways.)

Thanks for your consideration.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]