> I have used VG_(track_die_mem_stack) to track the SP change. I know that when > C function is called, arguments will be pushed into stack firstly and > secondly the function will be called. After the call, the callee will restore > SP to the call point, and the caller is responsible in discarding the > arguments passed to callee and restoring SP to the same location before > calling functions.
That's the old way. Current gcc 4.6 (and all gcc 4.x.y, I believe) use MOVL ...,+n(%esp) or MOVL ...,-m(%ebp) instead of PUSH. All allocation is done at entry using SUBL $sz_frame,%esp. This is easily verified by using any disassembler, or with gdb $ gdb my_app (gdb) b main (gdb) run <arguments_to_my_app> (gdb) x/20i main (gdb) x/20i Thus in any given subroutine there are only two changes to SP: at entry, and at exit. -- ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
