[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] On "Unwinding through 0-length frames"

From: Kevin Modzelewski
Subject: Re: [Libunwind-devel] On "Unwinding through 0-length frames"
Date: Mon, 12 May 2014 16:03:27 -0700

Hi, here's the original email:

This "rsp=rbp" situation can occur if you have a small function, which requires no stack-saved variables, that calls some other function that then unwinds.  Here's a contrived example:

int functionThatMightUnwind();

int test() {
    return functionThatMightUnwind() + 1;

g++ test.cpp -c -S -o test.s -O1 -fno-omit-frame-pointer

.file "test.cpp"
.globl _Z4testv
.type _Z4testv, @function
pushq %rbp
.cfi_def_cfa_offset 16
movq %rsp, %rbp
.cfi_offset 6, -16
.cfi_def_cfa_register 6
call _Z23functionThatMightUnwindv
addl $1, %eax
.cfi_def_cfa 7, 8

If functionThatMightUnwind does, in fact, unwind, then the unwinder will hit the frame for test(), and see that rsp=rbp and judge it to be an invalid frame.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]