Search Results

Search found 1 results on 1 pages for 'assketchum'.

Page 1/1 | 1 

  • Obtaining frame pointer in C

    - by assketchum
    I'm trying to get the FP in my C program, I tried two different ways, but they both differ from what I get when I run GDB. The first way I tried, I made a protocol function in C for the Assembly function: int* getEbp(); and my code looks like this: int* ebp = getEbp(); printf("ebp: %08x\n", ebp); // value i get here is 0xbfe2db58 while( esp <= ebp ) esp -= 4; printf( "ebp: %08x, esp" ); //value i get here is 0xbfe2daec My assembly code getEbp: movl %ebp, %eax ret I tried making the prototype function to just return an int, but that also doesn't match up with my GDB output. We are using x86 assembly. EDIT: typos, and my getEsp function looks exactly like the other one: getEsp: movl %esp, %eax ret

    Read the article

1