This is the mail archive of the
mailing list for the glibc project.
Re: backtrace semantics
- From: Carlos O'Donell <carlos at systemhalted dot org>
- To: David Miller <davem at davemloft dot net>
- Cc: joseph at codesourcery dot com, libc-alpha at sourceware dot org
- Date: Sat, 19 Jan 2013 08:19:49 -0500
- Subject: Re: backtrace semantics
- References: <firstname.lastname@example.org>
On 01/18/2013 05:14 PM, David Miller wrote:
> First, thanks for adding all the new backtrace() test cases.
> There seems to be an inconsistency about how to handle the top-most
> frame in the backtrace.
> x86 for example, includes the caller of backtrace(), and this matches
> the expectation of the new testcases.
> Whereas s390 and sparc, for example, elide the backtrace() caller's
> frame from the backtrace, and starts reporting at the frame
> immediately afterwards.
> Which one is correct?
I'd say you should always list the caller of backtrace() in the frame.
In gdb when you issue `bt' you always get the caller in the backtrace.