This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: GDB 4.17 Patch for stack aligned i386 code
- To: nsd at bosbc dot com
- Subject: Re: GDB 4.17 Patch for stack aligned i386 code
- From: John Wehle <john at feith dot com>
- Date: Fri, 24 Mar 2000 19:30:36 -0500 (EST)
- CC: cgf at cygnus dot com, eliz at delorie dot com, gdb-patches at sourceware dot cygnus dot com, jimb at cygnus dot com, msnyder at cygnus dot com
>>Are you handling non-leaf functions even when the stack pointer is changing?
>
> Yes. It works by emulating instructions to figure out the stack pointer
> on entry to or exit from the function. The opcodes library, with a few
> minor changes, provides the instruction information in an
> architecture-independent format.
Cool.
>>Does your patch handle functions where the prologue uses "andl" to align
>>the frame?
>
> I don't know. Do you happen to have an example of how to generate such
> code? I'd be interested in trying it.
I'm not sure what I still have laying around other than a very old patch
for GCC. The idea is to handle a prologue which looks like:
func:
pushl %ebp
movl %esp,%ebp
andl $-15,%esp
subl $32,%esp
function arguments are relative to %ebp and local variables are relative to
%esp. Extra alignment has been applied to the stack pointer in order to
ensure that local variables don't cross a cache boundary.
-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------