[PATCH] D107070: [Dexter] Improve Dexter's performance by evaluating expressions only when needed

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 03:14:44 PDT 2021


StephenTozer added inline comments.


================
Comment at: cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectProgramState.py:72
+                        frame_idx=idx,
+                        line_range=line_range
+                    )
----------------
jmorse wrote:
> StephenTozer wrote:
> > jmorse wrote:
> > > Is this going to lead to multiple StepExpectInfo objects referring to the same range object? And if so, doesn't that mean consuming the range in one frame will consume it in all the frames?
> > > 
> > > (If so, easily fixed by converting to a list).
> > I don't think so - the frame index is in the StepExpectInfo tuple, so unless the same value is being watched twice in the same stack frame there shouldn't be duplicates (and if there are then we should merge them).
> Possibly I've misread, but if there are multiple watches (line 66) in a frame, then multiple StepExpectInfo's will be constructed, each referring to the range object constructed on line 63, no?
Ah, I understand now - this isn't an issue, because python range objects are not consumed on use; they're an immutable object, and they must be in order to be used as part of a set element. For the same reason, we can't use a list here (because a list is a mutable object). This means that it should be perfectly safe to pass around the same object into every set.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107070



More information about the llvm-commits mailing list