Re: Getting function signature



I need to get information about a given function signature on the
fly. Parameter quantity, order and type is sufficient. I've been
searching around, but I can't come up with any info. Any ideas?
Assembly solutions are welcome. Thanks. --korney

From the source code? Have you looked at cproto? It generates
declarations of functions in a source file (and what it includes)
from the source file. You still need to parse the declarations.
That also requires understanding the typedefs that might show
up in the declarations.

From object code? *MUCH* harder if it's even possible. It is
highly likely that two functions, differing only in the first
parameter being int in the first, and long in the second, on a
platform where long and int are the same size, will generate identical
code (and if there are no debugging symbols, identical object files
entirely.

Depending on how that parameter is actually used (it might only be
passed to other functions), it may be impossible to tell the
difference between signed int and unsigned int, int and enum, long
and pointer, etc.


.



Relevant Pages

  • Re: to give files unique no
    ... int my_api { ... ....in the source file t1_main.c. ... In the code, calls to a logging ... making a lot of the manual macro ...
    (comp.lang.c)
  • Re: A pointer as a porameter of the function
    ... int malloc_check{ ... don't place declarations within functions. ... and preferably at the top of the source file. ... Use static arrays to begin with, progressing to dynamic memory ...
    (comp.lang.c)
  • Re: Programming Puzzle
    ... merely echoing the actual source file is not ... int main ... email: lonewolfintj at pacbell dot net web: home dot pacbell dot net slant earnur slant ...
    (comp.lang.cpp)
  • Re: cout << char*
    ... "Igor Tandetnik" wrote: ... Each source file is ... Including CLib.h in library.cpp is adding the declarations to the definitions. ... int id ...
    (microsoft.public.vc.language)
  • Re: printf("%s ", __FILE__); /* why SIGSEGV? */
    ... needed and %s is the wrong conversion specifier to use. ... The presumed source file name and line number can be changed by ... cater to implementations with 16-bit int that allow source files ... Keith Thompson kst-u@xxxxxxx ...
    (comp.lang.c)