Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jul 1997 22:50:04 -0700 (PDT)
From:      Peter Wemm <peter@spinner.dialix.com.au>
To:        freebsd-bugs
Subject:   Re: gnu/4042: gdb stackframe in static library shows not the calling function 
Message-ID:  <199707070550.WAA26234@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR gnu/4042; it has been noted by GNATS.

From: Peter Wemm <peter@spinner.dialix.com.au>
To: Bruce Evans <bde@zeta.org.au>
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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707070550.WAA26234>