llvm-project/lldb/source/Symbol
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
..
ArmUnwindInfo.cpp Fix typo in ArmUnwindInfo::GetUnwindPlan 2019-04-16 08:06:56 +00:00
Block.cpp Use std::make_shared in LLDB (NFC) 2019-02-11 23:13:08 +00:00
CMakeLists.txt Move Host/Symbols.cpp to Symbols/LocateSymbolFile.cpp 2019-02-27 21:42:10 +00:00
ClangASTContext.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
ClangASTImporter.cpp Remove the unused return value in ASTImporter::Imported [NFC] 2019-03-20 19:00:25 +00:00
ClangExternalASTSourceCallbacks.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangExternalASTSourceCommon.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangUtil.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CompactUnwindInfo.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CompileUnit.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CompilerDecl.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CompilerDeclContext.cpp Correctly look up declarations in inline namespaces 2019-03-12 07:45:04 +00:00
CompilerType.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
DWARFCallFrameInfo.cpp FuncUnwinders: remove "current_offset" from function arguments 2019-04-23 09:57:14 +00:00
DebugMacros.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Declaration.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FuncUnwinders.cpp FuncUnwinders: remove "current_offset" from function arguments 2019-04-23 09:57:14 +00:00
Function.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
LineEntry.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LineTable.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
LocateSymbolFile.cpp Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
LocateSymbolFileMacOSX.cpp Increase timeout in Symbols::DownloadObjectAndSymbolFile 2019-03-01 03:24:59 +00:00
ObjectFile.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
Symbol.cpp Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
SymbolContext.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
SymbolFile.cpp Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
SymbolVendor.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
Symtab.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
Type.cpp Remove the TypePair class 2019-03-26 13:35:54 +00:00
TypeList.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
TypeMap.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
TypeSystem.cpp Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
UnwindPlan.cpp UnwindPlan: pretty-print dwarf expressions 2019-04-23 09:16:51 +00:00
UnwindTable.cpp Reinitialize UnwindTable when the SymbolFile changes 2019-03-18 10:45:02 +00:00
Variable.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
VariableList.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
VerifyDecl.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00