lkml.org 
[lkml]   [2000]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: kernel compiled with frame pointer
Date
On Mon, 25 Sep 2000 06:21:48 -0500, 
Robert Redelmeier <redelm@ev1.net> wrote:
>Ah -- I see, you are looking at some sort of kernel debugger. Well,
>then one way would be to look at entry and exit points. i386 Frame
>pointers are set up with `pushl %ebp / movl %esp, %ebp / subl $local, %esp`
>or sometimes [not by gcc AFAIK with `enter`]. Exit points are similarly
>`movl %ebp, %esp / popl %ebp / ret`. Some versions of gcc do generate
>`leave / ret`.
>
>You could look for these byte signatures. Should be quite reliable with
>a good System.map.

Until you go to gcc 2.96 when the prologue code changes dramatically.
Interleaved instructions, plus "nice" constructs like

void foo(int bar)
{
if (!bar)
return;
....
return;
}

Could generate the test before doing anything on stack.

foo: cmpl 4(%esp),$0
be 1f
pushl %ebp
movl %esp,%ebp
...
movl %ebp,%esp
popl %ebp
1: ret

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.045 / U:2.996 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site