This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 3.2/x86 Question
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Jens Thomsen <MisfitsPlan9 at access-4-free dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 07 Jul 2003 12:53:57 -0300
- Subject: Re: GCC 3.2/x86 Question
- Organization: GCC Team, Red Hat
- References: <3F08AB57.60902@access-4-free.com>
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