diff options
author | Ravitheja Addepally <ravitheja.addepally@intel.com> | 2016-07-07 13:00:29 +0000 |
---|---|---|
committer | Ravitheja Addepally <ravitheja.addepally@intel.com> | 2016-07-07 13:00:29 +0000 |
commit | b3b972a5a8fa8095713721dc0f52fc045a75dc95 (patch) | |
tree | dc412e1957cd542ec5c554f2b562b46e0371209e /lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c | |
parent | 4446c216f5c3b78424ce1464134615c52a4399a5 (diff) | |
download | bcm5719-llvm-b3b972a5a8fa8095713721dc0f52fc045a75dc95.tar.gz bcm5719-llvm-b3b972a5a8fa8095713721dc0f52fc045a75dc95.zip |
Fix for PrintStackTraces
Summary:
The issue arises due to the wrong unwinder used for the first
stack frame, where the default unwinder returns erroneous frame
whereas the fallback would have given the correct frame had it
been used.
The following fix consists of two parts ->
1) The first part changes the unwinding strategy, earlier the
default unwinder was used to get 2 more stack frames and if it
failed a fallback unwinder was used. Now we try to obtain as many
frames (max 10) as we can get from default unwinder and also
fallback unwinder and use the one that gives more number of frames.
2) Normally unwindplans are assosciated with functions and the
row to be used is obtained from the offset (obtained from the low_pc
of the function symbol). Sometimes it may occur that the unwindplan
is assosciated to the complete Elf section in which case the offset
calculation would be wrong as the debugger uses the same offset originally
obtained from the function symbol. Hence this offset is recalculated.
Reviewers: tberghammer, lldb-commits, labath, jasonmolenda
Subscribers: jingham
Differential Revision: http://reviews.llvm.org/D21221
llvm-svn: 274750
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c new file mode 100644 index 00000000000..f62f7d814f3 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c @@ -0,0 +1,20 @@ +void func() { + __asm__ ( + "pushq $0x10;" + ".cfi_def_cfa_offset 16;" + "jmp label;" + "movq $0x48, %rax;" +"label: subq $0x38, %rax;" + "movq $0x48, %rcx;" + "movq $0x48, %rdx;" + "movq $0x48, %rax;" + "popq %rax;" + ); + +} + + +int main(int argc, char const *argv[]) +{ + func(); +}
\ No newline at end of file |