Re: GCC 3.2/x86 Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jul  6, 2003, Jens Thomsen <MisfitsPlan9@xxxxxxxxxxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux