llvm-project/lldb/lit
Pavel Labath 2359429168 FuncUnwinders: remove "current_offset" from function arguments
Summary:
This argument was added back in 2010 (r118882) to support the ability to unwind
from functions whose eh_frame entry does not cover the entire range of
the function.

However, due to the caching happening in FuncUnwinders, this solution is
very fragile. FuncUnwinders will cache the plan it got from eh_frame
regardless of the value of the current_offset, so our ability to unwind
from a given function depended what was the value of "current_offset" the
first time that this function was called.

Furthermore, since the "image show-unwind" command did not know what's
the right offset to pass, this created an unfortunate situation where
"image show-unwind" would show no valid plans for a function, even
though they were available and being used.

In this patch I implement the feature slightly differently. Instead of
giving just a base address to the eh_frame unwinder, I give it the
entire range we are interested in. Then, I change the unwinder to return
the first plan that covers (even partially) that range. This way even a
partial plan will be returned, regardless of the address in the function
where we are stopped at.

This solution is still not 100% correct, as it will not handle a
function which is covered by two independent fde entries. However, I
don't expect anybody will write this kind of functions, and this wasn't
handled by the previous implementation either. If this is ever needed in
the future. The eh_frame unwinder can be extended to return "composite"
unwind plans created by merging sevelar fde entries.

I also create a test which triggers this scenario. As doing this is
virtually impossible without hand-written assembly, the test only works
on x86 linux.

Reviewers: jasonmolenda, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D60829

llvm-svn: 358964
2019-04-23 09:57:14 +00:00
..
Breakpoint [LLDB] - Update the test cases after yaml2obj change. 2019-04-03 15:28:35 +00:00
BuildScript [lldb] [lit] Attempt to fix regex in toolchain-clang.test 2019-03-06 14:49:48 +00:00
Commands [test] Fix & re-enable CommandScriptImmediateOutputFile on Windows 2019-04-11 19:36:53 +00:00
Driver Update the lldb driver to support the -O and -S options when passing --repl 2019-03-25 15:38:18 +00:00
ExecControl/StopHook This test is failing on and off on the bots. 2019-03-12 23:15:48 +00:00
Expr [lit] Make sure tests are actually skipped on darwin and windows. 2019-01-17 21:57:33 +00:00
Heap Fix lldb's macosx/heap.py cstr command. 2018-12-17 18:21:51 +00:00
Minidump MinidumpParser: use minidump parser in llvm/Object 2019-04-05 07:56:39 +00:00
Modules Breakpad: Match the new UUID algorithm in minidumps 2019-04-16 14:51:47 +00:00
Python Avoid using -S in combination with "script"; it's unreliable. 2019-03-07 00:46:56 +00:00
Quit [lldb] Update shebang python2 -> python 2019-01-26 01:05:02 +00:00
Register [lldb] [lit/Register] XFAIL on Darwin 2019-04-11 20:44:40 +00:00
Reproducer [Reproducers] Properly handle QEnvironment packets 2019-03-21 04:08:31 +00:00
Settings Refactor the lit configuration files 2018-11-02 17:49:01 +00:00
Suite [lldb] [test] Pass appropriate -L&-Wl,-rpath for libc++ on NetBSD 2019-03-06 14:03:18 +00:00
SymbolFile [NativePDB] Add anonymous namespaces support 2019-04-22 07:14:40 +00:00
Unit [CMake] In standalone builds, LLVM_BINARY_DIR should point to LLVM's binary directory 2019-01-09 16:25:37 +00:00
Unwind FuncUnwinders: remove "current_offset" from function arguments 2019-04-23 09:57:14 +00:00
helper Sanity check --max-gdbserver-port 2019-03-06 21:52:19 +00:00
tools [tools] Make vscode and lldb-instr optional. 2019-04-16 21:15:28 +00:00
CMakeLists.txt [tools] Make vscode and lldb-instr optional. 2019-04-16 21:15:28 +00:00
lit-lldb-init Add EchoCommentCommands to CommandInterpreterRunOptions in addition to the existing EchoCommands and expose both as interpreter settings. 2018-10-05 16:49:47 +00:00
lit.cfg.py Fix clang test suite on Windows by reverting part of r347216 2018-11-19 19:36:28 +00:00
lit.site.cfg.py.in [tools] Make vscode and lldb-instr optional. 2019-04-16 21:15:28 +00:00