labath added a reviewer: jingham.
labath added a comment.

This seems reasonable, but let's wait for Greg and Jim's oppinions.



================
Comment at: lldb/source/Target/ThreadPlanStepOverRange.cpp:176
+        // rely on that breakpoint to trigger once we return to the range.
+        if (m_next_branch_bp_sp)
+          return false;
----------------
jarin wrote:
> We could do some more sanity checking here. 
> 
> For example, we could ensure that the return address is still before the next 
> branch breakpoint, or, ideally, record the beginning of the next-branch range 
> and check the return address is in that range. However, I am not quite sure 
> what this would protect us against (mucking with the stack, perhaps?) and 
> what to do if the check fail - falling back to the old behavior does not 
> really seem to solve anything because that introduces even more noise by 
> pushing all the step-out plans.
Theoretically the extra stops forced by the step-outs could give us an 
opportunity to bail out if we detect that the inferior stack is changing 
unexpectedly, but I'm not sure how often that would actually result in 
something useful.

In general, all thread plans kind of have to assume that the process is using 
its stack in reasonable manner, and they can fail spectacularly if the process 
does some unexpected control flow or stack manipulations (e.g. a `longjmp`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76216



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to