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]

RE: gcc - Run Time Memory Capture



Chris,

 > has been overwritten. A more useful addition to the gcc suite would be a
 > program that can work out the maximum possible stack depth without having to
 > run the program. For each function it would need to know the stack used and
 > a list of functions called.

  Capturing worst case maximum possible stack depth of a program will
be a usefull measure of memory requirement. (without considering
recursion) 

  Is the following approach to capture Run Time Stack Size for
recursive programs feasible? 



gcc -o stackCapture.out -cs "stackCapture.c" ( -cs stands for "Capture
                                               Stack". Probably an
                                               existing option can be
                                               used )

  generates a profile information that keeps track of the stack size
of a function(without considering the function calls within it). Let
us say this profile information file is "functionStackSize.dat"

Upon execution of the stackCapture.out, function call trace
is dumped into a file say "functionCall.dat" 

Now a utility (modify gprof if feasible) will take functionCall.dat as
input and functionStackSize.dat as reference, to report the Maximum Run
time stack size requirement of the executable for a particular run.

Regards
-raman

-- 
_______________________________________________________________
Raman Govindan, Software Specialist,
Global R&D Division, Wipro Technologies.

Visit http://netphone.wipro.com (For now Only Wipro Employees)
Email: raman.govindan@wipro.com
Tel: +91-(80)-5364801/07, Ext: 160 (Office)
_______________________________________________________________


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