diff options
| author | Pavel Labath <labath@google.com> | 2015-02-23 10:29:01 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2015-02-23 10:29:01 +0000 |
| commit | dbb41cf41899db8c2900800f5cb1b8eff9fbcc29 (patch) | |
| tree | d79bc6cb4cdff15682a58780cdda637378b00821 /lldb/source/Plugins/Process | |
| parent | ab970f5e08a976d4ea1ae64e4b3b9ff15a88aeb9 (diff) | |
| download | bcm5719-llvm-dbb41cf41899db8c2900800f5cb1b8eff9fbcc29.tar.gz bcm5719-llvm-dbb41cf41899db8c2900800f5cb1b8eff9fbcc29.zip | |
Support evaluation of DWARF expressions setting CFA
Summary:
This patch enables evaluation of DWARF expressions setting the CFA during stack unwinding.
This makes TestSigtrampUnwind "almost" pass on linux. I am not enabling the test yet since the
symbol name for the signal trampoline does not get resolved properly due to a different bug, but
apart from that, the backtrace is sane.
I am unsure how this change affects Mac. I think it makes the unwinder prefer the DWARF unwind
plan instead of some custom platform-dependant plan. However, it does not affect the end result
- the stack unwinding works as expected.
Reviewers: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7792
llvm-svn: 230211
Diffstat (limited to 'lldb/source/Plugins/Process')
| -rw-r--r-- | lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index a1eaf57e17e..a889d29a234 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -1743,7 +1743,28 @@ RegisterContextLLDB::ReadCFAValueForRow (lldb::RegisterKind row_register_kind, } break; } - // TODO: handle isDWARFExpression + case UnwindPlan::Row::CFAValue::isDWARFExpression: + { + ExecutionContext exe_ctx(m_thread.shared_from_this()); + Process *process = exe_ctx.GetProcessPtr(); + DataExtractor dwarfdata (row->GetCFAValue().GetDWARFExpressionBytes(), + row->GetCFAValue().GetDWARFExpressionLength(), + process->GetByteOrder(), process->GetAddressByteSize()); + ModuleSP opcode_ctx; + DWARFExpression dwarfexpr (opcode_ctx, dwarfdata, 0, row->GetCFAValue().GetDWARFExpressionLength()); + dwarfexpr.SetRegisterKind (row_register_kind); + Value result; + Error error; + if (dwarfexpr.Evaluate (&exe_ctx, NULL, NULL, this, 0, NULL, result, &error)) + { + cfa_value = result.GetScalar().ULongLong(); + + UnwindLogMsg ("CFA value set by DWARF expression is 0x%" PRIx64, cfa_value); + return true; + } + UnwindLogMsg ("Failed to set CFA value via DWARF expression: %s", error.AsCString()); + break; + } default: return false; } |

