GCC 3.2/x86 Question
Alexandre Oliva
aoliva@redhat.com
Mon Jul 7 15:54:00 GMT 2003
On Jul 6, 2003, Jens Thomsen <MisfitsPlan9@access-4-free.com> wrote:
> Now,
> this should give
> me the amount of stack 'usage' for the function
Which function? It should give you the amount of stack usage of
the callee, as long as it is not inlined.
> int esp1;
> asm ("movl %%esp, %0;" :"=m"(esp1));
^ consider `r' instead.
> Second question. From looking at some of the docs and testing a
> small chunk of code (see below), I can't seem to get the value of
> EIP or IP (Instruction Pointer) from inline assembly. Does anyone
> know how to do this?
Compile with -fPIC and see how GCC initializes %ebx in every function.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer
More information about the Gcc-help
mailing list