FuncUnwinders: Add a new "SymbolFile" unwind plan
authorPavel Labath <pavel@labath.sk>
Fri, 10 May 2019 07:54:37 +0000 (07:54 +0000)
committerPavel Labath <pavel@labath.sk>
Fri, 10 May 2019 07:54:37 +0000 (07:54 +0000)
commit22bbd7d690e256167d7191e6b65e91d60ef6a020
tree56b801da67479f64fbe025c3241fcda20155e386
parentc4f12013df8cdf17662514798d597d6d79561fa4
FuncUnwinders: Add a new "SymbolFile" unwind plan

Summary:
some unwind formats are specific to a single symbol file and so it does
not make sense for their parsing code live in the general Symbol library
(as is the case with eh_frame for instance). This is the case for the
unwind information in breakpad files, but the same will probably be true
for PDB unwind info (once we are able to parse that).

This patch adds the ability to fetch an unwind plan provided by a symbol
file plugin, as discussed in the RFC at
<http://lists.llvm.org/pipermail/lldb-dev/2019-February/014703.html>.
I've kept the set of changes to a minimum, as there is no way to test
them until we have a symbol file which implements this API -- that is
comming in a follow-up patch, which will also implicitly test this
change.

The interesting part here is the introduction of the
"RegisterInfoResolver" interface. The reason for this is that breakpad
needs to be able to resolve register names (which are present as strings
in the file) into register enums so that it can construct the unwind
plan. This is normally done via the RegisterContext class, handing this
over to the SymbolFile plugin would mean that it has full access to the
debugged process, which is not something we want it to have. So instead,
I create a facade, which only provides the ability to query register
names, and hide the RegisterContext behind the facade.

Also note that this only adds the ability to dump the unwind plan
created by the symbol file plugin -- the plan is not used for unwinding
yet -- this will be added in a third patch, which will add additional
tests which makes sure the unwinding works as a whole.

Reviewers: jasonmolenda, clayborg

Subscribers: markmentovai, amccarth, lldb-commits

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

llvm-svn: 360409
lldb/include/lldb/Symbol/FuncUnwinders.h
lldb/include/lldb/Symbol/SymbolFile.h
lldb/include/lldb/Symbol/UnwindTable.h
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Symbol/FuncUnwinders.cpp
lldb/source/Symbol/SymbolFile.cpp
lldb/source/Symbol/UnwindTable.cpp