summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-05-10 07:54:37 +0000
committerPavel Labath <pavel@labath.sk>2019-05-10 07:54:37 +0000
commit22bbd7d690e256167d7191e6b65e91d60ef6a020 (patch)
tree56b801da67479f64fbe025c3241fcda20155e386 /lldb/source/Commands/CommandObjectTarget.cpp
parentc4f12013df8cdf17662514798d597d6d79561fa4 (diff)
downloadbcm5719-llvm-22bbd7d690e256167d7191e6b65e91d60ef6a020.tar.gz
bcm5719-llvm-22bbd7d690e256167d7191e6b65e91d60ef6a020.zip
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index ebc68731aed..53e7347d4f6 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -3591,6 +3591,14 @@ protected:
result.GetOutputStream().Printf("\n");
}
+ if (UnwindPlanSP symfile_plan_sp =
+ func_unwinders_sp->GetSymbolFileUnwindPlan(*thread)) {
+ result.GetOutputStream().Printf("Symbol file UnwindPlan:\n");
+ symfile_plan_sp->Dump(result.GetOutputStream(), thread.get(),
+ LLDB_INVALID_ADDRESS);
+ result.GetOutputStream().Printf("\n");
+ }
+
UnwindPlanSP compact_unwind_sp =
func_unwinders_sp->GetCompactUnwindUnwindPlan(*target);
if (compact_unwind_sp) {
OpenPOWER on IntegriCloud