This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: GCC 3.2/x86 Question


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


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