[Lldb-commits] [PATCH] D97644: Allow RegisterContext to track if behaves-like-frame-0, allow LanguageRuntime for above frame 0

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 3 15:47:41 PST 2021


jasonmolenda added inline comments.


================
Comment at: lldb/source/Target/RegisterContext.cpp:162
+  if (!BehavesLikeZerothFrame())
+    pc--;
+  const bool allow_section_end = true;
----------------
clayborg wrote:
> Can we decrement the PC by the minimum instruction size? If we can get an ArchSpec we can call:
> 
> ```
> uint32_t ArchSpec::GetMinimumOpcodeByteSize() const;
> ```
> 
I don't know if it's worth it.  For fixed-width architectures, we'll be symbolicating an instruction boundary, but for others, we're just decrementing within the bounds of the instruction.  We should not ever show this address anywhere, it's only used for setting context and we need to be within the bounds of the instruction.  pc-1 seems fine to me.  I don't feel very strongly about this.


================
Comment at: lldb/source/Target/StackFrame.cpp:217-226
+  Address lookup_addr(GetFrameCodeAddress());
+  if (!lookup_addr.IsValid())
+    return lookup_addr;
+  if (m_behaves_like_zeroth_frame)
+    return lookup_addr;
+
+  addr_t offset = lookup_addr.GetOffset();
----------------
clayborg wrote:
> Should we be using the "bool RegisterContext::GetPCForSymbolication(Address &address)" function here to avoid having more than one place that is subtracting from the PC value?
Yeah, I thought about that as I was doing it.  I'll unify these.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97644/new/

https://reviews.llvm.org/D97644



More information about the lldb-commits mailing list