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]

Re: c/5199: Feature request: function call logging


Whoops, please reopen this feature request, if possible.  Sorry for
dropping the ball on the feedback.

-finstrument-functions is nice as far as it goes, but I was really
helping for a way to get at a function's name and arguments.  I wound up
hacking up a script using gdb to get at a function's name, but there was
still no way to get its arguments.  (And the script I wound up with was
truly inelegant; it would be much much nicer for gdb to simply pass in
the name.)

So, I'd like an enhanced -finstrument-functions which passes, in
addition to the current information:

  * The name of the function
  * A va_list pointing to the first argument.  (If, on some platforms, a
va_list couldn't be used to access the fixed part of a function's
parameters because they're represented differently, then function call
instrumentation wouldn't be as useful on those platforms.  No reason to
sacrifice that functionality on other platforms.)

Of course, there's only so much you can do with a va_list of unknown
contents.  But you could have a table of interesting functions and their
argument types, which you could use to log the arguments of those
functions.

Thanks.  As before, this is just a low-priority feature request hoping
for someone to find it interesting enough to implement.


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