summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Address.cpp
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2019-08-02 16:53:42 +0000
committerJoseph Tremoulet <jotrem@microsoft.com>2019-08-02 16:53:42 +0000
commit31e6dbe1c6a6e418bd65847610d5052cc59978b2 (patch)
tree188b3a8c5806c778e7496d7b31c6a31ef5207c0b /lldb/source/Core/Address.cpp
parente93341f7c87e6816a8026d8bdd2a59e2f71f56a9 (diff)
downloadbcm5719-llvm-31e6dbe1c6a6e418bd65847610d5052cc59978b2.tar.gz
bcm5719-llvm-31e6dbe1c6a6e418bd65847610d5052cc59978b2.zip
Fix PC adjustment in StackFrame::GetSymbolContext
Summary: Update StackFrame::GetSymbolContext to mirror the logic in RegisterContextLLDB::InitializeNonZerothFrame that knows not to do the pc decrement when the given frame is a signal trap handler frame or the parent of one, because the pc may not follow a call in these frames. Accomplish this by adding a behaves_like_zeroth_frame field to lldb_private::StackFrame, set to true for the zeroth frame, for signal handler frames, and for parents of signal handler frames. Also add logic to propagate the signal handler flag from UnwindPlan to the FrameType on the RegisterContextLLDB it generates, and factor out a helper to resolve symbol and address range for an Address now that we need to invoke it in four places. Reviewers: jasonmolenda, clayborg, jfb Reviewed By: jasonmolenda Subscribers: labath, dexonsmith, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D64993 llvm-svn: 367691
Diffstat (limited to 'lldb/source/Core/Address.cpp')
-rw-r--r--lldb/source/Core/Address.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 0da83eb98ed..84ff4ec5b07 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -261,6 +261,24 @@ bool Address::ResolveAddressUsingFileSections(addr_t file_addr,
return false; // Failed to resolve this address to a section offset value
}
+/// if "addr_range_ptr" is not NULL, then fill in with the address range of the function.
+bool Address::ResolveFunctionScope(SymbolContext &sym_ctx,
+ AddressRange *addr_range_ptr) {
+ constexpr SymbolContextItem resolve_scope =
+ eSymbolContextFunction | eSymbolContextSymbol;
+
+ if (!(CalculateSymbolContext(&sym_ctx, resolve_scope) & resolve_scope)) {
+ if (addr_range_ptr)
+ addr_range_ptr->Clear();
+ return false;
+ }
+
+ if (!addr_range_ptr)
+ return true;
+
+ return sym_ctx.GetAddressRange(resolve_scope, 0, false, *addr_range_ptr);
+}
+
ModuleSP Address::GetModule() const {
lldb::ModuleSP module_sp;
SectionSP section_sp(GetSection());
OpenPOWER on IntegriCloud