From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: duane_ellis@franklin.com Cc: insight@sourceware.cygnus.com Subject: Re: Debugging without a frame pointer. Date: Mon, 08 May 2000 08:01:00 -0000 Message-id: References: <200004272222.SAA09246@mercury.franklin.com> X-SW-Source: 2000-q2/msg00180.html GDB does support debugging functions lacking frame pointers on some architectures. If there isn't any more reliable source of information, GDB handles these cases by actually analyzing the first few instructions of the function, looking for an instruction that adjusts the stack pointer. Usually, if you can discover where the stack pointer was on entry to the function, you can find the saved return address; there's no harm in choosing a convention here and making GCC stick to it. For an example of a port that works this way, you might want to check out mn10200_analyze_prologue in mn10200-tdep.c. Handling functions whose frame size varies (because they call alloca, use GCC's variable-sized arrays, etc.) is a challenge. GDB pretty much requires that such functions use a frame pointer register. But I don't see how GCC could find the local variables reliably unless there was a frame pointer there for GDB to find.