[Lldb-commits] [PATCH] D73303: [lldb/Target] Add Assert StackFrame Recognizer

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 28 08:40:18 PST 2020


mib marked an inline comment as done.
mib added inline comments.


================
Comment at: lldb/source/Target/AssertFrameRecognizer.cpp:155
+
+      most_relevant_frame_sp = thread_sp->GetStackFrameAtIndex(
+          std::min(frame_index + 1, last_frame_index));
----------------
JDevlieghere wrote:
> Why not return here? 
> 
> ```
> StackFrameSP most_relevant_frame_sp = thread_sp->GetStackFrameAtIndex(std::min(frame_index + 1, last_frame_index));
> return lldb::RecognizedStackFrameSP(new AssertRecognizedStackFrame(most_relevant_frame_sp));
> ```
> 
> That way you don't have to check again after you finish the loop and you can just `return RecognizedStackFrameSP();`.
Fair.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73303





More information about the lldb-commits mailing list