From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <47F166DE.6090502@wmipf.in-berlin.de> Date: Tue, 1 Apr 2008 00:34:06 +0200 From: =?UTF-8?B?TWljaGFlbCBUZWljaGdyw6RiZXI=?= User-Agent: Icedove 1.5.0.14pre (X11/20080208) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> References: <8efca694b803e9d55c75926d809a5bce@terzarima.net> In-Reply-To: <8efca694b803e9d55c75926d809a5bce@terzarima.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] getcallerpc on arm7 Topicbox-Message-UUID: 85db85d8-ead3-11e9-9d60-3106f5b1d025 > it should be the same as the other risc machines, and seems all right > when i test it with 5c/5l. gcc typically also uses a frame pointer, > which might make it nearly as easy for that compiler. This seems to work well: .text .globl getcallerpc getcallerpc: ldr r0, [fp, #-4] bx lr I was a bit confused about whether or not the firstarg pointer is expected to be used by a getcallerpc implementation (so that it would also work in subfunctions of the current, provided &firstarg is passed down). The BUGS section of getcallerpc(2/3) gives a hint how this could be answered.