From owner-freebsd-bugs Sun Jul 6 22:50:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id WAA26241 for bugs-outgoing; Sun, 6 Jul 1997 22:50:06 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id WAA26234; Sun, 6 Jul 1997 22:50:04 -0700 (PDT) Date: Sun, 6 Jul 1997 22:50:04 -0700 (PDT) Message-Id: <199707070550.WAA26234@hub.freebsd.org> To: freebsd-bugs Cc: From: Peter Wemm Subject: Re: gnu/4042: gdb stackframe in static library shows not the calling function Reply-To: Peter Wemm Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR gnu/4042; it has been noted by GNATS. From: Peter Wemm To: Bruce Evans Cc: freebsd-gnats-submit@hub.freebsd.org Subject: Re: gnu/4042: gdb stackframe in static library shows not the calling function Date: Mon, 07 Jul 1997 13:06:36 +0800 Bruce Evans wrote: > > gdb doesn't sho the calling stack > > in a function of a static linked library. > > if an error ocurrs in the function, > > ther is no information of the calling stack frame. > > This is caused by the function in the example (strlen) not having a frame > pointer. The top frame or two gets lost. The problem is most obvious > when there is only one or two frames. All functions written in assembler > have this problem. How much overhead will it be to do the stack frame linkage correctly? As I see it, it'll mean adding something like this: ENTRY(foo) + pushl %ebp + movl %esp,%ebp .... + leave ret .. to each assembler function. Is this price too high to pay? In some cases (ie: where the function doesn't make other calls, eg: strlen()), it *might* be simplified further (assuming what I've done is correct): ENTRY(foo) + pushl %ebp .... + addl $4,%esp (or: popl %ebp, whichever is quicker) ret > Bruce Cheers, -Peter