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/Symbol | |
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/Symbol')
-rw-r--r-- | lldb/source/Symbol/DWARFCallFrameInfo.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Symbol/UnwindPlan.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp index 39c58d6bb4e..92d9f8b808d 100644 --- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp +++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp @@ -748,7 +748,9 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr case DW_CFA_def_cfa_expression : // 0xF (CFA Definition Instruction) { size_t block_len = (size_t)m_cfi_data.GetULEB128(&offset); - offset += (uint32_t)block_len; + const uint8_t *block_data = + static_cast<const uint8_t *>(m_cfi_data.GetData(&offset, block_len)); + row->GetCFAValue().SetIsDWARFExpression(block_data, block_len); } break; diff --git a/lldb/source/Symbol/UnwindPlan.cpp b/lldb/source/Symbol/UnwindPlan.cpp index d4b06d5c925..b35a6e7b28a 100644 --- a/lldb/source/Symbol/UnwindPlan.cpp +++ b/lldb/source/Symbol/UnwindPlan.cpp @@ -434,10 +434,8 @@ UnwindPlan::PlanValidAtAddress (Address addr) // If the 0th Row of unwind instructions is missing, or if it doesn't provide // a register to use to find the Canonical Frame Address, this is not a valid UnwindPlan. - // CFA set by a DWARF expression is not currently supported, so ignore that as well. if (GetRowAtIndex(0).get() == nullptr || - GetRowAtIndex(0)->GetCFAValue().GetValueType() == Row::CFAValue::unspecified || - GetRowAtIndex(0)->GetCFAValue().GetValueType() == Row::CFAValue::isDWARFExpression) + GetRowAtIndex(0)->GetCFAValue().GetValueType() == Row::CFAValue::unspecified) { Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); if (log) |